vdr 2.6.3
|
#include <font.h>
Public Member Functions | |
virtual | ~cFont () |
virtual const char * | FontName (void) const |
virtual int | Size (void) const |
virtual int | Width (void) const =0 |
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 Private Attributes | |
static cFont * | fonts [] = { NULL } |
|
static |
Creates a new font object with the given Name and makes its characters CharHeight pixels high.
The actual height of the required drawing area might be higher than CharHeight if the font contains descenders. 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, a dummy font is returned. The caller must delete the font when it is no longer needed.
Definition at line 429 of file font.c.
References GetFontFileName(), and Height().
Referenced by cTrueColorDemo::Action(), CreateTinyFont(), cSkinLCARSDisplayChannel::cSkinLCARSDisplayChannel(), cSkinLCARSDisplayMenu::cSkinLCARSDisplayMenu(), DrawEllipseAlignments(), cSubtitleObject::Render(), and SetFont().
|
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 cFreetypeFont, cDummyFont, and cCursesFont.
|
inlinevirtual |
Reimplemented in cFreetypeFont, cDummyFont, and cCursesFont.
|
inlinevirtual |
Returns the font name.
Reimplemented in cFreetypeFont.
Definition at line 42 of file font.h.
Referenced by cHdffOsd::DrawText(), and GetFontFileName().
|
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 440 of file font.c.
References cVector< T >::Append(), cVector< T >::Size(), cStringList::Sort(), and strreplace().
Referenced by cMenuSetupOSD::cMenuSetupOSD().
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 412 of file font.c.
References esyslog, Font, cSetup::FontFix, fontFix, cSetup::FontFixSize, cSetup::FontOsd, fontOsd, cSetup::FontOsdSize, fonts, cSetup::FontSml, cSetup::FontSmlSize, min(), SetFont(), Setup, and cSetup::UseSmallFont.
Referenced by cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(), cSkinClassicDisplayMessage::cSkinClassicDisplayMessage(), cSkinClassicDisplayReplay::cSkinClassicDisplayReplay(), cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinClassicDisplayVolume::cSkinClassicDisplayVolume(), cSkinLCARSDisplayChannel::cSkinLCARSDisplayChannel(), cSkinLCARSDisplayMenu::cSkinLCARSDisplayMenu(), cSkinLCARSDisplayMessage::cSkinLCARSDisplayMessage(), cSkinLCARSDisplayReplay::cSkinLCARSDisplayReplay(), cSkinLCARSDisplayTracks::cSkinLCARSDisplayTracks(), cSkinLCARSDisplayVolume::cSkinLCARSDisplayVolume(), cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(), cPictureControl::DisplayCaption(), cSkinLCARSDisplayChannel::DrawDate(), cSkinLCARSDisplayMenu::DrawDate(), cSkinLCARSDisplayReplay::DrawDate(), DrawDeviceData(), cSkinLCARSDisplayMenu::DrawDisk(), cSkinLCARSDisplayMenu::DrawFrameDisplay(), cSkinLCARSDisplayMenu::DrawInfo(), cSkinLCARSDisplayMenu::DrawLive(), cSkinLCARSDisplayMenu::DrawLoad(), cSkinLCARSDisplayMenu::DrawMainFrameLower(), cSkinLCARSDisplayMenu::DrawPlay(), cSkinLCARSDisplayMenu::DrawStatusElbows(), cSkinLCARSDisplayMenu::DrawTimers(), cSkinClassicDisplayMenu::DrawTitle(), cSkinSTTNGDisplayMenu::DrawTitle(), cSkinLCARSDisplayChannel::DrawTrack(), cSkinLCARSDisplayReplay::DrawTrack(), cSkinClassicDisplayChannel::Flush(), cSkinClassicDisplayMenu::Flush(), cSkinSTTNGDisplayChannel::Flush(), cSkinSTTNGDisplayMenu::Flush(), cSkinClassicDisplayMenu::GetTextAreaFont(), cSkinLCARSDisplayMenu::GetTextAreaFont(), cSkinSTTNGDisplayMenu::GetTextAreaFont(), cMenuEditStrItem::Set(), cSkinClassicDisplayMenu::SetButtons(), cSkinLCARSDisplayMenu::SetButtons(), cSkinSTTNGDisplayMenu::SetButtons(), cSkinClassicDisplayChannel::SetChannel(), cSkinLCARSDisplayChannel::SetChannel(), cSkinSTTNGDisplayChannel::SetChannel(), cSkinClassicDisplayReplay::SetCurrent(), cSkinLCARSDisplayReplay::SetCurrent(), cSkinSTTNGDisplayReplay::SetCurrent(), cSkinClassicDisplayMenu::SetEvent(), cSkinLCARSDisplayMenu::SetEvent(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinClassicDisplayChannel::SetEvents(), cSkinLCARSDisplayChannel::SetEvents(), cSkinSTTNGDisplayChannel::SetEvents(), cSkinClassicDisplayTracks::SetItem(), cSkinLCARSDisplayTracks::SetItem(), cSkinSTTNGDisplayTracks::SetItem(), cSkinClassicDisplayMenu::SetItem(), cSkinLCARSDisplayMenu::SetItem(), cSkinSTTNGDisplayMenu::SetItem(), cSkinClassicDisplayReplay::SetJump(), cSkinLCARSDisplayReplay::SetJump(), cSkinSTTNGDisplayReplay::SetJump(), cSkinClassicDisplayChannel::SetMessage(), cSkinClassicDisplayMenu::SetMessage(), cSkinClassicDisplayReplay::SetMessage(), cSkinClassicDisplayMessage::SetMessage(), cSkinLCARSDisplayChannel::SetMessage(), cSkinLCARSDisplayMenu::SetMessage(), cSkinLCARSDisplayReplay::SetMessage(), cSkinLCARSDisplayMessage::SetMessage(), cSkinSTTNGDisplayChannel::SetMessage(), cSkinSTTNGDisplayMenu::SetMessage(), cSkinSTTNGDisplayReplay::SetMessage(), cSkinSTTNGDisplayMessage::SetMessage(), cSkinClassicDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetRecording(), cSkinLCARSDisplayReplay::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), cSkinClassicDisplayReplay::SetTitle(), cSkinLCARSDisplayMenu::SetTitle(), cSkinLCARSDisplayReplay::SetTitle(), cSkinSTTNGDisplayReplay::SetTitle(), cSkinClassicDisplayReplay::SetTotal(), cSkinLCARSDisplayReplay::SetTotal(), cSkinSTTNGDisplayReplay::SetTotal(), and cSkinClassicDisplayVolume::SetVolume().
|
static |
Returns the actual font file name for the given FontName.
Definition at line 482 of file font.c.
References esyslog, FontName(), and strreplace().
Referenced by CreateFont(), and main().
|
inline |
|
pure virtual |
Returns the height of this font in pixel (all characters have the same height).
If the font contains descenders, its total height may be higher than the character height specified during creation.
Implemented in cFreetypeFont, cDummyFont, and cCursesFont.
Referenced by cTrueColorDemo::Action(), CreateFont(), cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(), cSkinClassicDisplayMessage::cSkinClassicDisplayMessage(), cSkinClassicDisplayReplay::cSkinClassicDisplayReplay(), cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinClassicDisplayVolume::cSkinClassicDisplayVolume(), cSkinLCARSDisplayChannel::cSkinLCARSDisplayChannel(), cSkinLCARSDisplayMenu::cSkinLCARSDisplayMenu(), cSkinLCARSDisplayMessage::cSkinLCARSDisplayMessage(), cSkinLCARSDisplayReplay::cSkinLCARSDisplayReplay(), cSkinLCARSDisplayTracks::cSkinLCARSDisplayTracks(), cSkinLCARSDisplayVolume::cSkinLCARSDisplayVolume(), cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(), DrawDeviceData(), cTextScroller::DrawText(), cSkinLCARSDisplayMenu::DrawTimer(), cSkinSTTNGDisplayChannel::Flush(), cSkinSTTNGDisplayMenu::Flush(), cSubtitleObject::Render(), cTextScroller::Set(), cSkinClassicDisplayMenu::SetEvent(), cSkinLCARSDisplayMenu::SetEvent(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinClassicDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), and Size().
|
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 406 of file font.c.
References constrain(), CreateFont(), Font, fonts, MAXFONTSIZE, and MINFONTSIZE.
Referenced by GetFont(), and cOsdProvider::UpdateOsdSize().
|
inlinevirtual |
Returns the original size as requested when the font was created.
This may be smaller than the actual height, for instance if the font contains descenders.
Reimplemented in cFreetypeFont.
Definition at line 44 of file font.h.
References Height().
Referenced by cHdffOsd::DrawText().
|
pure virtual |
Returns the width of the given string in pixel.
Implemented in cFreetypeFont, cDummyFont, and cCursesFont.
|
pure virtual |
Returns the width of the given character in pixel.
Implemented in cFreetypeFont, cDummyFont, and cCursesFont.
|
pure virtual |
Returns the original character width as requested when the font was created, or 0 if the default width is used.
Implemented in cFreetypeFont, cDummyFont, and cCursesFont.
Referenced by cTrueColorDemo::Action(), cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinLCARSDisplayTracks::cSkinLCARSDisplayTracks(), cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), DrawDeviceData(), cSkinLCARSDisplayMenu::DrawTimer(), cSkinSTTNGDisplayMenu::DrawTitle(), cSkinClassicDisplayChannel::Flush(), cSkinClassicDisplayMenu::Flush(), cSkinSTTNGDisplayChannel::Flush(), cSkinSTTNGDisplayMenu::Flush(), cSubtitleObject::Render(), cMenuEditStrItem::Set(), cSkinSTTNGDisplayMenu::SetButtons(), cSkinClassicDisplayReplay::SetCurrent(), cSkinLCARSDisplayReplay::SetCurrent(), cSkinSTTNGDisplayReplay::SetCurrent(), cSkinClassicDisplayMenu::SetEvent(), cSkinLCARSDisplayMenu::SetEvent(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinClassicDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetTitle(), cSkinClassicDisplayReplay::SetTotal(), cSkinLCARSDisplayReplay::SetTotal(), cSkinSTTNGDisplayReplay::SetTotal(), and cSkinClassicDisplayVolume::SetVolume().
|
staticprivate |