KEMBAR78
Character Attribute in computer graphics | PPTX
PRESENTED BY
CHARACTER ATTRIBUTES
Mrs.A.Agatha Chithra M.Sc.,B.Ed.,M.Phil.,
Character Attributes
 The appearance of displayed characters is
controlled by attributes such as font, size, color, and
orientation.
 Attributes can be set both for entire character strings
(text) and for individual characters defined
as marker symbols.
Text Attributes
• First of all, there is the choice of font (or typeface), which is a set of
characters with a particular design style such as New York, Courier,
Helvetica, London, 'Times Roman, and various special symbol grou
ps.
• The characters in a selected font can also be displayed with assorted
underlining styles (solid, dotted, double), in boldface, in italics. and
in outline or shadow styles.
• A particular font and associated style is selected in a PHIGS progra
m by setting an integer code for the text font parameter t f in the fun
ction.
setTextFont(tf)
• Color settings for displayed text are stored in the system attribute lis
t and used by the procedures that load character definitions into the f
rame buffer.
• When a character string is to be displayed, the current color is used t
o set pixel values in the frame buffer corresponding to the character
shapes and positions
• Control of text color (or intensity) is managed from an application p
rogram with
setTextColorIndex(tc)
• where text color parameter to specifies an allowable color code.
• Character size (height) is specified by printers in points, where 1 poi
nt=0.035146 cm.
• The distance between the bottom line and the top line of the characte
r body is the same for all characters in a particular size and typeface,
but the body width may vary.
• Character height is defined as the distance between the baseline and
the cap line of characters.
• Text size can be adjusted without changing the width-to-height ratio
of characters with
setChatacterHeight(ch)
• Parameter ch is assigned a real value greater than 0 to set the coordi
nate height of capital letters: the distance between baseline and capli
ne in user coordinates.
• The width only of text can be set with the function
setCharacterExpansionFactor(cw)
• where the character-width parameter cw is set to a positive real valu
e that scales the body width of characters.
• Spacing between characters is controlled separately with
setCharacterSpacing(cs)
• where the character-spacing parameter cs can he assigned any real v
alue. The value assigned to cs determines the spacing between chara
cter bodies along print lines.
• Negative values for cs overlap character bodies; positive values inse
rt space to spread out the displayed characters.
• The orientation for a displayed character string is set according to th
e direction of the character up vector:
• setCharacterUpVector(upvect)
• Parameter upvect in this function is assigned two values that specify
the x and y vector components.
• Text is then displayed so that the orientation of characters from basel
ine to capline is in the direction of the up vector.
• For example, with upvect = (I, I), the direction of the up vector is 45"
and text would be displayed
• It is useful in many applications to be able to arrange character strin
gs vertically or horizontally. An attribute parameter for this option is
set with the statement
setTextPath(tp)
• where the text-path parameter tp can be assigned the value: right, lef
t, up, or down.
• A procedure for implementing this option must transform the charac
ter patterns into the specified orientation before transferring them to
the frame buffer
• Another handy attribute for character strings is alignment. This attri
bute specifies how text is to be positioned with respect to the start co
ordinates. Alignment attributes are set with
setAlignment(h,v)
• where parameters h and v control horizontal and vertical alignment.
• Horizontal alignment is set by assigning ha value of left, centre, or ri
ght.
• Vertical alignment is set by assigning v a value of top, cap, half, bas
e, or bottom
Fig: Alignments of a
Character String
• A precision specifici~tionf or text display is given with
setTextPrecision(tpr)
• where text precision parameter tpr is assigned one of the values: strin
g, char, or stroke.
• The highest-quality text is displayed when the precision parameter is
set to the value stroke
Marker Attribute
• A marker symbol is a single character that can he displayed in differ
ent colors and in different sizes.
• We select a particular character to be the marker symbol with
setMarkerType(mt)
• Where marker type parameter mt is set to an integer code.
• Typical codes for marker type are the integers 1 through 5,
• Specifying, respectively, a dot (.), a vertical cross (+), an asterisk (*)
, a circle (o), and a diagonal cross (X)." Displayed marker types are
centered on the marker coordinates.
• We set the maker size with
setMakerSizeScaleFactor (ms)
• Marker color is specified with
setPolymarkerColoulndex (mc)
• A selected color code for parameter mc is stored in the current attribu
te list and used to display subsequently specified marker primitives.
Thank You

Character Attribute in computer graphics

  • 1.
  • 2.
    Character Attributes  Theappearance of displayed characters is controlled by attributes such as font, size, color, and orientation.  Attributes can be set both for entire character strings (text) and for individual characters defined as marker symbols.
  • 3.
    Text Attributes • Firstof all, there is the choice of font (or typeface), which is a set of characters with a particular design style such as New York, Courier, Helvetica, London, 'Times Roman, and various special symbol grou ps. • The characters in a selected font can also be displayed with assorted underlining styles (solid, dotted, double), in boldface, in italics. and in outline or shadow styles.
  • 4.
    • A particularfont and associated style is selected in a PHIGS progra m by setting an integer code for the text font parameter t f in the fun ction. setTextFont(tf) • Color settings for displayed text are stored in the system attribute lis t and used by the procedures that load character definitions into the f rame buffer. • When a character string is to be displayed, the current color is used t o set pixel values in the frame buffer corresponding to the character shapes and positions
  • 5.
    • Control oftext color (or intensity) is managed from an application p rogram with setTextColorIndex(tc) • where text color parameter to specifies an allowable color code. • Character size (height) is specified by printers in points, where 1 poi nt=0.035146 cm.
  • 6.
    • The distancebetween the bottom line and the top line of the characte r body is the same for all characters in a particular size and typeface, but the body width may vary. • Character height is defined as the distance between the baseline and the cap line of characters.
  • 7.
    • Text sizecan be adjusted without changing the width-to-height ratio of characters with setChatacterHeight(ch) • Parameter ch is assigned a real value greater than 0 to set the coordi nate height of capital letters: the distance between baseline and capli ne in user coordinates.
  • 8.
    • The widthonly of text can be set with the function setCharacterExpansionFactor(cw) • where the character-width parameter cw is set to a positive real valu e that scales the body width of characters.
  • 9.
    • Spacing betweencharacters is controlled separately with setCharacterSpacing(cs) • where the character-spacing parameter cs can he assigned any real v alue. The value assigned to cs determines the spacing between chara cter bodies along print lines. • Negative values for cs overlap character bodies; positive values inse rt space to spread out the displayed characters.
  • 10.
    • The orientationfor a displayed character string is set according to th e direction of the character up vector: • setCharacterUpVector(upvect) • Parameter upvect in this function is assigned two values that specify the x and y vector components. • Text is then displayed so that the orientation of characters from basel ine to capline is in the direction of the up vector.
  • 11.
    • For example,with upvect = (I, I), the direction of the up vector is 45" and text would be displayed
  • 12.
    • It isuseful in many applications to be able to arrange character strin gs vertically or horizontally. An attribute parameter for this option is set with the statement setTextPath(tp) • where the text-path parameter tp can be assigned the value: right, lef t, up, or down. • A procedure for implementing this option must transform the charac ter patterns into the specified orientation before transferring them to the frame buffer
  • 14.
    • Another handyattribute for character strings is alignment. This attri bute specifies how text is to be positioned with respect to the start co ordinates. Alignment attributes are set with setAlignment(h,v) • where parameters h and v control horizontal and vertical alignment. • Horizontal alignment is set by assigning ha value of left, centre, or ri ght. • Vertical alignment is set by assigning v a value of top, cap, half, bas e, or bottom
  • 15.
    Fig: Alignments ofa Character String
  • 16.
    • A precisionspecifici~tionf or text display is given with setTextPrecision(tpr) • where text precision parameter tpr is assigned one of the values: strin g, char, or stroke. • The highest-quality text is displayed when the precision parameter is set to the value stroke
  • 17.
    Marker Attribute • Amarker symbol is a single character that can he displayed in differ ent colors and in different sizes. • We select a particular character to be the marker symbol with setMarkerType(mt) • Where marker type parameter mt is set to an integer code. • Typical codes for marker type are the integers 1 through 5, • Specifying, respectively, a dot (.), a vertical cross (+), an asterisk (*) , a circle (o), and a diagonal cross (X)." Displayed marker types are centered on the marker coordinates.
  • 18.
    • We setthe maker size with setMakerSizeScaleFactor (ms) • Marker color is specified with setPolymarkerColoulndex (mc) • A selected color code for parameter mc is stored in the current attribu te list and used to display subsequently specified marker primitives.
  • 19.