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

#include <JFontManager.h>

Inheritance diagram for JFontManager:
[legend]

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 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

 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 JStringGetFontName (const JFontID id)
 
static JSize GetStrikeThickness (const JSize fontSize)
 
static JSize GetUnderlineThickness (const JSize fontSize)
 

Friends

class JFont
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~JFontManager()

JFontManager::~JFontManager ( )
virtual

◆ JFontManager()

JFontManager::JFontManager ( )
protected

Member Function Documentation

◆ GetCharWidth()

virtual JSize JFontManager::GetCharWidth ( const JFontID  id,
const JUtf8Character c 
)
protectedpure virtual

Implemented in JXFontManager.

◆ GetDefaultFont()

JFont JFontManager::GetDefaultFont ( )
static

◆ GetDefaultFontName()

const JString & JFontManager::GetDefaultFontName ( )
inlinestatic

◆ GetDefaultFontSize()

JSize JFontManager::GetDefaultFontSize ( )
inlinestatic

◆ GetDefaultMonospaceFont()

JFont JFontManager::GetDefaultMonospaceFont ( )
static

◆ GetDefaultMonospaceFontName()

const JString & JFontManager::GetDefaultMonospaceFontName ( )
inlinestatic

◆ GetDefaultMonospaceFontSize()

JSize JFontManager::GetDefaultMonospaceFontSize ( )
inlinestatic

◆ GetDefaultRowColHeaderFontSize()

JSize JFontManager::GetDefaultRowColHeaderFontSize ( )
inlinestatic

◆ GetFont() [1/2]

JFont JFontManager::GetFont ( const JFontID  id)
staticprotected

◆ GetFont() [2/2]

JFont JFontManager::GetFont ( const JString name,
const JSize  size = 0,
const JFontStyle style = JFontStyle() 
)
static

◆ GetFontID()

JFontID JFontManager::GetFontID ( const JString name,
const JSize  size,
const JFontStyle style 
)
staticprotected

◆ GetFontName()

const JString & JFontManager::GetFontName ( const JFontID  id)
staticprotected

◆ GetFontNames()

virtual void JFontManager::GetFontNames ( JPtrArray< JString > *  fontNames)
pure virtual

Implemented in JXFontManager.

◆ GetFontSizes()

virtual bool JFontManager::GetFontSizes ( const JString name,
JSize minSize,
JSize maxSize,
JArray< JSize > *  sizeList 
)
pure virtual

Implemented in JXFontManager.

◆ GetLineHeight()

virtual JSize JFontManager::GetLineHeight ( const JFontID  id,
const JSize  size,
const JFontStyle style,
JCoordinate ascent,
JCoordinate descent 
)
protectedpure virtual

Implemented in JXFontManager.

◆ GetMonospaceFontNames()

virtual void JFontManager::GetMonospaceFontNames ( JPtrArray< JString > *  fontNames)
pure virtual

Implemented in JXFontManager.

◆ GetStrikeThickness()

JSize JFontManager::GetStrikeThickness ( const JSize  fontSize)
inlinestaticprotected

◆ GetStringWidth()

virtual JSize JFontManager::GetStringWidth ( const JFontID  id,
const JString str 
)
protectedpure virtual

Implemented in JXFontManager.

◆ GetSubstituteFontName()

virtual bool JFontManager::GetSubstituteFontName ( const JFont f,
const JUtf8Character c,
JString name 
)
protectedpure virtual

Implemented in JXFontManager.

◆ GetUnderlineThickness()

JSize JFontManager::GetUnderlineThickness ( const JSize  fontSize)
inlinestaticprotected

◆ HasGlyphForCharacter()

virtual bool JFontManager::HasGlyphForCharacter ( const JFontID  id,
const JUtf8Character c 
)
protectedpure virtual

Implemented in JXFontManager.

◆ Init()

void JFontManager::Init ( const JUtf8Byte defaultFontName,
const JUtf8Byte defaultMonospaceFontName 
)
static

◆ IsExact()

virtual bool JFontManager::IsExact ( const JFontID  id)
protectedpure virtual

Implemented in JXFontManager.

Friends And Related Symbol Documentation

◆ JFont

friend class JFont
friend

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