![]() |
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 |
virtual void | setFontDesc (const FXFontDesc &fontdesc) |
FXFontDesc | getFontDesc () const |
FXFontDesc | getActualFontDesc () const |
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 () |
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 |
See also:
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 FX::FXFont::~FXFont | ( | ) | [virtual] |
Destroy font.
virtual void FX::FXFont::create | ( | ) | [virtual] |
virtual void FX::FXFont::detach | ( | ) | [virtual] |
virtual void FX::FXFont::destroy | ( | ) | [virtual] |
FXString FX::FXFont::getFamily | ( | ) | const |
Return family part of name.
FXString FX::FXFont::getFoundry | ( | ) | const |
Return foundry part of name.
const FXString& FX::FXFont::getName | ( | ) | const [inline] |
Get font family name.
const FXString& FX::FXFont::getActualName | ( | ) | const [inline] |
Get actual family name.
FXuint FX::FXFont::getSize | ( | ) | const [inline] |
Get size in deci-points.
FXuint FX::FXFont::getActualSize | ( | ) | const [inline] |
Get actual size in deci-points.
FXuint FX::FXFont::getWeight | ( | ) | const [inline] |
Get font weight.
FXuint FX::FXFont::getActualWeight | ( | ) | const [inline] |
Get actual font weight.
FXuint FX::FXFont::getSlant | ( | ) | const [inline] |
Get slant.
FXuint FX::FXFont::getActualSlant | ( | ) | const [inline] |
Get actual slant.
FXuint FX::FXFont::getEncoding | ( | ) | const [inline] |
Get character set encoding.
FXuint FX::FXFont::getActualEncoding | ( | ) | const [inline] |
Get actual encoding.
FXuint FX::FXFont::getSetWidth | ( | ) | const [inline] |
Get setwidth.
FXuint FX::FXFont::getActualSetWidth | ( | ) | const [inline] |
Get actual setwidth.
FXuint FX::FXFont::getHints | ( | ) | const [inline] |
Get hints.
FXuint FX::FXFont::getFlags | ( | ) | const [inline] |
Get flags.
virtual void FX::FXFont::setFontDesc | ( | const FXFontDesc & | fontdesc | ) | [virtual] |
Change font description.
FXFontDesc FX::FXFont::getFontDesc | ( | ) | const |
Get font description.
FXFontDesc FX::FXFont::getActualFontDesc | ( | ) | const |
Get actual font description.
FXint FX::FXFont::getAngle | ( | ) | const [inline] |
Return angle.
virtual void FX::FXFont::setAngle | ( | FXint | ang | ) | [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 void FX::FXFont::setFont | ( | const FXString & | string | ) | [virtual] |
Change the font to the specified font description string.
virtual FXbool FX::FXFont::isFontMono | ( | ) | const [virtual] |
Find out if the font is monotype or proportional.
virtual FXwchar FX::FXFont::getMinChar | ( | ) | const [virtual] |
Get first character glyph in font.
virtual FXwchar FX::FXFont::getMaxChar | ( | ) | const [virtual] |
Get last character glyph in font.
virtual FXint FX::FXFont::getFontWidth | ( | ) | const [virtual] |
Width of widest character in font.
virtual FXint FX::FXFont::getFontHeight | ( | ) | const [virtual] |
Height of highest character in font.
virtual FXint FX::FXFont::getFontAscent | ( | ) | const [virtual] |
Ascent from baseline.
virtual FXint FX::FXFont::getFontDescent | ( | ) | const [virtual] |
Descent from baseline.
virtual FXint FX::FXFont::getFontLeading | ( | ) | const [virtual] |
Get font leading [that is lead-ing as in Pb!].
virtual FXint FX::FXFont::getFontSpacing | ( | ) | const [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 FXbool FX::FXFont::listFonts | ( | FXFontDesc *& | fonts, | |
FXuint & | numfonts, | |||
const FXString & | face, | |||
FXuint | wt = 0 , |
|||
FXuint | sl = 0 , |
|||
FXuint | sw = 0 , |
|||
FXuint | en = 0 , |
|||
FXuint | h = 0 | |||
) | [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 void FX::FXFont::save | ( | FXStream & | store | ) | const [virtual] |
virtual void FX::FXFont::load | ( | FXStream & | store | ) | [virtual] |
friend class FXDCWindow [friend] |
![]() |