vdr
1.7.27
|
#include <font.h>
Public Member Functions | |
virtual | ~cFont () |
virtual const char * | FontName (void) const |
virtual int | Size (void) const |
virtual int | Width (uint c) const =0 |
virtual int | Width (const char *s) const =0 |
virtual int | Height (void) const =0 |
int | Height (const char *s) const |
virtual void | DrawText (cBitmap *Bitmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const =0 |
virtual void | DrawText (cPixmap *Pixmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const |
virtual | ~cFont () |
virtual const char * | FontName (void) const |
virtual int | Size (void) const |
virtual int | Width (uint c) const =0 |
virtual int | Width (const char *s) const =0 |
virtual int | Height (void) const =0 |
int | Height (const char *s) const |
virtual void | DrawText (cBitmap *Bitmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const =0 |
virtual void | DrawText (cPixmap *Pixmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const |
Static Public Member Functions | |
static void | SetFont (eDvbFont Font, const char *Name, int CharHeight) |
static const cFont * | GetFont (eDvbFont Font) |
static cFont * | CreateFont (const char *Name, int CharHeight, int CharWidth=0) |
static bool | GetAvailableFontNames (cStringList *FontNames, bool Monospaced=false) |
static cString | GetFontFileName (const char *FontName) |
static void | SetFont (eDvbFont Font, const char *Name, int CharHeight) |
static const cFont * | GetFont (eDvbFont Font) |
static cFont * | CreateFont (const char *Name, int CharHeight, int CharWidth=0) |
static bool | GetAvailableFontNames (cStringList *FontNames, bool Monospaced=false) |
static cString | GetFontFileName (const char *FontName) |
Static Private Attributes | |
static cFont * | fonts [] = { NULL } |
virtual cFont::~cFont | ( | ) | [inline, virtual] |
virtual cFont::~cFont | ( | ) | [inline, virtual] |
Definition at line 41 of file include/vdr/font.h.
cFont * cFont::CreateFont | ( | const char * | Name, |
int | CharHeight, | ||
int | CharWidth = 0 |
||
) | [static] |
Creates a new font object with the given Name and makes its characters CharHeight pixels high.
If CharWidth is given, it overwrites the font's default width. Name is of the form "Family:Style", for instance "Verdana:Bold Italic" or "Times New Roman". See GetAvailableFontNames() for how to get a list of all available font names. If the requested font can't be created, NULL is returned. The caller must delete the font when it is no longer needed.
Definition at line 423 of file font.c.
References GetFontFileName().
Referenced by cTrueColorDemo::Action(), SetFont(), and cSubtitleRegion::UpdateTextData().
static cFont* cFont::CreateFont | ( | const char * | Name, |
int | CharHeight, | ||
int | CharWidth = 0 |
||
) | [static] |
Creates a new font object with the given Name and makes its characters CharHeight pixels high.
If CharWidth is given, it overwrites the font's default width. Name is of the form "Family:Style", for instance "Verdana:Bold Italic" or "Times New Roman". See GetAvailableFontNames() for how to get a list of all available font names. If the requested font can't be created, NULL is returned. The caller must delete the font when it is no longer needed.
virtual void cFont::DrawText | ( | cBitmap * | Bitmap, |
int | x, | ||
int | y, | ||
const char * | s, | ||
tColor | ColorFg, | ||
tColor | ColorBg, | ||
int | Width | ||
) | const [pure virtual] |
Draws the given text into the Bitmap at position (x, y) with the given colors.
The text will not exceed the given Width (if > 0), and will end with a complete character.
Implemented in cDummyFont, cFreetypeFont, and cCursesFont.
Referenced by cBitmap::DrawText(), and cPixmapMemory::DrawText().
virtual void cFont::DrawText | ( | cBitmap * | Bitmap, |
int | x, | ||
int | y, | ||
const char * | s, | ||
tColor | ColorFg, | ||
tColor | ColorBg, | ||
int | Width | ||
) | const [pure virtual] |
Draws the given text into the Bitmap at position (x, y) with the given colors.
The text will not exceed the given Width (if > 0), and will end with a complete character.
Implemented in cDummyFont, cFreetypeFont, and cCursesFont.
virtual void cFont::DrawText | ( | cPixmap * | Pixmap, |
int | x, | ||
int | y, | ||
const char * | s, | ||
tColor | ColorFg, | ||
tColor | ColorBg, | ||
int | Width | ||
) | const [inline, virtual] |
Reimplemented in cDummyFont, cFreetypeFont, and cCursesFont.
virtual void cFont::DrawText | ( | cPixmap * | Pixmap, |
int | x, | ||
int | y, | ||
const char * | s, | ||
tColor | ColorFg, | ||
tColor | ColorBg, | ||
int | Width | ||
) | const [inline, virtual] |
Reimplemented in cDummyFont, cFreetypeFont, and cCursesFont.
Definition at line 58 of file include/vdr/font.h.
virtual const char* cFont::FontName | ( | void | ) | const [inline, virtual] |
Returns the font name.
Reimplemented in cFreetypeFont.
Definition at line 42 of file font.h.
Referenced by cHdffOsd::DrawText().
virtual const char* cFont::FontName | ( | void | ) | const [inline, virtual] |
Returns the font name.
Reimplemented in cFreetypeFont.
Definition at line 42 of file include/vdr/font.h.
bool cFont::GetAvailableFontNames | ( | cStringList * | FontNames, |
bool | Monospaced = false |
||
) | [static] |
Queries the font configuration for a list of available font names, which is returned in FontNames.
If Monospaced is true, only monospaced fonts will be returned. The resulting font names are in a format that can be used with GetFontFileName() to get the name of the actual font file. Returns true if any font names were found.
Definition at line 431 of file font.c.
References cVector< T >::Append(), cVector< T >::Size(), cStringList::Sort(), and strreplace().
Referenced by cMenuSetupOSD::cMenuSetupOSD().
static bool cFont::GetAvailableFontNames | ( | cStringList * | FontNames, |
bool | Monospaced = false |
||
) | [static] |
Queries the font configuration for a list of available font names, which is returned in FontNames.
If Monospaced is true, only monospaced fonts will be returned. The resulting font names are in a format that can be used with GetFontFileName() to get the name of the actual font file. Returns true if any font names were found.
static const cFont* cFont::GetFont | ( | eDvbFont | Font | ) | [static] |
Gets the given Font, which was previously set by a call to SetFont().
If no SetFont() call has been made, the font as defined in the setup is returned. GetFont() is not thread-safe, and shall only be called from the main thread! A font returned by GetFont() must only be used locally inside the function it was retrieved from, and no long term pointer to it shall be kept, because the cFont object may become invalid at any time after the function that called GetFont() has returned.
const cFont * cFont::GetFont | ( | eDvbFont | Font | ) | [static] |
Gets the given Font, which was previously set by a call to SetFont().
If no SetFont() call has been made, the font as defined in the setup is returned. GetFont() is not thread-safe, and shall only be called from the main thread! A font returned by GetFont() must only be used locally inside the function it was retrieved from, and no long term pointer to it shall be kept, because the cFont object may become invalid at any time after the function that called GetFont() has returned.
Definition at line 406 of file font.c.
References esyslog, Font, fontFix, cSetup::FontFix, cSetup::FontFixSize, fontOsd, cSetup::FontOsd, cSetup::FontOsdSize, fonts, cSetup::FontSml, cSetup::FontSmlSize, SetFont(), Setup, and cSetup::UseSmallFont.
Referenced by cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(), cSkinClassicDisplayMessage::cSkinClassicDisplayMessage(), cSkinClassicDisplayReplay::cSkinClassicDisplayReplay(), cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinClassicDisplayVolume::cSkinClassicDisplayVolume(), cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(), cPictureControl::DisplayCaption(), cSkinClassicDisplayChannel::Flush(), cSkinSTTNGDisplayChannel::Flush(), cSkinClassicDisplayMenu::Flush(), cSkinSTTNGDisplayMenu::Flush(), cSkinClassicDisplayMenu::GetTextAreaFont(), cSkinSTTNGDisplayMenu::GetTextAreaFont(), cMenuEditStrItem::Set(), cSkinClassicDisplayMenu::SetButtons(), cSkinSTTNGDisplayMenu::SetButtons(), cSkinClassicDisplayChannel::SetChannel(), cSkinSTTNGDisplayChannel::SetChannel(), cSkinClassicDisplayReplay::SetCurrent(), cSkinSTTNGDisplayReplay::SetCurrent(), cSkinClassicDisplayMenu::SetEvent(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinClassicDisplayChannel::SetEvents(), cSkinSTTNGDisplayChannel::SetEvents(), cSkinClassicDisplayMenu::SetItem(), cSkinSTTNGDisplayMenu::SetItem(), cSkinClassicDisplayTracks::SetItem(), cSkinSTTNGDisplayTracks::SetItem(), cSkinClassicDisplayReplay::SetJump(), cSkinSTTNGDisplayReplay::SetJump(), cSkinClassicDisplayChannel::SetMessage(), cSkinSTTNGDisplayChannel::SetMessage(), cSkinClassicDisplayMenu::SetMessage(), cSkinSTTNGDisplayMenu::SetMessage(), cSkinClassicDisplayReplay::SetMessage(), cSkinClassicDisplayMessage::SetMessage(), cSkinSTTNGDisplayReplay::SetMessage(), cSkinSTTNGDisplayMessage::SetMessage(), cSkinClassicDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), cSkinClassicDisplayMenu::SetTitle(), cSkinSTTNGDisplayMenu::SetTitle(), cSkinClassicDisplayReplay::SetTitle(), cSkinSTTNGDisplayReplay::SetTitle(), cSkinClassicDisplayReplay::SetTotal(), cSkinSTTNGDisplayReplay::SetTotal(), and cSkinClassicDisplayVolume::SetVolume().
static cString cFont::GetFontFileName | ( | const char * | FontName | ) | [static] |
Returns the actual font file name for the given FontName.
cString cFont::GetFontFileName | ( | const char * | FontName | ) | [static] |
Returns the actual font file name for the given FontName.
Definition at line 473 of file font.c.
References esyslog, and strreplace().
Referenced by CreateFont(), and main().
virtual int cFont::Height | ( | void | ) | const [pure virtual] |
Returns the height of this font in pixel (all characters have the same height).
Implemented in cDummyFont, cFreetypeFont, and cCursesFont.
Referenced by cTrueColorDemo::Action(), cTrueColorDemo::CreateTextPixmap(), cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(), cSkinClassicDisplayMessage::cSkinClassicDisplayMessage(), cSkinClassicDisplayReplay::cSkinClassicDisplayReplay(), cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinClassicDisplayVolume::cSkinClassicDisplayVolume(), cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(), cPictureControl::DisplayCaption(), cHdffOsd::DrawText(), cCursesOsd::DrawText(), cBitmap::DrawText(), cPixmapMemory::DrawText(), cTextScroller::DrawText(), cSkinSTTNGDisplayChannel::Flush(), cSkinSTTNGDisplayMenu::Flush(), cTextScroller::Set(), cSkinClassicDisplayMenu::SetEvent(), cSkinSTTNGDisplayMenu::SetEvent(), SetFont(), cSkinClassicDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), Size(), and cSubtitleRegion::UpdateTextData().
virtual int cFont::Height | ( | void | ) | const [pure virtual] |
Returns the height of this font in pixel (all characters have the same height).
Implemented in cDummyFont, cFreetypeFont, and cCursesFont.
int cFont::Height | ( | const char * | s | ) | const [inline] |
Returns the height of this font in pixel (obsolete, just for backwards compatibility).
Definition at line 53 of file include/vdr/font.h.
References Height().
Referenced by Height().
int cFont::Height | ( | const char * | s | ) | const [inline] |
static void cFont::SetFont | ( | eDvbFont | Font, |
const char * | Name, | ||
int | CharHeight | ||
) | [static] |
< Draws the given text into the Pixmap at position (x, y) with the given colors.
The text will not exceed the given Width (if > 0), and will end with a complete character. Sets the given Font to use the font data according to Name (see CreateFont()) and make its characters CharHeight pixels high.
void cFont::SetFont | ( | eDvbFont | Font, |
const char * | Name, | ||
int | CharHeight | ||
) | [static] |
< Draws the given text into the Pixmap at position (x, y) with the given colors.
The text will not exceed the given Width (if > 0), and will end with a complete character. Sets the given Font to use the font data according to Name (see CreateFont()) and make its characters CharHeight pixels high.
Definition at line 397 of file font.c.
References constrain(), CreateFont(), Font, fonts, Height(), MAXFONTSIZE, and MINFONTSIZE.
Referenced by GetFont(), and cOsdProvider::UpdateOsdSize().
virtual int cFont::Size | ( | void | ) | const [inline, virtual] |
Returns the original size as requested when the font was created.
This may be different than the actual height.
Reimplemented in cFreetypeFont.
Definition at line 44 of file include/vdr/font.h.
References Height().
virtual int cFont::Size | ( | void | ) | const [inline, virtual] |
Returns the original size as requested when the font was created.
This may be different than the actual height.
Reimplemented in cFreetypeFont.
Definition at line 44 of file font.h.
References Height().
Referenced by cHdffOsd::DrawText().
virtual int cFont::Width | ( | uint | c | ) | const [pure virtual] |
Returns the width of the given character in pixel.
Implemented in cDummyFont, cFreetypeFont, and cCursesFont.
Referenced by cTrueColorDemo::Action(), cTrueColorDemo::CreateTextPixmap(), cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cPictureControl::DisplayCaption(), cHdffOsd::DrawText(), cCursesOsd::DrawText(), cBitmap::DrawText(), cPixmapMemory::DrawText(), cSkinClassicDisplayChannel::Flush(), cSkinSTTNGDisplayChannel::Flush(), cSkinClassicDisplayMenu::Flush(), cSkinSTTNGDisplayMenu::Flush(), cTextWrapper::Set(), cMenuEditStrItem::Set(), cSkinSTTNGDisplayMenu::SetButtons(), cSkinClassicDisplayReplay::SetCurrent(), cSkinSTTNGDisplayReplay::SetCurrent(), cSkinSTTNGDisplayMenu::SetTitle(), cSkinClassicDisplayReplay::SetTotal(), cSkinSTTNGDisplayReplay::SetTotal(), cSkinClassicDisplayVolume::SetVolume(), and cSubtitleRegion::UpdateTextData().
virtual int cFont::Width | ( | uint | c | ) | const [pure virtual] |
Returns the width of the given character in pixel.
Implemented in cDummyFont, cFreetypeFont, and cCursesFont.
virtual int cFont::Width | ( | const char * | s | ) | const [pure virtual] |
Returns the width of the given string in pixel.
Implemented in cDummyFont, cFreetypeFont, and cCursesFont.
virtual int cFont::Width | ( | const char * | s | ) | const [pure virtual] |
Returns the width of the given string in pixel.
Implemented in cDummyFont, cFreetypeFont, and cCursesFont.
static cFont * cFont::fonts = { NULL } [static, private] |