JX Application Framework
|
#include <JXFontManager.h>
Classes | |
struct | XFont |
Public Types | |
enum | FontType { kStdType , kTrueType } |
Public Member Functions | |
JXFontManager (JXDisplay *display) | |
~JXFontManager () override | |
void | GetFontNames (JPtrArray< JString > *fontNames) override |
void | GetMonospaceFontNames (JPtrArray< JString > *fontNames) override |
bool | GetFontSizes (const JString &name, JSize *minSize, JSize *maxSize, JArray< JSize > *sizeList) override |
void | GetXFontNames (const JRegex ®ex, JPtrArray< JString > *fontNames, const std::function< std::weak_ordering(JString *const &, JString *const &)> *compare=nullptr) |
bool | GetXFont (const JString &xFontStr, JFont **font) |
XFont | GetXFontInfo (const JFontID id) |
void | Preload (const JFontID id) |
![]() | |
virtual | ~JFontManager () |
Static Public Member Functions | |
static void | Init () |
![]() | |
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 | |
JSize | GetLineHeight (const JFontID id, const JSize size, const JFontStyle &style, JCoordinate *ascent, JCoordinate *descent) override |
JSize | GetCharWidth (const JFontID id, const JUtf8Character &c) override |
JSize | GetStringWidth (const JFontID id, const JString &str) override |
bool | IsExact (const JFontID id) override |
bool | HasGlyphForCharacter (const JFontID id, const JUtf8Character &c) override |
bool | GetSubstituteFontName (const JFont &f, const JUtf8Character &c, JString *name) override |
![]() | |
JFontManager () | |
Friends | |
class | JXGC |
Additional Inherited Members | |
![]() | |
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) |
JXFontManager::JXFontManager | ( | JXDisplay * | display | ) |
|
override |
|
overrideprotectedvirtual |
Implements JFontManager.
Implements JFontManager.
|
overridevirtual |
If all font sizes are supported (e.g. TrueType), returns reasonable min and max, and empty sizeList.
Returns false if there is no font with the specified name.
Implements JFontManager.
|
overrideprotectedvirtual |
Implements JFontManager.
Implements JFontManager.
|
overrideprotectedvirtual |
Implements JFontManager.
|
overrideprotectedvirtual |
Implements JFontManager.
For X Windows only: pass in complete string from XListFonts().
Caller must jdelete the returned object.
|
inline |
void JXFontManager::GetXFontNames | ( | const JRegex & | regex, |
JPtrArray< JString > * | fontNames, | ||
const std::function< std::weak_ordering(JString *const &, JString *const &)> * | compare = nullptr |
||
) |
This provides raw output from XListFonts(). For example, ^[0-9]x[0-9]+$ would yield a list of clean, monospace fonts.
If compare is nullptr, we use JCompareStringsCaseInsensitive().
|
overrideprotectedvirtual |
Implements JFontManager.
|
static |
Implements JFontManager.
|
inline |
|
friend |