(1)
<edit name="lang" mode="prepend">
<string>en</string>
</edit>
(2) Another possibility (and maybe real fix (tm)) is to remove latin
characters from the cjk font, if license allows.
Creating a new font by forking existing fonts will be fine from the viewpoint
of licenses.
Typical approach similar to this is replacing latin glyphs of a CJK font with ones
from another latin font. There are many mixed fonts created in this approach.
For 42.2, I will keep sans serif the same as before, which uses IPA PGothic
for both latin and CJK characters.
For Tumbleweed, I will test (1). Then I will consider (2) or find a mixed font.
I will do SR of fonts-config and noto-sans-fonts tomorrow.
Thanks,
Fuminobu TAKEYAMA
On 2016/09/19 17:45, Petr Gajdos wrote:
On Fri, Sep 16, 2016 at 12:21:28AM +0900, Fuminobu TAKEYAMA wrote:
The resulting family list will be
FooBar Mincho, Robot Slab, IPAPMincho, IPAexMincho, ..., serif
However, the font fontconfig selects Robot Slab.
This is because the selected font is not the one of the top of the family list
but the family that have highest score.
The scoring rule of fontconfig is not clear. It seems that its factor might be
(a) The position of the family in the family list
(b) The character sets provided by the family
(c) The strength of binding
The rule (b) precedes (a). This is why the CJK font is selected even though
there are many latin families before the CJK family.
Yes, thanks for your test. When I try with the simple html (attached)
and run with
$ LC_ALL=ja_JP firefox index.html
with just
<match target="pattern">
<test name="lang" compare="eq">
<string>ja</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend">
<string>Roboto Slab</string>
<family>IPAPMincho</family>
<family>IPAMincho</family>
<family>IPAexMincho</family>
</edit>
</match>
the latin string in the html rendered by ipa. Perhaps possible
solutions:
(1)
<match target="pattern">
<test name="lang" compare="eq">
<string>ja</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="lang" mode="prepend">
<string>en</string>
</edit>
<edit name="family" mode="prepend">
<string>Roboto Slab</string>
<family>IPAPMincho</family>
<family>IPAMincho</family>
<family>IPAexMincho</family>
</edit>
</match>
Prepending en before ja so that the requested pattern contains then
lang: "en"(w) "ja"(w)
will shift up Roboto Slab in the metrics you noted here. The latin
string in the html is then rendered by to Roboto Slab. I am not
sure though, how many tools will be confused by the
<edit name="lang" mode="prepend">
<string>en</string>
</edit>
snippet. For example, `LC_ALL=ja_JP fc-match serif` will return
'Roboto Slab'.
(2) Another possibility (and maybe real fix (tm)) is to remove latin
characters from the cjk font, if license allows. We do modify fonts
already, for example, see indic-fonts, where the instructions are
removed for latin symbols due bsc#977195. I believe that the removing
of the glyphs could be done via a fontforge script.
I can try to work out, just decide what way we could try. In case of
(1), I would ask you for trying that for some time for your real
japanese system and even for sans, perhaps.
Or, we can just give up, as you already wrote.
Thanks,
Petr
--
To unsubscribe, e-mail: opensuse-m17n+unsubscribe@opensuse.org
To contact the owner, e-mail: opensuse-m17n+owner@opensuse.org