summaryrefslogtreecommitdiff
path: root/font.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2007-06-17 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2007-06-17 18:00:00 +0200
commitb1e4da3be6552f58f3890bf2ad48879823d2e130 (patch)
treecf42a1e6b296956b82a2820948c7b90dbcddf26e /font.h
parentb9b9ace9a8d2d1c0beda1dc0a2ebc6be9b47c305 (diff)
downloadvdr-patch-lnbsharing-b1e4da3be6552f58f3890bf2ad48879823d2e130.tar.gz
vdr-patch-lnbsharing-b1e4da3be6552f58f3890bf2ad48879823d2e130.tar.bz2
Version 1.5.4vdr-1.5.4
- Increased APIVERSION (forgot to do that in 1.5.2 and 1.5.3). - Fixed a crash in i18n character set conversion (thanks to Alexander Riedel, Jose Alberto Reguero and Christian Wieninger for patches that cured part of the problem). - Adjusted the 'skincurses' plugin to UTF-8 handling. - Using nl_langinfo(CODESET) to determine the local codeset to use (thanks to Thomas Günther). The codeset names in 'libsi/si.c' have been changed to the canonical spelling with '-' (thanks to Ludwig Nussel for pointing this out). - Modified handling invalid characters in VFAT mode. - Replaced strn0cpy() with Utf8Strn0Cpy() where necessary. - Now using 'fontconfig' to determine which fonts to use (thanks to Anssi Hannula for code and hints on how to do this). - If no fonts are installed, VDR now uses a dummy font that doesn't actually draw any text, and logs an error message. - The new function cFont::CreateFont() can be used by plugins to create and use fonts of their own, independent of VDR's standard fonts. - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - Changed the parameter "OSD font" to "Default font" in "Setup/OSD" (suggested by Rolf Ahrenberg). - Fixed handling detached processes in SystemExec() (thanks to Udo Richter). - The info.vdr file now also stores the name of the channel, and the new function cRecordingInfo::ChannelName() returns this information if available (based on a patch from Alexander Hans). - The new function cOsd::SetOsdPosition() can be used to dynamically change the position and size of the OSD (based on a request from Christoph Haubrich). Plugins that implement skins should no longer use Setup.OSDWidth etc. directly, but should rather use cOsd::OsdWidth() etc. instead. Currently a change to the OSD position will only apply to newly opened OSDs.
Diffstat (limited to 'font.h')
-rw-r--r--font.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/font.h b/font.h
index b2ab293..4a83c87 100644
--- a/font.h
+++ b/font.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: font.h 1.16 2007/06/10 12:58:54 kls Exp $
+ * $Id: font.h 1.19 2007/06/17 12:11:31 kls Exp $
*/
#ifndef __FONT_H
@@ -12,10 +12,10 @@
#include <stdint.h>
#include <stdlib.h>
+#include "tools.h"
#define MAXFONTNAME 64
#define MAXFONTSIZE 64
-#define FONTDIR "/usr/share/fonts/truetype"
enum eDvbFont {
fontOsd,
@@ -28,6 +28,10 @@ class cBitmap;
typedef uint32_t tColor; // see also osd.h
typedef uint8_t tIndex;
+extern const char *DefaultFontOsd;
+extern const char *DefaultFontSml;
+extern const char *DefaultFontFix;
+
class cFont {
private:
static cFont *fonts[];
@@ -45,14 +49,30 @@ public:
///< 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.
static void SetFont(eDvbFont Font, const char *Name, int CharHeight);
- ///< Sets the given Font to use the font data from the file Name and make its characters
- ///< CharHeight pixels high.
+ ///< Sets the given Font to use the font data according to Name (see CreateFont())
+ ///< and make its characters CharHeight pixels high.
static const cFont *GetFont(eDvbFont Font);
///< 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.
///< The caller must not use the returned font outside the scope in which
///< it was retrieved by the call to GetFont(), because a call to SetFont()
///< may delete an existing font.
+ static cFont *CreateFont(const char *Name, int CharHeight);
+ ///< Creates a new font object with the given Name and makes its characters
+ ///< CharHeight pixels high. 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.
+ static bool GetAvailableFontNames(cStringList *FontNames, bool Monospaced = false);
+ ///< 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 cString GetFontFileName(const char *FontName);
+ ///< Retruns the actual font file name for the given FontName.
};
class cTextWrapper {