![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
#include <FXFont.h>
Public Types | |
enum | { Fixed = 1, Variable = 2 } |
enum | { Decorative = 4, Modern = 8, Roman = 16, Script = 32, Swiss = 64, System = 128, X11 = 256, Scalable = 512, Polymorphic = 1024, Rotatable = 2048 } |
enum | { ReverseOblique = 1, ReverseItalic = 2, Straight = 5, Italic = 8, Oblique = 9 } |
enum | { Thin = 10, ExtraLight = 20, Light = 30, Normal = 40, Medium = 50, DemiBold = 60, Bold = 70, ExtraBold = 80, Black = 90 } |
enum | { UltraCondensed = 50, ExtraCondensed = 63, Condensed = 75, SemiCondensed = 87, NonExpanded = 100, SemiExpanded = 113, Expanded = 125, ExtraExpanded = 150, UltraExpanded = 200 } |
Public Member Functions | |
FXFont (FXApp *a, const FXString &string) | |
FXFont (FXApp *a, const FXString &face, FXuint size, FXuint weight=FXFont::Normal, FXuint slant=FXFont::Straight, FXuint encoding=FONTENCODING_DEFAULT, FXuint setwidth=FXFont::NonExpanded, FXuint h=0) | |
FXFont (FXApp *a, const FXFontDesc &fontdesc) | |
virtual void | create () |
virtual void | detach () |
virtual void | destroy () |
FXString | getFamily () const |
FXString | getFoundry () const |
const FXString & | getName () const |
const FXString & | getActualName () const |
FXuint | getSize () const |
FXuint | getActualSize () const |
FXuint | getWeight () const |
FXuint | getActualWeight () const |
FXuint | getSlant () const |
FXuint | getActualSlant () const |
FXuint | getEncoding () const |
FXuint | getActualEncoding () const |
FXuint | getSetWidth () const |
FXuint | getActualSetWidth () const |
FXuint | getHints () const |
FXuint | getFlags () const |
void | getFontDesc (FXFontDesc &fontdesc) const |
virtual void | setFontDesc (const FXFontDesc &fontdesc) |
FXint | getAngle () const |
virtual void | setAngle (FXint ang) |
FXString | getFont () const |
virtual void | setFont (const FXString &string) |
virtual FXbool | isFontMono () const |
virtual FXbool | hasChar (FXwchar ch) const |
virtual FXwchar | getMinChar () const |
virtual FXwchar | getMaxChar () const |
virtual FXint | leftBearing (FXwchar ch) const |
virtual FXint | rightBearing (FXwchar ch) const |
virtual FXint | getFontWidth () const |
virtual FXint | getFontHeight () const |
virtual FXint | getFontAscent () const |
virtual FXint | getFontDescent () const |
virtual FXint | getFontLeading () const |
virtual FXint | getFontSpacing () const |
virtual FXint | getCharWidth (const FXwchar ch) const |
virtual FXint | getTextWidth (const FXString &string) const |
virtual FXint | getTextWidth (const FXchar *string, FXuint length) const |
virtual FXint | getTextHeight (const FXString &string) const |
virtual FXint | getTextHeight (const FXchar *string, FXuint length) const |
virtual void | save (FXStream &store) const |
virtual void | load (FXStream &store) |
virtual | ~FXFont () |
![]() | |
FXApp * | getApp () const |
FXID | id () const |
void | setUserData (void *ptr) |
void * | getUserData () const |
virtual | ~FXId () |
![]() | |
virtual long | onDefault (FXObject *, FXSelector, void *) |
const FXchar * | getClassName () const |
bool | isMemberOf (const FXMetaClass *metaclass) const |
virtual long | tryHandle (FXObject *sender, FXSelector sel, void *ptr) |
virtual | ~FXObject () |
Static Public Member Functions | |
static FXbool | listFonts (FXFontDesc *&fonts, FXuint &numfonts, const FXString &face, FXuint wt=0, FXuint sl=0, FXuint sw=0, FXuint en=0, FXuint h=0) |
Friends | |
class | FXDCWindow |
anonymous enum |
anonymous enum |
Font style hints.
anonymous enum |
anonymous enum |
anonymous enum |
Condensed or expanded options.
Construct a font with given font description of the form:
fontname [ "[" foundry "]" ] ["," size ["," weight ["," slant ["," setwidth ["," encoding ["," hints]]]]]]
For example:
"helvetica [bitstream],120,bold,italic,normal,iso8859-1,0"
Typically, at least the font name, and size must be given for normal font matching. As a special case, raw X11 fonts can also be passed, for example:
"9x15bold"
Note: use of the raw X11 fonts is stronly discouraged.
FX::FXFont::FXFont | ( | FXApp * | a, |
const FXString & | face, | ||
FXuint | size, | ||
FXuint | weight = FXFont::Normal , |
||
FXuint | slant = FXFont::Straight , |
||
FXuint | encoding = FONTENCODING_DEFAULT , |
||
FXuint | setwidth = FXFont::NonExpanded , |
||
FXuint | h = 0 |
||
) |
Construct a font with given name, size in points, weight, slant, character set encoding, setwidth, and hints.
The font name may be comprised of a family name and optional foundry name enclosed in square brackets, for example, "helvetica [bitstream]".
FX::FXFont::FXFont | ( | FXApp * | a, |
const FXFontDesc & | fontdesc | ||
) |
Construct font from font description.
|
virtual |
Destroy font.
|
virtual |
Create the font.
Reimplemented from FX::FXId.
|
virtual |
Detach the font.
Reimplemented from FX::FXId.
|
virtual |
Destroy the font.
Reimplemented from FX::FXId.
FXString FX::FXFont::getFamily | ( | ) | const |
Return family part of name.
FXString FX::FXFont::getFoundry | ( | ) | const |
Return foundry part of name.
|
inline |
Get font family name.
|
inline |
Get actual family name.
|
inline |
Get size in deci-points.
|
inline |
Get actual size in deci-points.
|
inline |
Get font weight.
|
inline |
Get actual font weight.
|
inline |
Get slant.
|
inline |
Get actual slant.
|
inline |
Get character set encoding.
|
inline |
Get actual encoding.
|
inline |
Get setwidth.
|
inline |
Get actual setwidth.
|
inline |
Get hints.
|
inline |
Get flags.
void FX::FXFont::getFontDesc | ( | FXFontDesc & | fontdesc | ) | const |
Get font description.
|
virtual |
Change font description.
|
inline |
Return angle.
|
virtual |
Set to new angle, in degrees*64 relative to positive x axis.
FXString FX::FXFont::getFont | ( | ) | const |
Return the font description as a string suitable for parsing with setFont(), see above.
|
virtual |
Change the font to the specified font description string.
|
virtual |
Find out if the font is monotype or proportional.
|
virtual |
Get first character glyph in font.
|
virtual |
Get last character glyph in font.
|
virtual |
Width of widest character in font.
|
virtual |
Height of highest character in font.
|
virtual |
Ascent from baseline.
|
virtual |
Descent from baseline.
|
virtual |
Get font leading [that is lead-ing as in Pb!].
|
virtual |
Get font line spacing.
Calculate width of single wide character in this font.
Calculate width of given text in this font.
Calculate width of given text in this font.
Calculate height of given text in this font.
Calculate height of given text in this font.
|
static |
List all fonts matching hints.
If listFonts() returns TRUE then fonts points to a newly-allocated array of length numfonts. It is the caller's responsibility to free this array using FXFREE().
|
virtual |
Save font data into stream.
Reimplemented from FX::FXId.
|
virtual |
Load font data from stream.
Reimplemented from FX::FXId.
|
friend |
![]() |