Re: [Fonts] mkfontscale and family names which contain '-'

2003-02-06 Thread Juliusz Chroboczek
MF Maybe one should work around that problem in mkfontscale by replacing
MF the '-' characters with ' ', for example like that:

You're right, of course.  Thanks for the report.

I'll change your patch a wee bit: I'll copy the family name instead of
modifying it in place, and I'll do the replacement by hand -- strpbrk
is likely to break some obscure platform or other.

I'll send it in ASAP.

Juliusz



___
Fonts mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/fonts



[Fonts] mkfontscale and family names which contain '-'

2003-02-04 Thread Mike FABIAN
If a font has a family name containing '-', mkfontscale generates the
(Bfamily name exactly like that into fonts.scale.
(B
(BThis occurs for example with the GohaTibebZemen.{otf,ttf} fonts which
(Bgot included into XFree86 CVS recently:
(B
(Bmfabian@magellan:/usr/X11R6/lib/X11/fonts/truetype$ grep "^Goha.*" fonts.scale
(BGohaTibebZemen.otf -misc-Goha-Tibeb Zemen-medium-r-normal--0-0-0-0-p-0-iso10646-1
(BGohaTibebZemen.otf -misc-Goha-Tibeb 
(BZemen-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific
(BGohaTibebZemen.ttf -misc-Goha-Tibeb Zemen-medium-r-normal--0-0-0-0-p-0-iso10646-1
(Bmfabian@magellan:/usr/X11R6/lib/X11/fonts/truetype$ ftdump GohaTibebZemen.otf
(BThere is 1 face in this file.
(B
(B- Face number: 0 -
(B
(Bfont name entries
(B   family: Goha-Tibeb Zemen
(B   style:  Regular
(B   postscript: GohaTibebZemen
(B
(Bfont type entries
(B   FreeType driver: cff
(B   sfnt wrapped:yes
(B   type:scalable
(B   direction:   horizontal
(B   fixed width: no
(B   glyph names: yes
(B   EM size: 1000
(B   global BBox: (11,-189):(1223,802)
(B   ascent:  820
(B   descent: -180
(B   text height: 1150
(B
(Bcharmaps
(B   0: platform: 0, encoding: 3
(B   1: platform: 1, encoding: 0
(B   2: platform: 3, encoding: 1
(B   3: platform: 7, encoding: 3
(Bmfabian@magellan:/usr/X11R6/lib/X11/fonts/truetype$
(B
(BThe XLFD thus generated doesn't work of course. How should this be
(Bfixed? Should the fonts be fixed?
(B
(BBut maybe it is no reason for the font maker to remove a '-' only
(Bbecause it doesn't work in a XLFD.  Is a family name with a '-'
(Ballowed or not?
(B
(BMaybe one should work around that problem in mkfontscale by replacing
(Bthe '-' characters with ' ', for example like that:
(B
(BIndex: mkfontscale.c
(B===
(BRCS file: /cvs/xc/programs/mkfontscale/mkfontscale.c,v
(Bretrieving revision 1.3
(Bdiff -u -r1.3 mkfontscale.c
(B--- mkfontscale.c   2003/01/26 02:20:41 1.3
(B+++ mkfontscale.c   2003/02/04 18:50:28
(B@@ -317,7 +317,8 @@
(B *spacing, *full_name;
(B ListPtr encoding, entries = NULL;
(B int i, found, rc;
(B-
(B+char *p;
(B+
(B i = strlen(dirname_given);
(B if(i == 0)
(B dirname = strcat_reliable(".", "/");
(B@@ -477,7 +478,14 @@
(B fprintf(stderr, "Couldn't get family name for %s\n", filename);
(B family = entry-d_name;
(B }
(B-
(B+   
(B+   while((p = strpbrk(family, "-"))) {
(B+   *p = ' ';
(B+   }
(B+   while((p = strpbrk(foundry, "-"))) {
(B+   *p = ' ';
(B+   }
(B+   
(B if(!weight) weight = "medium";
(B if(!slant) slant = "r";
(B if(!sWidth) sWidth = "normal";
(B
(B-- 
(BMike Fabian   [EMAIL PROTECTED]   http://www.suse.de/~mfabian
$B?gL2ITB-$O;E;v$NE($@!#(B
(B___
(BFonts mailing list
([EMAIL PROTECTED]
(Bhttp://XFree86.Org/mailman/listinfo/fonts