|
|
Created:
6 years, 9 months ago by Lei Zhang Modified:
6 years, 8 months ago CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, kochi, jungshik at Google Base URL:
svn://chrome-svn/chrome/trunk/src/ Visibility:
Public. |
DescriptionLinux: Do better font substitution for Chinese characters.
BUG=347044
TEST=Manual, see bug.
NOTRY=true
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=260354
Patch Set 1 #
Total comments: 4
Patch Set 2 : #
Total comments: 6
Patch Set 3 : #Messages
Total messages: 18 (0 generated)
For the test case in the bug, it does require having a zh-CN truetype font installed for the substitution to actually succeed.
Is this only about PDF-plugin? If so, can you add that to the CL description? https://codereview.chromium.org/213793003/diff/1/content/browser/renderer_hos... File content/browser/renderer_host/render_sandbox_host_linux.cc (right): https://codereview.chromium.org/213793003/diff/1/content/browser/renderer_hos... content/browser/renderer_host/render_sandbox_host_linux.cc:418: if (is_english) { Can we access Chrome's per-script font pref here? Then, fallback fonts can be set to them per script/language. Perhaps, in the next round. https://codereview.chromium.org/213793003/diff/1/content/browser/renderer_hos... content/browser/renderer_host/render_sandbox_host_linux.cc:571: bool is_english = false; Perhaps, it'd be better to change change |is_english| to |is_lgc| (Latin-Greek-Cyrillic) and set it to true for Windows code pages covering LGC script. Arial/TNR/Courier covers more than LGC, but most Linux distros have very old versions of them and the coverage does not go beyond LGC.
This code is used by more than just the PDF plugin. I don't know the PPAPI/Flash code paths that well, but they would likely benefit from better font selection. https://codereview.chromium.org/213793003/diff/1/content/browser/renderer_hos... File content/browser/renderer_host/render_sandbox_host_linux.cc (right): https://codereview.chromium.org/213793003/diff/1/content/browser/renderer_hos... content/browser/renderer_host/render_sandbox_host_linux.cc:418: if (is_english) { On 2014/03/27 11:06:11, Jungshik Shin wrote: > Can we access Chrome's per-script font pref here? Then, fallback fonts can be > set to them per script/language. Perhaps, in the next round. I don't know. Added a TODO. Will investigate in the future. https://codereview.chromium.org/213793003/diff/1/content/browser/renderer_hos... content/browser/renderer_host/render_sandbox_host_linux.cc:571: bool is_english = false; On 2014/03/27 11:06:11, Jungshik Shin wrote: > Perhaps, it'd be better to change change |is_english| to |is_lgc| > (Latin-Greek-Cyrillic) and set it to true for Windows code pages covering LGC > script. Done. > Arial/TNR/Courier covers more than LGC, but most Linux distros have very old > versions of them and the coverage does not go beyond LGC. On my system, half the characters in the PDF rendered with the default font. With the zh-cn language preference set, it selected a simplified Chinese font which has much better coverage.
btw I'm not really familiar with this code, so I defer to whatever you guys agree on. rubberstamp lgtm
https://codereview.chromium.org/213793003/diff/20001/content/browser/renderer... File content/browser/renderer_host/render_sandbox_host_linux.cc (right): https://codereview.chromium.org/213793003/diff/20001/content/browser/renderer... content/browser/renderer_host/render_sandbox_host_linux.cc:589: FcLangSetAdd(langset, reinterpret_cast<const FcChar8*>("lt")); lgc=true https://codereview.chromium.org/213793003/diff/20001/content/browser/renderer... content/browser/renderer_host/render_sandbox_host_linux.cc:603: FcLangSetAdd(langset, reinterpret_cast<const FcChar8*>("hr")); lgc=true https://codereview.chromium.org/213793003/diff/20001/content/browser/renderer... content/browser/renderer_host/render_sandbox_host_linux.cc:606: FcLangSetAdd(langset, reinterpret_cast<const FcChar8*>("el")); ditto https://codereview.chromium.org/213793003/diff/20001/content/browser/renderer... content/browser/renderer_host/render_sandbox_host_linux.cc:614: FcLangSetAdd(langset, reinterpret_cast<const FcChar8*>("ru")); ditto https://codereview.chromium.org/213793003/diff/20001/content/browser/renderer... content/browser/renderer_host/render_sandbox_host_linux.cc:621: FcLangSetAdd(langset, reinterpret_cast<const FcChar8*>("tr")); ditto https://codereview.chromium.org/213793003/diff/20001/content/browser/renderer... content/browser/renderer_host/render_sandbox_host_linux.cc:624: FcLangSetAdd(langset, reinterpret_cast<const FcChar8*>("vi")); ditto
With the above additional lgc=true, lgtm
Done.
The CQ bit was checked by thestig@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/thestig@chromium.org/213793003/40001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_rel
The CQ bit was checked by thestig@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/thestig@chromium.org/213793003/40001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_rel
The CQ bit was checked by thestig@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/thestig@chromium.org/213793003/40001
Message was sent while issue was closed.
Change committed as 260354 |