Page MenuHomePhabricator

Japanese font no longer works in Score addlyrics
Open, Needs TriagePublicBUG REPORT

Description

Feature summary (what you would like to be able to do):

Please support Japanese font

Steps to reproduce (a list of clear steps to create the situation that made you report this, including full links if applicable):

<score vorbis=1 midi=1>{
\key f \major \time 3/4 \tempo 4 = 60 \relative bes {
 c8 f f4. g8 | a c f d c4 | d8 f, f4 g | a2 r4 |\break
 a8 d c4. d8 | f d c d c a | c a f a g f | f2 r4 \bar "|."
 }
\addlyrics {
 ゆ う や け こ や け ー の あ か と ん ぼ お わ れ て み た の ー は ー い つ の ー ひ ー か
 }
}</score>

Thank you!

Event Timeline

Reedy added a project: I18n.
Reedy updated the task description. (Show Details)

Not completely clear where this problem lies... Is it MW/Score? Lilypond (et al) hence Upstream ? WMF servers?

Would be worth testing other scripts too

@Bcxfu75k Do you know if this ever worked? Wondering if shellbox type mitigations might have broken it.

I don't remember it has worked before...

Reedy added a subscriber: Legoktm.

It looks like it works on my dev wiki just fine... It might be shellbox fallout, tagging as a regression. Might need some extra packages in the shellbox container? CC @Legoktm

Screenshot 2021-08-24 at 08.10.03.png (540×1 px, 116 KB)

Reedy renamed this task from Support Japanese font to Japanese font no longer works in Score addlyrics.Tue, Aug 24, 7:13 AM
Reedy changed the subtype of this task from "Feature Request" to "Bug Report".

I totally missed the issue of fonts, sorry about that. For reference, https://gerrit.wikimedia.org/g/operations/puppet/+/50c77cde3618e7ac5e0b838fda4dad593e7895bd/modules/mediawiki/manifests/packages/fonts.pp#5 has the list of all the fonts that used to be available.

Based on T184664: Install Noto fonts on scaling servers for SVG rendering I think we should be able to just install noto fonts for biggest language coverage?

Here's what the fonts-noto-cjk package looks like:

7lFDvYK.png (228×814 px, 16 KB)

@Bcxfu75k how does that look to you? Or is there a different font that would be preferred?

Change 714605 had a related patch set uploaded (by Legoktm; author: Legoktm):

[mediawiki/libs/Shellbox@master] pipeline: Install noto-core and noto-cjk fonts in Score image

https://gerrit.wikimedia.org/r/714605

Legoktm, your screen shot looks serif font but 'Noto Sans CJK' would be the best. Because jawiki uses Sans-serif fonts for all pages.
(I guess it would be called 'fonts-noto-sans-cjk'. )
Reedy's screen shot is Sans fonts, which I preferred.

Hmm, https://packages.debian.org/buster/fonts-noto-cjk says it contains the sans fonts too.

In the shellbox container:

# fc-match :lang=ja
NotoSansCJK-Regular.ttc: "Noto Sans CJK JP" "Regular"

I'll keep looking to see why it's using the serifs instead of sans-serif.

I'm relatively confident that LilyPond is what's forcing the use of a serif font, English text uses serif too (though I couldn't find exactly where in the code it was doing that). When I asked Reedy about his system, he only had a sans-serif Japanese font installed, so it had to use that even if it wanted a serif.

So I propose that right now we deploy using of fonts-noto-cjk, so you at least have *some* fonts in the short term even though it uses serif. Theoretically you can use \markup { \sans "...." } but I couldn't get that to align properly with \addlyrics, possibly I'm missing something (see LP docs).

Then we can look into having sans-serif be default by:

  • Forcing LilyPond to use sans-serif font for Japanese lyrics
  • Telling fontconfig to use sans-serif font even if serif was asked for (this would prevent using any serif fonts at all though).
  • Removing the serif fonts from the container (this would affect all other CJK languages too)

All of which are more complicated, so I don't want to do it immediately.

If we are going to make that the default for Japanese, I think it would be best not to manually add some manual markup for forcing it into every score.

Change 714655 had a related patch set uploaded (by Legoktm; author: Legoktm):

[mediawiki/extensions/Score@master] Document need for installing fonts in README

https://gerrit.wikimedia.org/r/714655

Change 714605 merged by jenkins-bot:

[mediawiki/libs/Shellbox@master] pipeline: Install noto-core and noto-cjk fonts in Score image

https://gerrit.wikimedia.org/r/714605

The Japanese fonts are enabled now, see https://test.wikipedia.org/wiki/Score/jawiki/1 (you'll need to modify the <score> input to invalidate the cache, adding a %%comment%% is good enough). Next is figuring out how to make Japanese default to sans-serif fonts.

Change 714655 merged by jenkins-bot:

[mediawiki/extensions/Score@master] Document need for installing fonts in README

https://gerrit.wikimedia.org/r/714655