Re: Unexpected font rendering with pango



On Fri, 2003-06-27 at 17:37, Eric Mader wrote:
> You can make the font 'sticky' only for that script. In general, it 
> seems to be a good idea to try and display all characters in a given 
> script in the same font. It might also make sense to take the language 
> into account too; possibly with a notion of what characters are used to 
> write a given language in a given script. I haven't thought about that 
> enough to say for sure..

This is basically what http://bugzilla.gnome.org/show_bug.cgi?id=112503 
is about. Once we have script run information for shaper selection, we
need to push it into the font selection algorithm in some fashion, for
one thing, because shapers are only fed runs of glyphs in the same font.

(The other thing that needs dealing with is dealing omitting
non-rendering characters such as ZWJ from font selection to
avoid having them break runs... fonts shouldn't have to claim to
cover these languages)

The language is already taken into consideration by fontconfig - it
orders fonts returned by how well they match the language tag, and
I think that will automatically carry over into any future 
script-run based system ... as long as we select fonts in the order
that fontconfig returns them, we'll get the best font for the current
language.

I used to worry about font selection algorithms where subsequent
characters could affect previous characters, figuring that would seem
confusing while editing, but I've stopped worrying about that. For
one, thing, it only matters if the font you have selected doesn't
itself include all the characters in the language you are typing.

It certainly doesn't make layout harder in any fundamental way since
Pango never lays out less than a paragraph at a time.

There *is* some question in my mind whether script-range font selection
should apply to anything other than COMMON/INHERITED characters.
 
 - Pro: it's the only way that ransom-note effects will be reduced
   for wrong-tagged text for CJK or Roman where fonts commonly
   don't cover the entire script range.

 - Con: it can actually make things worse because it means that
   a single foreign name might throw an entire paragraph of text
   into a different font.

In fact, I think the Con: here wins ... yes, script-run consideration
for font selection is important, but no it shouldn't be used to fix
problems like the one that started this thread.

Regards,
					Owen

[ Abi - since you asked for suggestions of things to work on, I think
  91542/112503 is the most serious problem that Pango has at the moment.
  Assignment of ZWJ/ZWNJ to the wrong shaper has serious consequences
  for the correct rendering of Farsi and Indic languages. And, I think
  it's also likely fairly *interesting* to work on, which is definitely
  an added bonus ]






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