On 09.02.2008 21:43:12 Justus-bulk wrote:
> Jeremias -
> 
> I have found the cause for this one:
> 
> [EMAIL PROTECTED] wrote on Thu, 07 Feb 2008 10:18:37 +0100:
> 
> >   - The two DejaVu fonts ("DejaVu Sans" and "DejaVu Serif") are
> >     condensed.
> 
> - DejaVuSerif.ttf calls declares the family name "DejaVu Serif", and
>   DejaVuSerifCondensed.ttf declares the family names "DejaVu Serif
>   Condensed" and "DejaVu Serif".
> 
> - FontInfoFinder.generateTripletsFromFont() registers triplets for all
>   (distinct) family names a font declares.
> 
> I have not checked how Fop resolves this conflict, but of course, one
> font is chosen in the end, and for me it's the condensed font that
> wins.
> 
> It seems odd to me that two DejaVu fonts declare the same family name.

Not really. The family name is just the name for a whole set of fonts
including variants such as "Condensed". The tricky thing is to recognize
the "main" font. Right now, there's no conflict resolution code for such
situations which is why you stumbled over this problem, I guess.

> What is the semantics of multiple family names? Is there an order of
> preference? In this case, one could change Fop to drop the condensed
> "DejaVu Serif" triple since "DejaVu Serif" is its second family name,
> whereas it is the first family name of the non-condensed font.
> 
> Or (or And, in case of ties), one might prefer the non-condensed
> "DejaVu Serif" triple since the font full name and the family name are
> in agreement, whereas they aren't for the condensed font.
> Might be a useful heuristics...
> 
> Justus

The problem here is that you don't know in which order the discovered
fonts arrive for the registration, so the logic should probably be:
- Generate the "family" triplet for any font of that family if it does
not exist already.
- If the triplet exists already and the family name equals the full name
then replace the triplet.

So if you don't have the regular DejaVu Serif but only the Condensed
variant, you could still access the font using "DejaVu Serif".

Do you want to try improving the code? If not, please open a Bugzilla
task for me referencing this thread I'll see if I can find a bit of time
somewhere in between.

Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to