Up to cover page | Back to ECMAScript | On to Appendices

WebCGM 2.1 — Application Configurable Items


9. Application Configurable Items

This chapter and its sections are normative, unless otherwise indicated.

Contents

9.1 Introduction

This section is informative (non-normative).

9.1.1 Scope and purpose

The WebCGM Aplication Configuration Items file (ACI) allows the user to improve font interchange by specifying a desired font mapping between when WebCGM applications process WebCGM content.

The ACI file also provides a mechanism to specify default handling for certain CGM Version 3 elements that may not have a specific default treatment according to the rules of CGM:1999 or the WebCGM profile.

The ACI file is designed as a set of initialization directives for a viewer, and thus is intended to be associated with a viewer instance and processed once per viewer invocation. The normative specification of methods to associate an ACI file with a viewer is beyond the scope of this version of WebCGM. Some recommedations are given in this chapter.

9.1.2 Motivation

The use cases and requirements for the default-setting functionality of the ACI include several scenarios that the ACI file should satisfy:

  1. In Version 1 or Version 2 CGM files, it is not possible to control things like LINE CAP, which is a Version 3 CGM element. Viewers have to select a treatment at random. There is desire to be able to specify consistent and uniform treatment.
  2. In V3/V4 files, the CGM:1999-specified default for things like LINE CAP is: 1, "unspecified". CGM:1999 did this so that behavior of viewers would be backward compatible. I.e., the rendering of an otherwise identical file would not change purely based on "V1" versus "V3" in the metafile version. There is desire to be able to specify a consistent and uniform default.
  3. The CGM line types 1..5 (solid, dash, dot, dash-dot, dash-dot-dot) are generic in the sense that they only need to be recognizably per the description (e.g., dash-dot). Similarly for the 6 generic hatch styles. There is desire to be able to specify consistent and uniform treatment.

9.2 ACI content and conformance

9.2.1 File overview

The WebCGM Application Configurable Item (ACI) file is an XML instance specifying default values for various CGM Version 3 attribute and control elements, font substitutions to be performed by WebCGM processors . It is made up of a root element (<webcgmConfig>) followed by an optional font map (<fontMap>) elment and an optional default style properties (<defaultAttributes>) element.

9.2.2 Conformance of ACI files

A file is a conforming WebCGM 2.1 ACI document if it adheres to the specifications described in this (WebCGM 2.1) document, including those in the WebCGM 2.1 ACI DTD, and in addition:

9.2.3 Association of ACI files with viewers

This subsection is informative (non-normative).

Methods to associate an ACI file with a viewer — being operating system, viewer, and application dependent — are considered to be beyond the scope of the normative specifications of this version of WebCGM. To improve interoperability between the various providers of WebCGM 2.1 viewers, the following recommendations for associating an ACI file with a WebCGM 2.1 viewer are included.

It is recommended ACI file have the extension ".aci" (all lowercase) on all platforms.

To convey to a WebCGM 2.1 viewer the location of an ACI file, an environment variable name WebCGM_ACI_File is defined. This environment variable could be set at the time of the viewer installation or modified by a user. On Windows this should be System environment variable that would apply to all users.

Example:

WebCGM_ACI_File=c:/Documents and Settings/All Users/Application Data/CGM Open/WebCGM

If not feasible for a viewer to set an environment variable during viewer installation or users are prohibited from doing so due to security policies that are becoming commonplace in large organizations, then the viewer should provide an alternative method for users to specify the ACI file search path, for example in a viewer preferences or configuration menu.

9.3 ACI elements

9.3.1 The 'webcgmConfig' element

An ACI file must have webcgmConfig as its root element.

<!ELEMENT webcgmConfig ( fontMap?, defaultAttributes? ) >

9.3.2 The 'fontMap' element

The fontMap element is the ACI mechanism for font substitution.

<!ELEMENT fontMap ( defaultFont?, mapList* ) >

9.3.2.1 The 'defaultFont' element

The defaultFont element specifies, via its useFont attribute, a string defining the font to be used when a requested mapping cannot be accomplished.

<!ELEMENT defaultFont EMPTY >
<!ATTLIST defaultFont
          useFont CDATA #REQUIRED >
        

Attribute definitions:
useFont="CDATA"
The default font to use when the specified font mapping cannot be accomplished. If the font(s) of mapList (substitutionList) are not available, and if defaultFont (useFont) is not available, then the fontMap element has no effect, and any viewer fallback action is viewer dependent. The syntax and normalization rules of useFont are the same as those of the substitutionList attribute, except that useFont shall have exactly one font-family name or generic name in its list.

9.3.2.2 The 'mapList' element

The mapList element specifies, via its cgmFont and substitutionList attributes, the font mapping to be performed before rendering of the image. Subject to the value of the forceSubstitution attribute (see below), if the metafile uses a font whose name matches cgmFont (after normalization of both font names as described below), then the viewer shall substitute the first available font in the priority-ordered list of the substitutionList attribute.

<!ELEMENT maplist EMPTY >
<!ATTLIST maplist
          forceSubstitution ( yes | no ) “yes”
          cgmFont CDATA #REQUIRED
          substitutionList CDATA #REQUIRED >
        

Attribute definitions:
forceSubstitution= { yes | no }
If 'yes', then the subsitution is unconditional -- it is attempted regardless of whether or not the viewer has the font specified by cgmFont available. If 'no', then the substitution is conditional -- the viewer only attempts the substitution if it does not have the font specified by cgmFont available.
cgmFont="CDATA"
The name of the font in the metafile for which font substitution is requested. Before attempting to match a font used in the metafile to the string cgmFont, the both font names are normalized by: converting to lower-case; and stripping out all whitespace, UNDERSCORE, and HYPHEN characters. Note: These normalization rules are applicable for font names specified using the characters of ISOLatin1. They will likely be inapplicable for font names specified using other non-Latin characters.
substitutionList="CDATA"
A comma-separated, priority-ordered list of comprised of font-family names (e.g., Arial) and generic names (e.g., san-serif). The processor shall use the name in the substitutionList that it has available. The list syntax and normalization are derived from the specifications of CSS 2.0 [CSS20]. In particular, the values and syntax of the substitutionList attribute are derived from CSS's definition of the font-family property:

Example:

<maplist cgmFont="helvetica" substitutionList="Arial, 'FontCorp Swiss', sans-serif">

9.3.3 The 'defaultAttributes' element

The defaultAttributes element is the ACI mechanism to specify default values for certain CGM attribute and control elements whose default is otherwise under-specified in CGM:1999 and the WebCGM profile. This element, when processed at initialization time, will set default values for the applicable metafile elements. If the contents of the metafile, upon interpretation, explicitly set the applicable metafile element (either via METAFILE DEFAULTS REPLACEMENT or via the element itself in the body of the picture), then that explicit intra-metafile setting supersedes the defaultAttributes setting

<!ELEMENT defaultAttributes ( lineCap | edgeCap | lineJoin | edgeJoin 
                           | lineTypeCont | edgeTypeCont | mitreLimit 
                           | restrTextType | lineEdgeTypeDef | hatchStyleDef )+ >

It is possible to define the default values of the following Version 3 elements:

The parameter definition for each element is consistent with its ISO/IEC 8632:1999 CGM parameter definition.

9.3.3.1 The 'lineCap' element

The lineCap element is an EMPTY element that specifies the desired rendering of the end caps of lines and of dashes within lines.

<!ELEMENT lineCap EMPTY >
<!ATTLIST lineCap
          lineCapInd ( 1 | 2 | 3 | 4 ) "1"
          lineDashInd ( 1 | 2 | 3 ) "1"
>

Attribute definitions:
lineCapInd="1|2|3|4|5"
The line cap indicator is restricted to value of 1-4. (Note that the ISO/IEC 8632:1999 value "5" is disallowed in the WebCGM profile.)

The default value is '1' or 'unspecified'.

lineDashInd="1|2|3"
The line dash cap indicator is restricted to values of 1-3 as defined in ISO/IEC 8632:1999.

The default value is '1' or 'unspecified'.

9.3.3.2 The 'edgeCap' element

The edgeCap element is an EMPTY element that specifies the desired rendering of the end caps of edges and of dashes within edges.

<!ELEMENT edgeCap EMPTY >
<!ATTLIST edgeCap
          edgeCapInd ( 1 | 2 | 3 | 4 ) "1"
          edgeDashInd ( 1 | 2 | 3 ) "1" 
>

Attribute definitions:
edgeCapInd="1|2|3|4"
The edge cap indicator is restricted to value of 1-4. (Note that the ISO/IEC 8632:1999 value "5" is disallowed in the WebCGM profile.)

The default value is '1' or 'unspecified'.

edgeDashInd="1|2|3"
The edge dash cap indicator is restricted to values of 1-3 as defined in ISO/IEC 8632:1999.

The default value is '1' or 'unspecified'.

9.3.3.3 The 'lineJoin' element

The lineJoin element is an EMPTY element that specifies the desired rendering of the join characteristics at vertices of the line element.

<!ELEMENT lineJoin EMPTY >
<!ATTLIST lineJoin
          lineJoinInd ( 1 | 2 | 3 | 4 ) "1"
>

Attribute definitions:
lineJoinInd="1|2|3|4"
The line join indicator is restricted to value of 1-4 as defined in ISO/IEC 8632:1999.

The default value is '1' or 'unspecified'.

9.3.3.4 The 'edgeJoin' element

The edgeJoin element is an EMPTY element that specifies the desired rendering of the join characteristics at vertices of the edge element.

<!ELEMENT edgeJoin EMPTY >
<!ATTLIST edgeJoin
          lineJoinInd ( 1 | 2 | 3 | 4 ) "1"
>

Attribute definitions:
edgeJoinInd="1|2|3|4"
The edge join indicator is restricted to value of 1-4 as defined in ISO/IEC 8632:1999.

The default value is '1' or 'unspecified'.

9.3.3.5 The 'lineTypeCont' element

The lineTypeCont element of the ACI is an EMPTY element that specifies the desired rendering of the line type continuation characteristics of the line element.

<!ATTLIST lineTypeCont
          lineContMode ( 1 | 2 | 3 | 4 ) "1"
>

Attribute definitions:
lineContMode="1|2|3|4"
The line type continuation indicator is restricted to value of 1-4 as defined in ISO/IEC 8632:1999.

The default value is '1' or 'unspecified'.

9.3.3.6 The 'edgeTypeCont' element

The edgeTypeCont element is an EMPTY element that specifies the desired rendering of the edge type continuation characteristics of the edge element.

<!ATTLIST edgeTypeCont
          edgeContMode ( 1 | 2 | 3 | 4 ) "1"
>

Attribute definitions:
edgeContMode="1|2|3|4"
The edge type continuation indicatoris restricted to value of 1-4 as defined in ISO/IEC 8632:1999.

The default value is '1' or 'unspecified'.

9.3.3.7 The 'mitreLimit' element

The mitreLimit element is an EMPTY element that specifies how line join at vertices are achieved.

<!ELEMENT mitreLimit EMPTY >
<!ATTLIST mitreLimit
          limitVal CDATA #REQUIRED
>

Attribute definitions:
limitVal="CDATA"
The mitre limit value is defined as a scale factor applied to current line and edge width. Valid values are non-negative real numbers.

9.3.3.8 The 'restrTextType' element

The lineCap element is an EMPTY element that specifies the desired rendering of the end caps of lines and dashes within lines.

<!ELEMENT restrTextType EMPTY >
<!ATTLIST restrTextType
          restrType ( 1 | 2 | 3 | 4 | 5 | 6 ) "1"
>

Attribute definitions:
restrType="1|2|3|4|5|6"
The restricted text type is restricted to value of 1-6 as defined in ISO/IEC 8632:1999.

The default value is '1' or 'basic'.

9.3.3.9 The 'lineEdgeTypeDef' element

The lineEdgeTypeDef element is an element that specifies the desired rendering of the standard line type in ISO/IEC 8632:1999.

<!ELEMENT lineEdgeTypeDef ( dashLength+ ) >
<!ATTLIST lineEdgeTypeDef
          lineIndex ( 1 | 2 | 3 | 4 | 5 ) #REQUIRED
          repeatLength CDATA #REQUIRED
>

Attribute definitions:
lineIndex="1|2|3|4|5"
The line type index is restricted to value of 1-5 as defined in ISO/IEC 8632:1999.

repeatLength="CDATA"
The dash cycle repeat length defines the length of one complete repetition of the dash pattern in NVDC units.

9.3.3.9.1 The 'dashLength' element

The dashLength element is a string, in the encoding of the ACI file, that contains a list of non-negative integers in the format of the WebCGMString List-of-number subtype. The integers specify the lengths of each dash and gap in the defined line pattern in abstract units, that are then normalized as a whole pattern to the repeatLength attribute of lineEdgeTypeDef. The first integer corresponds to solid, the second to gap, the third to solid, etc.

<!ELEMENT dashLength ( #PCDATA ) >

9.3.3.10 The 'hatchStyleDef' element

The hatchStyleDef element specifies the desired rendering of the standard hatches in ISO/IEC 8632:1999.

<!ELEMENT hatchStyleDef ( directionVectors, ( gapWidth+ ), ( lineTypeIndex+ ) ) >
<!ATTLIST hatchStyleDef
          hatchIndex ( 1 | 2 | 3 | 4 | 5 | 6 ) #REQUIRED
          styleInd ( parallel | crosshatch ) #REQUIRED
          cycleLength CDATA #REQUIRED
          numberOfLines CDATA #REQUIRED
>

Attribute definitions:
hatchIndex="1|2|3|4|5|6"
The hatch style index is restricted to value of 1-6 as defined in ISO/IEC 8632:1999.

styleInd="paralel|crosshatch"
The style indicator indicates whether the hatch pattern is made up of parallel lines or crosshatch lines.

cycleLength="CDATA"
The duty cycle length defines the length of one one complete repetition of the hatch pattern. It is measured perpendicular to the hatch lines and is in NVDC units.

numberOfLines="CDATA"

The number of hatch lines defines the number of entries in the list of gap widths and list of lines types.

9.3.3.10.1 The 'directionVectors', 'vectorX' and 'vectorY' elements

The directionVectors element contains the vectorX and vectorY elements to define the direction of the hatch lines. The units are NVDC. If the style indicator is parallel, only the first set of vectors is used, but both must be present. The 4 numbers of directionVectors are encoded in the format of the WebCGMString List-of-number subtype.

<!ELEMENT directionVectors ( vectorX, vectorY, vectorX, vectorY ) >
<!ELEMENT vectorX ( #PCDATA ) >
<!ELEMENT vectorY ( #PCDATA ) >

9.3.3.10.2 The 'gapWidth' element

The gapWidth element defines the width between the lines in the hatch pattern. It is a list of positive integers. The number of gap width integers cooresponds to the number-of-lines attribute in the hatch style definition. The list of values of gapWidth are encoded in the format of the WebCGMString List-of-number subtype.

<!ELEMENT gapWidth ( #PCDATA ) >

9.3.3.10.3 The 'lineTypeIndex' element

The lineTypeIndex element defines the line types of the lines that make up the hatch pattern. The number of line type index elements cooresponds to the number of lines attribute in the hatch style definition. Valid values are 1-5. The list of values of lineTypeIndex are encoded in the format of the WebCGMString List-of-number subtype.

<!ELEMENT lineTypeIndex ( #PCDATA ) >

9.4 The complete ACI DTD

The complete WebCGM Application Configurable Items (ACI) file DTD follows.

<?xml version="1.0" encoding="UTF-8"?>
<!-- ================================================================ -->
<!-- This is the WebCGM Application Configurable Item file DTD        -->
<!-- for use with  WebCGM 2.1                                         -->
<!-- ================================================================ -->
<!-- Original issue: March 2008                                       -->
<!--                                                                  -->
<!-- Revision history:                                                -->
<!--      June 2008 - modified for changes to CD02 ACI text.          -->
<!--                                                                  -->
<!-- ================================================================ -->
<!--                                                                  -->
<!ELEMENT webcgmConfig ( fontMap?, defaultAttributes? )                 >

<!ELEMENT fontMap ( defaultFont?, maplist* )  >

<!ELEMENT defaultFont EMPTY                                             >
<!ATTLIST defaultFont 
          useFont CDATA #REQUIRED >

<!ELEMENT maplist EMPTY                                                 >
<!ATTLIST maplist
          forceSubstitution ( yes | no ) "yes" 
          cgmFont CDATA #REQUIRED 
          substitutionList CDATA #REQUIRED                              >

<!ELEMENT defaultStyleProp ( lineCap | edgeCap | lineJoin | edgeJoin 
                           | lineTypeCont | edgeTypeCont | mitreLimit 
                           | restrTextType | lineEdgeTypeDef 
                           | hatchStyleDef )+                           >

<!ELEMENT lineCap EMPTY                                                 >
<!ATTLIST lineCap
          lineCapInd ( 1 | 2 | 3 | 4 | 5 ) "1"
          lineDashInd ( 1 | 2 | 3 ) "1"                                 >

<!ELEMENT edgeCap EMPTY                                                 >
<!ATTLIST edgeCap
          edgeCapInd ( 1 | 2 | 3 | 4 | 5 ) "1"
          edgeDashInd ( 1 | 2 | 3 ) "1"                                 >

<!ELEMENT lineJoin EMPTY                                                >
<!ATTLIST lineJoin
          lineJoinInd ( 1 | 2 | 3 | 4 ) "1"                             >

<!ELEMENT edgeJoin EMPTY                                                >
<!ATTLIST edgeJoin
          edgeJoinInd ( 1 | 2 | 3 | 4 ) "1"                             >

<!ELEMENT lineTypeCont EMPTY                                            >
<!ATTLIST lineTypeCont
          lineContMode ( 1 | 2 | 3 | 4 ) "1"                            >

<!ELEMENT edgeTypeCont EMPTY                                            >
<!ATTLIST edgeTypeCont
          edgeContMode ( 1 | 2 | 3 | 4 ) "1"                            >

<!ELEMENT mitreLimit EMPTY                                              >
<!ATTLIST mitreLimit
          limitVal CDATA #REQUIRED                                      >

<!ELEMENT restrTextType EMPTY                                           >
<!ATTLIST restrTextType
          restrType ( 1 | 2 | 3 | 4 | 5 | 6 ) "1"                       >

<!ELEMENT lineEdgeTypeDef ( dashLength+ )                               >
<!ATTLIST lineEdgeTypeDef
          lineIndex ( 1 | 2 | 3 | 4 | 5 ) #REQUIRED
          repeatLength CDATA #REQUIRED                                  >

<!ELEMENT dashLength ( #PCDATA )                                        >

<!ELEMENT hatchStyleDef ( directionVectors, ( gapWidth+ ), 
                                            ( lineTypeIndex+ ) )        >
<!ATTLIST hatchStyleDef
          hatchIndex ( 1 | 2 | 3 | 4 | 5 | 6 ) #REQUIRED
          styleInd ( parallel | crosshatch ) #REQUIRED
          cycleLength CDATA #REQUIRED
          numberOfLines CDATA #REQUIRED                                 >

<!ELEMENT directionVectors ( vectorX, vectorY, vectorX, vectorY )       >

<!ELEMENT vectorX ( #PCDATA )                                           >

<!ELEMENT vectorY ( #PCDATA )                                           >

<!ELEMENT gapWidth ( #PCDATA )                                          >

<!ELEMENT lineTypeIndex ( #PCDATA )                                     >

Back to top of chapter