[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-usability
Subject:    Re: Fonts problems
From:       "Craig Drummond" <Craig.Drummond () gmx ! net>
Date:       2004-04-01 13:16:14
Message-ID: 19294.1080825374 () www5 ! gmx ! net
[Download RAW message or body]

> Yes, there are general problems with the X font system and (so far)
> FontConfig has not fixed these.

Well I don't have any major problems with it...

> > "Arial Black" will be the "family name" - just as "Times New Roman" is a
> >  family name, and not "Times New". So nothings going wrong here.
> > 
> The AFM file should provide this information for Type1 fonts.  I presume
> that the same information is in the TrueType headers, but I don't have a
> utility to dump the headers and I'm not sure if the conversion utility
> does
> it correctly.  However, Arial Black is not a correct "family name" because
> "Black" is a weight -- an alias for extra bold.

Nope. If you use MSWord you'll notice that "Arial Black" *is* listed as a
seperate family. The .TTF file itself explicitly states that the familt is
"Arial Black". If the font wants to say that the weight id "Black", then it
should say so in the weight parameter.

And as the the Helvetica example on your other email - this should be
detected jsut fine. The font lists its family as Helvetica, and weight as Black -
so there should be no problem.

> 
> It is better to use Type1 examples, but I don't have a copy of Helvetica
> Black.  You are correct about "Times New Roman" the file: "_er_____.afm"
> lists:
> 
> 	FamilyName Times New Roman PS
> 	Weight Roman
> 
> However there is also the Times Roman issue which is correct in the AFM.
> The file: "ti______.afm": lists:
> 
> 	FamilyName Times
> 	Weight Roman

Well these would be two different fonts, no? "Times New Roman"m and "Times".

> > Yeah this is because I try to create a "family" name from the font's
> > fullname. i.e. the fonts full name would be something like "Helvetica
> > Narrow Italic" (for instance) - and "family" name of "Helvetica".
> 
> Then there is Helvetica Narrow.  The file: "hvn_____.afm" lists:
> 
> 	FullName Helvetica Narrow
> 	FamilyName Helvetica
> 	Weight Medium
> 
> This leaves: "Narrow" unaccounted for.  When you have something like this,
> it is either:
> 
> 	SETWIDTH_NAME

In the case of "Narrow" it should be a width - and this is what the
installer should (does?) do.
> 	ADD_STYLE_NAME

I never knew about this field! Thanks. I'm now in the processes of changing
the code to put the extra information in the "add style" field, and not
family name.

> I'm not sure how to handle this.  You would have to read a lot of AFM
> files 

Well FT2 has a "style_name" parameter - I'm going to use this, but remove
any Bold, Italic, etc.

> to get some idea.  Do you know the bug number for this?

I don;t think there is a bug report for this - I never considered it an
error til now, and I've almost finished the changes.


> I don't think that AFM files have a: "Width" field.  I don't know exactly 
> if FreeType or Xft[2] can do this (I will have to look it up), but IIUC
> the 
> X "mkfontscale" file is using FreeType to get the 'width':
> 
> xc/programs/mkfontscale/mkfontscale.c:
> 
> static char*
> t1Weight(char *weight)
> {
>      if(!weight)
>          return NULL;
>      else {
>          return weight;
>      }
> }

Its doing what I already do - and getting the width from the full name.

> 
> --------
> It appears to be using FT calls to get "weight" (and also "adstyle"):

Nope -  it only uses FT to get the weight of TT fonts, as kfontinst already
does. In the copy of mkfontscale.c that I have, adstyle is just set to ""

> 
>          if(!adstyle) adstyle = "";
> 
>   so don't reinvent the wheel if FreeType2 will do this.

Re-invent what wheel? I already use FT2. I'll admit that I had my own
pfa/pfb parsing code - but that was writen before FT handled Type1 fonts, and I'm
removing this code now.

> My hack makes it read the font files, but it shouldn't have to do this. 
> This information should be in the: "Fontmap" files.  All you need is the 
> font file name and you can use FontConfig to get a directory list.  Given 
> the font file name, you can come up with the PostScript font name with a 
> script!!

Well this assumes that Ghostscript has been set-up with the mapping of file
name -> postscipt name. GNOME's fontilus (AFAIK) does not configure GS when a
font is installed. And using the KDE one, aliases are set-up anyway - so
there is no need for the real PS name.

Anyway - this discussion is surely off-topic for kde-usability...

Craig.

-- 
+++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter Virenschutz +++
100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz

_______________________________________________
kde-usability mailing list
kde-usability@kde.org
https://mail.kde.org/mailman/listinfo/kde-usability
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic