[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: font selection mechanism (e.g., Japanese)

From: David Reitter
Subject: Re: font selection mechanism (e.g., Japanese)
Date: Tue, 2 Feb 2010 09:36:54 -0500

On Feb 2, 2010, at 6:51 AM, Kenichi Handa wrote:

> Hmmm, then NS's font-backend should be improved.  Could
> someone working on NS port please port take a look at this
> problem.

FWIW, I have experimented with other variants of ns_findfonts() (for "match", 
not for "list"), but ultimately found that it's mostly "list" that is called 
while the code in font.c iteratively reduces that constraints.

I also found one font that is returned with the first batch ("Osaka"), which 
has sufficient (.95) coverage for the 'han' script.  However, it is still not 
chosen, and I assume that this is because there is not sufficient information 
present about the font weight.  That's the NS font driver's fault.  I have 
filed a bug report about this; of course I've tried to provide the weight 
information (with odd results - not sure why).   Similarly, we don't get the 
"ADSTYLE" information about fonts either, so that the alternative font can't be 
chosen according to that either.   Someone with better knowledge of nsfont.m 
might be able to debug this.

>> The problem I have now is to get it to choose different fonts within  
>> the same script in cases where a low-coverage font does not provide a  
>> glyph.  The above threshold change makes things work better in  
>> practice, but the HELLO file shows serious regressions.
> Regression in which part?  Only for Han scripts, or for all scripts?

For more than han.  What I have since noticed is that we're unable or unwilling 
to select font foo for a given script, but, when foo doesn't have glyphs for 
all needed characters, switch to another font bar for the same script for those 
characters.  Is that correct?

>> Where in the code would one get it to choose a different font for a  
>> character if the current font can't display it?  This is by-character  
>> selection, not by-script.
> The function fontset_find_font in fontset.c does that job.

OK, I'll look into that.  I assume it does that automatically, i.e. without 
explicit specifications in a fontset?
(All I'm talking about here is automatic selection.  It's clear that a fontset 
can be constructed manually.)

> By the way, I locally have a code that respect the order of
> fonts returned by font_driver->list () in font sorting.  I'm
> going to commit it for post 23.2 branch.  Then, each driver
> can return fonts in their preferred order.

But then the driver also needs an argument such as a full font spec for the 
target font, so that the order can be determined by similarity.  Right now, the 
only information it has is a set of hard constraints.  

- D

Attachment: PGP.sig
Description: This is a digitally signed message part

reply via email to

[Prev in Thread] Current Thread [Next in Thread]