Font Overview
Introduction
There are two major concepts behind how text and fonts work within the control, 'font handle' properties
(which affect the physical appearance of fonts, such as boldness, face name type, etc.) and 'font behavior'
properties (how text shapes are displayed with regards to their offset point).
Font Handles
Fonts are made available for use by text shapes in the control when they are opened with FontOpen.
This method returns a unique font handle number used to reference the opened font. By default, the control
begins with one open font ( Arial, with a world coordinate height of 12) , whose handle is "0"
(zero).
Each level of the control - cad, layer, group, and text shape -have a font handle. When the font handle
at the layer or shape level is set to -1, this means to use the next highest level in the control until
a font handle is actually defined.
The precedence for which font handle a text shape uses is as follows:
1. Shape (default is either what was passed to TextAdd
or what FontCurrent
is at the time the shape was created)
2. Group (-1 by default)
3. Layer (-1 by default)
4. Cad (0 by default)
For instance, say a text shapes' ShapeFontHandle
is set -1, and the layer it resides on has a LayerFontHandle
of 2. The text shape displays using the layers' font handle because it has been defined to something other
than -1. If the layer had a font handle of -1, then the text shape would use the CadFontHandle
(which always is set to a defined, usable font handle ).
Note that FontCurrent
can be used to set the font handle that text shapes will get when they are added to the control with the
mouse (via ViewMouseTool).
Font Handle Properties and Defaults:
Font handles have properties that control their appearance. The properties for customizing a font handle
include:
FontBold
Sets the bold style of the font. The default bold value is False.
FontFace
Sets the type face of the font. The default face value is Arial.
FontItalic
Sets the italic style of the font. The default italic value is False.
FontSize
Sets the size of the font. The default size value is 12 world units. Note that size
is in world units.
FontStrikeout
Sets the strikeout style of the font. The default strikeout value is False. "This
is the strikeout font style"
FontUnderline
Sets the underline style of the font. The default underline value is False.
Font Behavior
The font behavior properties control the orientation, justification, alignment and scalibility
of text shapes
Font behavior properties can be set at the cad, layer, group, and shape levels. This gives you the
flexibility to set how you want the font behavior of shapes to conform with the rest of the control.
By default, only the cad level begins with a font behavior. Once any of the font behavior properties
are set at the other levels, that level will get its own font behavior (similar to how color
states are handled in the control).
The font behavior that text shapes use depends on at which level font behaviors have been set, based
on the following precedence:
1. Shape
2. Group
3. Layer
4. Cad
For instance, by default Layer 1 will use the font behavior of the cad level ( the cad level has defalut
settings). By setting any of the layer font behavior properties ( i.e. LayerFontAlign ), the layer
now gets its own font behavior, and shapes on this layer that do not have their own font behavior set
will take on the layers' new behavior.
To reset the font behavior of the shape, group or layer (causing it to use the font behavior of next
highest level in the color hierarchy), use ShapeFontBehaviorReset
and LayerFontBehaviorReset.
There is also CadFontBehaviorReset,
which returns the behavior properties to their original values.
To query whether or not a layer/shape has its own font behavior, call LayerIsFontBehaviorSet
or ShapeIsFontBehaviorSet.
Font Behaviors and Defaults:
Alignment
Sets how the charcters of a text shape are aligned in relation to an Y position. The default
alignment is top aligned.
Justification
Sets how the charcters of a text shape are aligned in relation to an X position. The default
justification is left justified.
Orientation
Sets the rotaion of the text shape in tenths of degrees. The default orientation is 0
or no rotation.
Scale
Determines if the text shape is or is not scaled in relation to the world coordinate system. The
default scale behavior is a fixed scale independent of the world coordinate system.
See Also
Cad Font Properties: CadFontAlign,
CadFontHandle,
CadFontJustify,
CadFontOrientation,
CadFontScale
Layer Font Properties: LayerFontAlign,
LayerFontHandle,
LayerFontJustify,
LayerFontOrientation,
LayerFontScale
Shape Font Properties: ShapeFontAlign,
ShapeFontHandle,
ShapeFontJustify,
ShapeFontOrientation,
ShapeFontScale
Font Handle Properties: FontBold,
FontFace,
FontItalic,
FontSize,
FontStikeout,
FontUnderline
Other: CadFontBehaviorReset,
LayerFontBehaviorReset,
ShapeFontBehaviorReset,
LayerIsFontBehaviorSet,
ShapeIsFontBehaviorSet
![]() |
Last modified on: Tuesday, February 04, 2003