You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Stefan Scholl <st...@no-spoon.de> on 2006/06/11 15:28:04 UTC

A way to automatically generate metrics AND config entries for *.ttf?

Is there a ready to use tool which can operate on a list of
truetype fonts (e. g. "%windir%\FONTS\*.TTF" on Windows) and
generates all the needed metrics *and* config entries?

The metrics aren't a real problem. But the font-triplets in the
config are tough, because I don't see a way to automatically get
the needed information (style, weight).

-- 
Web (en): http://www.no-spoon.de/ -*- Web (de): http://www.frell.de/


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: A way to automatically generate metrics AND config entries for *.ttf?

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
No news. The guy who does this (Vincent) is also involved with a Google
Summer of Code project (before-floats implementation) which gets
precedence over the font stuff. I may get to this myself later but
nothing is likely to happen before August if noone else jumps in.

TrueType does indeed contain some fields which indicate some properties
of a font. Type1 fonts are probably a little more difficult. I'm not
up-to-date as to how far Victor Mote and Vincent Hennebert are with all
the details on FOrayFont (the thing we're intending to adopt).

I guess if you want to jump in and help, nobody will stop you. :-)

On 29.06.2006 10:50:16 Stefan Scholl wrote:
> Andreas L Delmelle <a_...@pandora.be> wrote:
> > On Jun 12, 2006, at 00:07, Stefan Scholl wrote:
> >> I have to find a way to let a user install fonts. It would have
> >> been nice to just import all the known TTF from his system.
> > 
> > Yeah, it would rock! :)
> > As a heads-up: Efforts are ongoing in that direction, no timeline,  
> > but high on our wish-list as well.
> 
> Any news regarding that effort?
> 
> 
> There _have_ to be a way to identify the style and weight.
> 
> How does the OS know how to choose which font file? When it uses
> the supplied subfamilies it has to "guess".
> 
> I've found the following subfamilies: 
> 
> Bold
> Bold Italic
> Bold Oblique
> Demibold
> Demibold Italic
> Demibold Roman
> Extra Bold
> Heavy
> Italic
> Light
> Light Italic
> Medium
> Oblique
> Regular
> Roman
> Ultra Bold
> 
> 
> Is it really just guesswork?
> 
> (Substring)     
> Italic, Oblique = Style Italic
> Bold, Heavy     = Weight Bold
> 
> Other = normal


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: A way to automatically generate metrics AND config entries for *.ttf?

Posted by Stefan Scholl <st...@no-spoon.de>.
Andreas L Delmelle <a_...@pandora.be> wrote:
> On Jun 12, 2006, at 00:07, Stefan Scholl wrote:
>> I have to find a way to let a user install fonts. It would have
>> been nice to just import all the known TTF from his system.
> 
> Yeah, it would rock! :)
> As a heads-up: Efforts are ongoing in that direction, no timeline,  
> but high on our wish-list as well.

Any news regarding that effort?


There _have_ to be a way to identify the style and weight.

How does the OS know how to choose which font file? When it uses
the supplied subfamilies it has to "guess".

I've found the following subfamilies: 

Bold
Bold Italic
Bold Oblique
Demibold
Demibold Italic
Demibold Roman
Extra Bold
Heavy
Italic
Light
Light Italic
Medium
Oblique
Regular
Roman
Ultra Bold


Is it really just guesswork?

(Substring)     
Italic, Oblique = Style Italic
Bold, Heavy     = Weight Bold

Other = normal


-- 
Web (en): http://www.no-spoon.de/ -*- Web (de): http://www.frell.de/


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: A way to automatically generate metrics AND config entries for *.ttf?

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Jun 12, 2006, at 00:07, Stefan Scholl wrote:

> Manuel Mall <ma...@apache.org> wrote:
>> cygwin. And it is not very sophisticated, i.e. assuming normal style
>> and weight. But you could extend it to interpret the last two  
>> chars of
>> the Windows font file name:
>> bi => Bold Italic
>> ?i => Italic
>> ?b => Bold
>
> Thanks.
> <snip />
>
> The Verdana Bold Italic has a "z" at the end of the file name.
> The Vera Sans Mono Bold Italic a "bi".

Still, sounds like something that can easily be caught...
The real headaches would be fonts whose filename ends with 'b', but  
do not refer to a bold font :/

> Some names have the "bold" (or the German "kursiv") as a single
> word, surrounded with space. Some have it inside a word, without
> any Space.
>
> There's no real system.

Maybe it's not so much a 'system', but more a set of conventions. The  
filename suffixes maybe different between fonts, but the differences  
are the same regardless of the language. The names of the fonts are  
localized, so I would definitely not use those ...

> <snip />
> I have to find a way to let a user install fonts. It would have
> been nice to just import all the known TTF from his system.

Yeah, it would rock! :)
As a heads-up: Efforts are ongoing in that direction, no timeline,  
but high on our wish-list as well.


Cheers,

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: A way to automatically generate metrics AND config entries for *.ttf?

Posted by Stefan Scholl <st...@no-spoon.de>.
Manuel Mall <ma...@apache.org> wrote:
> cygwin. And it is not very sophisticated, i.e. assuming normal style 
> and weight. But you could extend it to interpret the last two chars of 
> the Windows font file name:
> bi => Bold Italic
> ?i => Italic
> ?b => Bold

Thanks.

Unfortunatly that's the point where I'm stuck. You can't really
guess style and weight this way. Neither with the name of the
font, nor with the filename. :-(

On my German system there are e. g.

Verdana                 verdana.TTF
Verdana Fett            verdanab.TTF
Verdana Fett Kursiv     verdanaz.TTF
Verdana Kursiv          verdanai.TTF

(Fett = bold, Kursiv = italic)

BUT some names are in English:

Vera Sans Mono Bold Italic      VERAMOBI.TTF


The Verdana Bold Italic has a "z" at the end of the file name.
The Vera Sans Mono Bold Italic a "bi".


Some names have the "bold" (or the German "kursiv") as a single
word, surrounded with space. Some have it inside a word, without
any Space.

There's no real system. 

I confess that I've just browsed the specs of Truetype, but I
haven't found anything in it to guess style and weight. Maybe
"italic", but nothing more.


> Not perfect but may be better than editing everything by hand?

Not perfect enough for what I had in mind.

I have to find a way to let a user install fonts. It would have
been nice to just import all the known TTF from his system.

Now this process has to be a bit more interactive. With the user
knowing what a given font file really contains. :-/

Well, I can supply the information for some fonts I know.  So the
user may be alright with it if he only uses some mainstream fonts.


Anyways, thanks for confirming my fears.
When there would have been an easy way, I would have wasted some
hours poking around without finding it myself. :-)


-- 
Web (en): http://www.no-spoon.de/ -*- Web (de): http://www.frell.de/


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: A way to automatically generate metrics AND config entries for *.ttf?

Posted by Manuel Mall <ma...@apache.org>.
On Sunday 11 June 2006 21:28, Stefan Scholl wrote:
> Is there a ready to use tool which can operate on a list of
> truetype fonts (e. g. "%windir%\FONTS\*.TTF" on Windows) and
> generates all the needed metrics *and* config entries?
>
> The metrics aren't a real problem. But the font-triplets in the
> config are tough, because I don't see a way to automatically get
> the needed information (style, weight).

No there is no such tool I am aware off. I used the following Unix 
script once to create font metrics:

for file in "$@" ; do
    fname=`xmlpp $file | grep 'font-name'`
    ename=`basename $file .xml`
    echo \<font metrics-file=\"$file\"
    echo \ \ embed-file=\"$ename.pfm\"\>
    echo \ \ \<font-triplet name=\"$fname\" style=\"normal\" 
weight=\"normal\"\>
    echo \</font\>
done

xmlpp is a free Perl xml pretty printer from 
http://software.decisionsoft.com/

Of course this will not work on Windows directly but possibly using 
cygwin. And it is not very sophisticated, i.e. assuming normal style 
and weight. But you could extend it to interpret the last two chars of 
the Windows font file name:
bi => Bold Italic
?i => Italic
?b => Bold

Not perfect but may be better than editing everything by hand?

Manuel


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org