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

Fixed stripping i18n stuff from font names

This commit is contained in:
Klaus Schmidinger 2007-06-23 11:28:18 +02:00
parent e5def7917b
commit 24232a0010
2 changed files with 14 additions and 3 deletions

View File

@ -5270,3 +5270,4 @@ Video Disk Recorder Revision History
- Fonts can now be created with a width that overwrites the default width (thanks - Fonts can now be created with a width that overwrites the default width (thanks
to Andreas Mair). to Andreas Mair).
- Added full weekday names to i18n.c for plugins to use (thanks to Patrice Staudt). - Added full weekday names to i18n.c for plugins to use (thanks to Patrice Staudt).
- Fixed stripping i18n stuff from font names (reported by Anssi Hannula).

14
font.c
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.c 1.20 2007/06/23 10:41:10 kls Exp $ * $Id: font.c 1.21 2007/06/23 11:25:42 kls Exp $
*/ */
#include "font.h" #include "font.h"
@ -354,9 +354,19 @@ bool cFont::GetAvailableFontNames(cStringList *FontNames, bool Monospaced)
char *s = (char *)FcNameUnparse(fontset->fonts[i]); char *s = (char *)FcNameUnparse(fontset->fonts[i]);
if (s) { if (s) {
// Strip i18n stuff: // Strip i18n stuff:
char *p = strchr(s, ','); char *c = strchr(s, ':');
if (c) {
char *p = strchr(c + 1, ',');
if (p) if (p)
*p = 0; *p = 0;
}
char *p = strchr(s, ',');
if (p) {
if (c)
memmove(p, c, strlen(c) + 1);
else
*p = 0;
}
// Make it user presentable: // Make it user presentable:
s = strreplace(s, "\\", ""); // '-' is escaped s = strreplace(s, "\\", ""); // '-' is escaped
s = strreplace(s, "style=", ""); s = strreplace(s, "style=", "");