Re: [gtk-i18n-list] Re: On CJK font selection (was Re: [Fwd: Re: Request for review and advice on wqy-bitmap-fonts fontconfig settings])



Thank you very much!

On Thu, 20 Dec 2007 17:25:42 -0500
Behdad Esfahbod <behdad behdad org> wrote:
>> >The picture (1), (2), (3) are screenshots under English.
>> >
>> >If I execute gedit as
>> >	$ env LANG=C PANGO_LANGUAGE=en gedit
>> >font is not changed during I type "[" then "a".
>> >
>> >The picture (1'), (2'), (3'), (4') are screenshots under Japanese.
>> >
>> >If I execute gedit as
>> >	$ env LANG=ja_JP.euc-jp PANGO_LANGUAGE=ja gedit
>
>As long as your LANG and PANGO_LANGUAGE are the same, you don't need
>both.  PANGO_LANGUAGE is mostly useful when you set LANG to en.  That's
>not relevant to your issue here though.

I see.

>> >and I type "[" then "a" then "あ". The font to display
>> >"[" is dynamically changed as (2'), (3'), (4') during
>> >typing keys. The dynamically font switching shifts the
>> >baseline up and down, it looks as strange zig-zag behaviour.
>> >I could not stop this switching by setting PANGO_LANGUAGE=en
>> >nor PANGO_LANGUAGE=ja. How can I stop this switching?
>
>I tell you what's happening, you tell me what Pango is doing wrong and
>how you think it can be fixed:
>
>  - In image 2', you are running under Japanese locale, you type a
>COMMON character ('[') only, Pango assumes you are going to type
>Japanese text, your preferred Japanese font has a glyph for '[', so
>Pango uses it, hoping that it will use the same font when you enter
>Japanese text.

Oh! It corrects my misunderstanding. I was misunderstanding as
only '[' was given, the text was recognized as a Latin because
'[' is included in ASCII. Now I understand that ASCII numerical
digits are also COMMON character.

>  - In image 3', you entered a Latin letter, not Japanese (an unexpected
>event given that you run under Japanese locale), so Pango now associates
>the bracket to the Latin text, because, well, that's the only non-COMMON
>script there.  You sure have a bracket and Latin text in it.  So it
>renders the bracket using the same font that it uses for the Latin text.

I see.

>  - In image 4', you add a Japanese character.  No surprises here: you
>have two fonts, the line takes the height of the taller font.  So the
>Latin text is shifted down a bit.

I see.

>So, the issue comes down to the fact that:
>
>  - It's unexpected to enter Latin under Japanese locale.
>
>  - You have a COMMON character at the beginning of the line.
>
>  - Your Japanese and Latin fonts have different heights.

I see. The first clause is quite important. I guess, inputting
Latin text under Arabic locale might be possible but irregular
(right guessing? please let me know), but an insertion of
Latin text (to be more correctly, I mean a string of ASCII
alphabets) under Japanese locale is popular, especially text
around information technology. For example, please check the
website of Japanese Standards Association http://www.jsa.or.jp/

>And this case is rare enough that I normally don't consider it an issue
>at all.  But apparently multiplying that by 1 billion makes it quite
>visible!
>
>One way one may suggest is that Pango should reserve a minimum line
>height that is enough to fit the default Japanese font, because it's
>running under Japanese locale after all.  That would fix the jump from
>3' to 4', but makes English-only paragraphs look very ugly and badly
>spaced vertically, so that's not an option either.
>
>The jump from 2' to 3' can't be fixed.  I already proved that.  If one
>fixes it, it would introduce the bug that '[' followed by a Japanese
>character will choose a separate fonts for those chars, OR, that font
>used for '[' will change when you type a Japanese char.

Umm. Is it possible for Pango to bind COMMON characters to single
font? I understand the font switching in my example is caused by
the fact that the appropriate font to show COMMON character is
determined by its context. If the font to show COMMON character is
fixed to single font, my problem will be slightly better although
the line height shifting still occurs.

>It's as simple as this: Pango can't know what you are going to type next.
>It can just guess, and it's guessing pretty good. It's just not reading
>your mind yet :).

Indeed. I wish anybody can implement it in Pango2 :-)

>I have two suggestions for what you can do that may achieve better
>results for you.
>
>  - Run under LC_LANG=en_US LC_MESSAGES=ja_JA
>
>  - Choose a non-generic font family in gedit.  That is, something other
>than Sans, Sans-serif, and Monospace.

Oops, it's too application specific...

Regards,
mpsuzuki


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