[Redbutton-devel] SF.net SVN: redbutton: [288]
Brought to you by:
skilvington
|
From: <ski...@us...> - 2007-04-24 09:57:21
|
Revision: 288
http://svn.sourceforge.net/redbutton/?rev=288&view=rev
Author: skilvington
Date: 2007-04-24 02:57:13 -0700 (Tue, 24 Apr 2007)
Log Message:
-----------
patch from Steven Ellis at OpenMedia NZ to try the FreeSans font if Tiresias is not available
Modified Paths:
--------------
redbutton-browser/trunk/MHEGFont.c
www/index.html
Modified: redbutton-browser/trunk/MHEGFont.c
===================================================================
--- redbutton-browser/trunk/MHEGFont.c 2007-04-15 09:47:31 UTC (rev 287)
+++ redbutton-browser/trunk/MHEGFont.c 2007-04-24 09:57:13 UTC (rev 288)
@@ -107,35 +107,45 @@
* this cost $1000 to licence from Bit Stream
* alternatively, you can download Nebula DigiTV iTuner from http://www.nebula-electronics.com/
* install it on a Windows box and copy C:\Windows\Fonts\tt7268m_802.ttf to your Linux box
- * if you don't have Tiresias Screenfont, we use whatever Xft returns for 'sans' instead
+ * if you don't have Tiresias Screenfont, we try FreeSans instead
+ * if FreeSANS is not available either, we use whatever Xft returns for 'sans'
*/
static char *_default_font_name = NULL;
static char *_font_name_tiresias = "TiresiasScreenfont";
+static char *_font_name_freesans = "FreeSans";
static char *_font_name_sans = "sans";
void
MHEGFont_defaultName(MHEGFont *font)
{
Display *dpy = MHEGEngine_getDisplay()->dpy;
- char *xlfdname = "-*-TiresiasScreenfont-medium-r-normal-*";
- char **names;
+ char *xlfd_tiresias = "-*-TiresiasScreenfont-medium-r-normal-*";
+ char *xlfd_freesans = "-*-freesans-medium-r-normal-*";
+ char **names = NULL;
int count;
/* first time */
if(_default_font_name == NULL)
{
/* do we have Tiresias */
- if((names = XListFonts(dpy, xlfdname, 1, &count)) != NULL)
+ if((names = XListFonts(dpy, xlfd_tiresias, 1, &count)) != NULL)
{
_default_font_name = _font_name_tiresias;
- XFreeFontNames(names);
}
+ else if((names = XListFonts(dpy, xlfd_freesans, 1, &count)) != NULL)
+ {
+ _default_font_name = _font_name_freesans;
+ error("Font '%s' not available; using '%s' for 'rec://font/uk1'", _font_name_tiresias, _font_name_freesans);
+ }
else
{
_default_font_name = _font_name_sans;
error("Font '%s' not available; using '%s' for 'rec://font/uk1'", _font_name_tiresias, _font_name_sans);
}
+ /* clean up */
+ if(names != NULL)
+ XFreeFontNames(names);
}
font->name = _default_font_name;
Modified: www/index.html
===================================================================
--- www/index.html 2007-04-15 09:47:31 UTC (rev 287)
+++ www/index.html 2007-04-24 09:57:13 UTC (rev 288)
@@ -213,8 +213,8 @@
The Australian applications are MHP, not MHEG, so you should probably look at
<A href="http://www.openmhp.org/">www.openmhp.org</A> for something to display them.
<P>
-If the Tiresias Screenfont is not available, rb-browser uses whatever scalable font Xft returns for "sans" instead.
-Note that this font will have different metrics and so may not fit into the spaces in the MHEG apps designed for Tiresias.
+If the Tiresias Screenfont is not available, rb-browser first tries to use the FreeSans font instead. If this is also not available, rb-browser uses whatever scalable font Xft returns for "sans".
+Note that these fonts will have different metrics and so may not fit into the spaces in the MHEG apps designed for Tiresias.
<H2>Contact Details</H2>
I can be contacted here: s.kilvington at eris dot qinetiq com.
</BODY>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|