JX Application Framework
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
JXFontManager Class Reference

#include <JXFontManager.h>

Inheritance diagram for JXFontManager:
[legend]

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 &regex, 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)
 
- Public Member Functions inherited from JFontManager
virtual ~JFontManager ()
 

Static Public Member Functions

static void Init ()
 
- Static Public Member Functions inherited from JFontManager
static void Init (const JUtf8Byte *defaultFontName, const JUtf8Byte *defaultMonospaceFontName)
 
static const JStringGetDefaultFontName ()
 
static const JStringGetDefaultMonospaceFontName ()
 
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
 
- Protected Member Functions inherited from JFontManager
 JFontManager ()
 

Friends

class JXGC
 

Additional Inherited Members

- Static Protected Member Functions inherited from JFontManager
static JFontID GetFontID (const JString &name, const JSize size, const JFontStyle &style)
 
static JFont GetFont (const JFontID id)
 
static const JStringGetFontName (const JFontID id)
 
static JSize GetStrikeThickness (const JSize fontSize)
 
static JSize GetUnderlineThickness (const JSize fontSize)
 

Member Enumeration Documentation

◆ FontType

Enumerator
kStdType 
kTrueType 

Constructor & Destructor Documentation

◆ JXFontManager()

JXFontManager::JXFontManager ( JXDisplay display)

◆ ~JXFontManager()

JXFontManager::~JXFontManager ( )
override

Member Function Documentation

◆ GetCharWidth()

JSize JXFontManager::GetCharWidth ( const JFontID  id,
const JUtf8Character c 
)
overrideprotectedvirtual

Implements JFontManager.

◆ GetFontNames()

void JXFontManager::GetFontNames ( JPtrArray< JString > *  fontNames)
overridevirtual

Implements JFontManager.

◆ GetFontSizes()

bool JXFontManager::GetFontSizes ( const JString name,
JSize minSize,
JSize maxSize,
JArray< JSize > *  sizeList 
)
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.

◆ GetLineHeight()

JSize JXFontManager::GetLineHeight ( const JFontID  id,
const JSize  size,
const JFontStyle style,
JCoordinate ascent,
JCoordinate descent 
)
overrideprotectedvirtual

Implements JFontManager.

◆ GetMonospaceFontNames()

void JXFontManager::GetMonospaceFontNames ( JPtrArray< JString > *  fontNames)
overridevirtual

Implements JFontManager.

◆ GetStringWidth()

JSize JXFontManager::GetStringWidth ( const JFontID  id,
const JString str 
)
overrideprotectedvirtual

Implements JFontManager.

◆ GetSubstituteFontName()

bool JXFontManager::GetSubstituteFontName ( const JFont f,
const JUtf8Character c,
JString name 
)
overrideprotectedvirtual

Implements JFontManager.

◆ GetXFont()

bool JXFontManager::GetXFont ( const JString xFontStr,
JFont **  font 
)

For X Windows only: pass in complete string from XListFonts().

Caller must jdelete the returned object.

◆ GetXFontInfo()

JXFontManager::XFont JXFontManager::GetXFontInfo ( const JFontID  id)
inline

◆ GetXFontNames()

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().

◆ HasGlyphForCharacter()

bool JXFontManager::HasGlyphForCharacter ( const JFontID  id,
const JUtf8Character c 
)
overrideprotectedvirtual

Implements JFontManager.

◆ Init()

void JXFontManager::Init ( )
static

◆ IsExact()

bool JXFontManager::IsExact ( const JFontID  id)
overrideprotectedvirtual

Implements JFontManager.

◆ Preload()

void JXFontManager::Preload ( const JFontID  id)
inline

Friends And Related Symbol Documentation

◆ JXGC

friend class JXGC
friend

The documentation for this class was generated from the following files: