File magicpoint-1.13a-tffonts.diff of Package mgp
--- draw.c 2003-05-14 09:45:35.000000000 +0200
+++ draw.c 2003-10-23 15:21:08.000000000 +0200
@@ -3945,9 +3945,6 @@
return;
}
- if (!registry)
- registry = "iso8859-1";
-
/* canonicalize seed */
hyphen = 0;
for (p = seed; *p; p++) {
--- grammar.y 2003-04-12 00:05:42.000000000 +0200
+++ grammar.y 2003-10-23 15:21:07.000000000 +0200
@@ -869,9 +869,9 @@
}
| KW_TFONT STRorID {
#ifdef FREETYPE
- $$ = gen_str2(CTL_TFONT, $2, "iso8859-1");
+ $$ = gen_str2(CTL_TFONT, $2, "");
#else
- $$ = gen_str2(CTL_NOOP, $2, "iso8859-1");
+ $$ = gen_str2(CTL_NOOP, $2, "");
yywarn("directive \"tfont\" not supported "
"in this configuration");
#endif
--- tfont.c 2002-01-12 02:56:25.000000000 +0100
+++ tfont.c 2003-10-23 15:21:08.000000000 +0200
@@ -171,10 +171,10 @@
if (charset16)
tfc = tfc_lookup(code, size, tf_mcurname, 0);
else {
- if (code >= 0xa0 && ((!registry || !registry[0]) && mgp_charset)){
- regid = get_regid(mgp_charset);
- } else
- regid = get_regid(registry);
+ if ((!registry || !registry[0]) && mgp_charset)
+ registry = mgp_charset;
+
+ regid = get_regid(registry);
tfc = tfc_lookup(code, size, tf_curname[regid], regid);
}
@@ -270,7 +270,13 @@
tf_mcurname = tfloadedfont[i];
else {
regid = get_regid(registry);
- tf_curname[regid] = tfloadedfont[i];
+
+ //if( registry && *registry )
+ tf_curname[regid] = tfloadedfont[i];
+ //else {
+ // for(i = 0; i < 0; i ++)
+ // tf_curname[i] = tfloadedfont[tfcuridx];
+ //}
}
#if 0
tfc_setsize(char_size);
@@ -379,7 +385,7 @@
if (charset16)
tf_mcurname = tfloadedfont[tfcuridx];
else {
- if (registry)
+ if (registry && *registry)
tf_curname[regid] = tfloadedfont[tfcuridx];
else {
/* this should be default font */
@@ -414,12 +420,14 @@
u_int i;
struct tfont *tfc, *htfc;
- if (!fontname)
+ if (!fontname || !fontname[0])
return NULL;
for (i = 0; i < tffontcnt; i ++) {
- if (!strcmp(fontname, tfloadedfont[i]))
- tfcuridx = i;
+ if (!strcmp(fontname, tfloadedfont[i])) {
+ tfcuridx = i;
+ break;
+ }
}
htfc = &tfcache[TFCACHE_HASH(code, size)];