1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Added some comments regarding font height

This commit is contained in:
Klaus Schmidinger 2017-11-11 14:05:53 +01:00
parent d19a3fc3b8
commit 54b721ebde
3 changed files with 11 additions and 5 deletions

View File

@ -3374,6 +3374,7 @@ Thomas Reufer <thomas@reufer.ch>
font drawing in high level OSDs font drawing in high level OSDs
for fixing regenerating the index of audio recordings for fixing regenerating the index of audio recordings
for implementing the SVDRP commands 'LSTD' and 'PRIM' for implementing the SVDRP commands 'LSTD' and 'PRIM'
for adding some comments regarding font height
Eike Sauer <EikeSauer@t-online.de> Eike Sauer <EikeSauer@t-online.de>
for reporting a problem with channels that need more than 5 TS packets for detecting for reporting a problem with channels that need more than 5 TS packets for detecting

View File

@ -9198,3 +9198,4 @@ Video Disk Recorder Revision History
removed), but rather by the main program loop reacting to changes in Setup.PrimaryDVB. removed), but rather by the main program loop reacting to changes in Setup.PrimaryDVB.
- The new SVDRP commands 'LSTD' and 'PRIM' can be used to list all available devices - The new SVDRP commands 'LSTD' and 'PRIM' can be used to list all available devices
and to switch the primary device (thanks to Thomas Reufer). and to switch the primary device (thanks to Thomas Reufer).
- Added some comments regarding font height (thanks to Thomas Reufer).

14
font.h
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: font.h 4.2 2016/12/22 12:43:24 kls Exp $ * $Id: font.h 4.3 2017/11/11 14:05:07 kls Exp $
*/ */
#ifndef __FONT_H #ifndef __FONT_H
@ -54,6 +54,8 @@ public:
///< Returns the width of the given string in pixel. ///< Returns the width of the given string in pixel.
virtual int Height(void) const = 0; virtual int Height(void) const = 0;
///< Returns the height of this font in pixel (all characters have the same height). ///< 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.
int Height(const char *s) const { return Height(); } int Height(const char *s) const { return Height(); }
///< Returns the height of this font in pixel (obsolete, just for backwards compatibility). ///< Returns the height of this font in pixel (obsolete, just for backwards compatibility).
virtual void DrawText(cBitmap *Bitmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const = 0; virtual void DrawText(cBitmap *Bitmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const = 0;
@ -75,10 +77,12 @@ public:
///< function that called GetFont() has returned. ///< function that called GetFont() has returned.
static cFont *CreateFont(const char *Name, int CharHeight, int CharWidth = 0); static cFont *CreateFont(const char *Name, int CharHeight, int CharWidth = 0);
///< Creates a new font object with the given Name and makes its characters ///< 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 ///< CharHeight pixels high. The actual height of the required drawing area
///< default width. Name is of the form "Family:Style", for instance ///< might be higher than CharHeight if the font contains descenders.
///< "Verdana:Bold Italic" or "Times New Roman". See GetAvailableFontNames() ///< If CharWidth is given, it overwrites the font's default width.
///< for how to get a list of all available font names. ///< 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. ///< 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. ///< The caller must delete the font when it is no longer needed.
static bool GetAvailableFontNames(cStringList *FontNames, bool Monospaced = false); static bool GetAvailableFontNames(cStringList *FontNames, bool Monospaced = false);