|
JX Application Framework
|
#include <JFontManager.h>
Classes | |
| struct | Font |
Public Member Functions | |
| virtual | ~JFontManager () |
| virtual void | GetFontNames (JPtrArray< JString > *fontNames)=0 |
| virtual void | GetMonospaceFontNames (JPtrArray< JString > *fontNames)=0 |
| virtual bool | GetFontSizes (const JString &name, JSize *minSize, JSize *maxSize, JArray< JSize > *sizeList)=0 |
Static Public Member Functions | |
| static void | Init (const JUtf8Byte *defaultFontName, const JUtf8Byte *defaultMonospaceFontName) |
| static const JString & | GetDefaultFontName () |
| static const JString & | GetDefaultMonospaceFontName () |
| static JSize | GetDefaultFontSize () |
| static JSize | GetDefaultRowColHeaderFontSize () |
| static JSize | GetDefaultMonospaceFontSize () |
| static JFont | GetDefaultFont () |
| static JFont | GetDefaultMonospaceFont () |
| static JFont | GetFont (const JString &name, const JSize size=0, const JFontStyle &style=JFontStyle()) |
Protected Member Functions | |
| JFontManager () | |
| virtual JSize | GetLineHeight (const JFontID id, const JSize size, const JFontStyle &style, JCoordinate *ascent, JCoordinate *descent)=0 |
| virtual JSize | GetCharWidth (const JFontID id, const JUtf8Character &c)=0 |
| virtual JSize | GetStringWidth (const JFontID id, const JString &str)=0 |
| virtual bool | IsExact (const JFontID id)=0 |
| virtual bool | HasGlyphForCharacter (const JFontID id, const JUtf8Character &c)=0 |
| virtual bool | GetSubstituteFontName (const JFont &f, const JUtf8Character &c, JString *name)=0 |
Static Protected Member Functions | |
| static JFontID | GetFontID (const JString &name, const JSize size, const JFontStyle &style) |
| static JFont | GetFont (const JFontID id) |
| static const JString & | GetFontName (const JFontID id) |
| static JSize | GetStrikeThickness (const JSize fontSize) |
| static JSize | GetUnderlineThickness (const JSize fontSize) |
Friends | |
| class | JFont |
Interface for the JFontManager class.
JFontManager::Init() must be called after initializing jGlobals.
Abstract base class for accessing fonts.
Derived classes must implement the following functions:
GetFontNames
Return an alphabetical list of all the available font names.
GetMonospaceFontNames
Return an alphabetical list of all the available monospace font names.
GetFontSizes
Return min avail size, max avail size, and a sorted list of all the
available font sizes for the given font name. If all font sizes are
supported (e.g. TrueType), return a reasonable min and max, and an
empty list of sizes. Return false if there is no such font.
GetLineHeight
Return the height of a line of text.
GetCharWidth
Return the width of the given character.
GetStringWidth
Return the width of the given string.
IsExact
Return true if the font matches the requested attributes.
Implementation details:
JFontID is an index into the global list of allocated fonts. This way,
we don't care how the system wants to reference a font, and 0 is
guaranteed never to be used.
JFontID's are allocated as needed. Specific implementations should keep
a parallel list with system-dependent data and fill this list lazily.
Note that this definition means that the font ID is *not* independent
of the size and style.
Nothing is const because any function might change the derived class'
internal data.
|
virtual |
|
protected |
|
protectedpure virtual |
Implemented in JXFontManager.
|
static |
|
inlinestatic |
|
inlinestatic |
|
static |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
|
staticprotected |
Implemented in JXFontManager.
|
pure virtual |
Implemented in JXFontManager.
|
protectedpure virtual |
Implemented in JXFontManager.
Implemented in JXFontManager.
|
protectedpure virtual |
Implemented in JXFontManager.
|
protectedpure virtual |
Implemented in JXFontManager.
|
protectedpure virtual |
Implemented in JXFontManager.
|
static |
Implemented in JXFontManager.
|
friend |