Re: Font priorities



At 08:14 PM 2/4/2003, Owen Taylor wrote:
On Tue, 2003-02-04 at 22:27, Keith Packard wrote:
> Around 21 o'clock on Feb 4, Owen Taylor wrote:
>
> > The thing is, fontconfig, when deciding between Raghindi and
> > FreeSans for Hindi, says: FreeSans covers the current language,
> > English, and Raghindi doesn't, lets' use FreeSans, even though
> > Raghindi is part of the Sans alias, and FreeSans isn't.
>
> Fontconfig uses language to order font preferences; there's no other sane
> way to choose between two otherwise similar fonts.  If Raghindi doesn't
> support $LANG, then your application better let fontconfig know what
> language you are interested in.

Well, there are two problems:

 Acute: fontconfig is picking fonts that don't have the right
  OpenType tables.

 Chronic: There is no reliable way for the user to specify
  preferences as to what fallback fonts they prefer. Once
  you get a fallback, you get the fallback that best matches
  the current language tag, even if that font is the ugliest
  font on the system.

I think both need to be addressed.

> > I've been somewhat unable to convince Keith there actually is
> > a problem here, though I consider this a fairly major flaw
> > of the fontconfig scheme.
>
> I think one issue here is only that pango wants OT tables and Fontconfig
> doesn't provide a mechanism for selecting fonts based on that support.  We
> could easily add that.

Yeah ... I think for Pango's needs, a fontconfig key that was all
the tables in the TrueType file would probably be sufficient.
Generally, "Covers Hindi codepoints and has a GSUB table" is
sufficient information. Unless for FreeFont they start adding
the OpenType tables piecemeal, and have the tables for Arabic
but not the tables for Hindi...

In the ICU LayoutEngine I go one step further: if the font has a GSUB table, I also check to see if the GSUB table contains an entry for the script. I can provide you with some sample code to do this; I suspect that most of it is already in FreeType...

Regards,
Eric



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