This class defines a Font Style.
The Style can be Predefined or defined by the user
Public Member Functions |
DEFINE_STANDARD_ALLOC | Aspect_FontStyle () |
| Creates a font style with the default values of
FontStyle type : DEFAULT
|
| Aspect_FontStyle (const Aspect_TypeOfFont Type, const Quantity_Length Size, const Quantity_PlaneAngle Slant=0.0, const Standard_Boolean CapsHeight=Standard_False) |
| Creates the font style <Type> depending of
Size given in the basic LENGTH unit and Slant in
the basic PLANE ANGLE unit.
When CapsHeight is TRUE the size defines the
ascent height of the font;if FALSE,the size
defines the ascent+descent part of the font.
|
| Aspect_FontStyle (const Standard_CString Style, const Quantity_Length Size, const Quantity_PlaneAngle Slant=0.0, const Standard_Boolean CapsHeight=Standard_False) |
| Creates a font style from Adobe font style descriptor
depending of Size given in MM and Slant in RADIAN.
When CapsHeight is TRUE the size defines the
ascent height of the font;if FALSE,the size
defines the ascent+descent part of the font.
Font Style Descriptor must be :
Simple form is "family" Ex: "helvetica"
More complex form is "family-weight" Ex: "helvetica-bold"
Full form is :
"-foundry-family-weight-slant-swdth-adstyl-pixelsize"
"-pointsize-resx-resy-spacing-avgWidth-registry-encoding"
where each field must be replaced by an "*"
Warning: create the smalest font size if the foundry height
|
| Aspect_FontStyle (const Standard_CString Style) |
| Creates a transformable font with the full font name <Style>
given in the XLFD descriptor :
"-foundry-family-weight-slant-swidth-adstyl-pixelsize-pointsize- <br>
resx-resy-spacing-avdWidth-registry-encoding".
The fields pixelsize ,pointsize,resx,resy are sets to 0
and all unknown fields sets to '*'.
Example: "adobe-helvetica-bold-*-*-*-0-0-0-0-*-*-iso8859-*"
Warning: the height and slant of the font is supposed to be NULL
and computed dynamically at the drawing text time.
|
Aspect_FontStyle & | Assign (const Aspect_FontStyle &Other) |
| Updates the font style <me> from the definition of the
font style <Other>.
|
Aspect_FontStyle & | operator= (const Aspect_FontStyle &Other) |
void | SetValues (const Aspect_TypeOfFont Type, const Quantity_Length Size, const Quantity_PlaneAngle Slant=0.0, const Standard_Boolean CapsHeight=Standard_False) |
| Updates the font style <me> from the definition of the
font style <Type>.
|
void | SetValues (const Standard_CString Style, const Quantity_Length Size, const Quantity_PlaneAngle Slant=0.0, const Standard_Boolean CapsHeight=Standard_False) |
| Updates a font style with the new Abode font descriptor
Warning: create the smalest font size if the foundry height
|
void | SetValues (const Standard_CString Style) |
| Updates a font style with the new XLFD font descriptor
|
void | SetFamily (const Standard_CString aName) |
| Sets the family of the font.
|
void | SetWeight (const Standard_CString aName) |
| Sets the weight of the font.
|
void | SetRegistry (const Standard_CString aName) |
| Sets the registry of the font.
|
void | SetEncoding (const Standard_CString aName) |
| Sets the encoding of the font.
|
Aspect_TypeOfFont | Style () const |
| Returns the type of the font style <me>
|
Standard_Integer | Length () const |
| Returns the string components length of the
font style descriptor
|
Standard_CString | Value () const |
| Returns the String component of a font style
|
Quantity_Length | Size () const |
| Returns the Size component of a font style
|
Quantity_PlaneAngle | Slant () const |
| Returns the Slant component of a font style
|
Standard_Boolean | CapsHeight () const |
| Returns the CapsHeight component of a font style
|
Standard_CString | AliasName () const |
| Returns a shorter font name which identify the
main characteristics of the fonts.
|
Standard_CString | FullName () const |
| Returns the full normalized font name
|
Standard_CString | Foundry () const |
| Returns the foundry of the font.
|
Standard_CString | Family () const |
| Returns the family of the font.
|
Standard_CString | Weight () const |
| Returns the weight of the font.
|
Standard_CString | Registry () const |
| Returns the char set registry of the font.
|
Standard_CString | Encoding () const |
| Returns the char set encoding of the font.
|
Standard_CString | SSlant () const |
| Returns the slant of the font.
|
Standard_CString | SWidth () const |
| Returns the width name of the font.
|
Standard_CString | SStyle () const |
| Returns the style name of the font.
|
Standard_CString | SPixelSize () const |
| Returns the pixel size of the font.
|
Standard_CString | SPointSize () const |
| Returns the point size of the font.
|
Standard_CString | SResolutionX () const |
| Returns the resolution X of the font.
|
Standard_CString | SResolutionY () const |
| Returns the resolution Y of the font.
|
Standard_CString | SSpacing () const |
| Returns the spacing of the font.
|
Standard_CString | SAverageWidth () const |
| Returns the average width of the font.
|
void | Dump () const |
| Dumps the font attributes.
|
Standard_Boolean | IsEqual (const Aspect_FontStyle &Other) const |
Standard_Boolean | operator== (const Aspect_FontStyle &Other) const |
Standard_Boolean | IsNotEqual (const Aspect_FontStyle &Other) const |
Standard_Boolean | operator!= (const Aspect_FontStyle &Other) const |
Protected Attributes |
Aspect_TypeOfFont | MyFontType |
TCollection_AsciiString | MyStyle |
TCollection_AsciiString | MyFontName |
Standard_Real | MyFontSize |
Standard_Real | MyFontSlant |
Standard_Boolean | MyCapsHeight |