Up to cover page | Back to ECMAScript | On to Appendices
This chapter and its sections are normative, unless otherwise indicated.
This section is informative (non-normative).
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.
The use cases and requirements for the default-setting functionality of the ACI include several scenarios that the ACI file should satisfy:
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.
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:
webcgmConfig
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.
An ACI file must have webcgmConfig
as its root element.
<!ELEMENT webcgmConfig ( fontMap?, defaultAttributes? ) > |
The fontMap
element is the ACI mechanism for font
substitution.
<!ELEMENT fontMap ( defaultFont?, mapList* ) > |
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.
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">
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.
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'.
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'.
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'.
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'.
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'.
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'.
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.
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'.
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.
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 ) > |
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.
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 ) > |
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 ) > |
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 ) > |
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 ) >