Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(744)

Issue 2302313002: Configure font font names in GFX unittests (Closed)

Created:
4 years, 3 months ago by drott
Modified:
4 years, 1 month ago
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Configure font font names in GFX unittests Currently the GFX unittests assume a font called "Symbol" to be available on all platforms. While the "Symbol" font may be available on Ubuntu, it is a deprecated Type 1 package and stems from the xfonts-mathml package on Debian, which is deprecated and no longer maintained in favor of the newer STIX fonts [1]. In preparation for activating filtering for SNFT format font files, we have to break with the assumption above and make at least some of the used fonts in the gfx unittests configurable per OS. This CL makes the symbol font name configurable and replace it with "DejaVu Sans" on Linux. In addition to reconfiguring the Symbol font this CL introduces a CJK font as an example of a font that has a different descender/ascender ratio to Arial as some unittests such as StringSizeRespectsFontListMetrics require, since the newly chosen symbol font on Linux does not that expose that property. To make StringSizeRespectsFontListMetrics more robust, this CL adds additional assertions based on GetFontSpansForTesting. [1] https://tracker.debian.org/pkg/xfonts-mathml BUG=632142 Committed: https://crrev.com/bdbc597424976a0b2f23b38b0c3630b636347ad2 Cr-Commit-Position: refs/heads/master@{#417244}

Patch Set 1 #

Patch Set 2 : Font_names_testing.h file added #

Patch Set 3 : Change to OpenSymbol and make test more robust #

Total comments: 8

Patch Set 4 : Review comments addressed #

Total comments: 1

Patch Set 5 : Now with the new file #

Patch Set 6 : One more attempt, changing font size in tests that rely on height differences, symbol font choice #

Patch Set 7 : Another attempt, introducing a CJK font and mixed font list related tests #

Patch Set 8 : Fixed parenthesis #

Patch Set 9 : Fix Symbol font name on Win, change CJK font to PingFang on Mac #

Patch Set 10 : Back to Symbol font for OS X and iOS #

Patch Set 11 : Reintroduce height based assertions now that CJK font is used in StringSizeRespectsFontListMetrics #

Total comments: 5

Patch Set 12 : Use Heiti SC font, namespace, comment, hex escapes #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -32 lines) Patch
M ui/gfx/BUILD.gn View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M ui/gfx/font_list_unittest.cc View 1 2 3 4 5 6 3 chunks +5 lines, -3 lines 0 comments Download
A + ui/gfx/font_names_testing.h View 1 2 3 4 5 6 1 chunk +6 lines, -4 lines 0 comments Download
A ui/gfx/font_names_testing.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +25 lines, -0 lines 2 comments Download
M ui/gfx/font_unittest.cc View 1 2 3 2 chunks +8 lines, -4 lines 0 comments Download
M ui/gfx/render_text_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 8 chunks +29 lines, -21 lines 0 comments Download

Messages

Total messages: 75 (54 generated)
drott
4 years, 3 months ago (2016-09-02 13:01:24 UTC) #4
Alexei Svitkine (slow)
https://codereview.chromium.org/2302313002/diff/40001/ui/gfx/font_names_testing.h File ui/gfx/font_names_testing.h (right): https://codereview.chromium.org/2302313002/diff/40001/ui/gfx/font_names_testing.h#newcode1 ui/gfx/font_names_testing.h:1: // Copyright (c) 2016 The Chromium Authors. All rights ...
4 years, 3 months ago (2016-09-02 15:19:58 UTC) #15
drott
Thanks for the quick review. CL updated. https://codereview.chromium.org/2302313002/diff/40001/ui/gfx/font_names_testing.h File ui/gfx/font_names_testing.h (right): https://codereview.chromium.org/2302313002/diff/40001/ui/gfx/font_names_testing.h#newcode1 ui/gfx/font_names_testing.h:1: // Copyright ...
4 years, 3 months ago (2016-09-02 15:35:54 UTC) #18
Alexei Svitkine (slow)
https://codereview.chromium.org/2302313002/diff/60001/ui/gfx/BUILD.gn File ui/gfx/BUILD.gn (right): https://codereview.chromium.org/2302313002/diff/60001/ui/gfx/BUILD.gn#newcode553 ui/gfx/BUILD.gn:553: "font_names_testing.cc", Looks like you forgot to add this file.
4 years, 3 months ago (2016-09-02 15:38:33 UTC) #21
drott
Now with the new file
4 years, 3 months ago (2016-09-02 15:39:59 UTC) #22
drott
One more attempt, changing font size in tests that rely on height differences, symbol font ...
4 years, 3 months ago (2016-09-05 13:04:52 UTC) #27
drott
Another attempt, introducing a CJK font and mixed font list related tests
4 years, 3 months ago (2016-09-05 14:17:56 UTC) #32
drott
Fixed parenthesis
4 years, 3 months ago (2016-09-06 06:34:51 UTC) #37
drott
Fix Symbol font name on Win, change CJK font to PingFang on Mac
4 years, 3 months ago (2016-09-06 15:16:35 UTC) #42
drott
Back to Symbol font for OS X and iOS
4 years, 3 months ago (2016-09-06 16:10:56 UTC) #47
drott
Reintroduce height based assertions now that CJK font is used in StringSizeRespectsFontListMetrics
4 years, 3 months ago (2016-09-06 17:00:58 UTC) #50
Alexei Svitkine (slow)
LGTM % comment https://codereview.chromium.org/2302313002/diff/200001/ui/gfx/font_names_testing.cc File ui/gfx/font_names_testing.cc (right): https://codereview.chromium.org/2302313002/diff/200001/ui/gfx/font_names_testing.cc#newcode25 ui/gfx/font_names_testing.cc:25: } // end namespace gfx This ...
4 years, 3 months ago (2016-09-06 19:48:34 UTC) #56
msw
lgtm with nits https://codereview.chromium.org/2302313002/diff/200001/ui/gfx/font_names_testing.cc File ui/gfx/font_names_testing.cc (right): https://codereview.chromium.org/2302313002/diff/200001/ui/gfx/font_names_testing.cc#newcode25 ui/gfx/font_names_testing.cc:25: } // end namespace gfx On ...
4 years, 3 months ago (2016-09-06 20:06:06 UTC) #57
Alexei Svitkine (slow)
https://codereview.chromium.org/2302313002/diff/200001/ui/gfx/font_names_testing.cc File ui/gfx/font_names_testing.cc (right): https://codereview.chromium.org/2302313002/diff/200001/ui/gfx/font_names_testing.cc#newcode25 ui/gfx/font_names_testing.cc:25: } // end namespace gfx On 2016/09/06 20:06:06, msw ...
4 years, 3 months ago (2016-09-06 21:06:31 UTC) #58
drott
Use Heiti SC font, namespace, comment, hex escapes
4 years, 3 months ago (2016-09-08 09:26:23 UTC) #59
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2302313002/220001
4 years, 3 months ago (2016-09-08 10:50:39 UTC) #66
commit-bot: I haz the power
Committed patchset #12 (id:220001)
4 years, 3 months ago (2016-09-08 10:55:34 UTC) #67
commit-bot: I haz the power
Patchset 12 (id:??) landed as https://crrev.com/bdbc597424976a0b2f23b38b0c3630b636347ad2 Cr-Commit-Position: refs/heads/master@{#417244}
4 years, 3 months ago (2016-09-08 10:59:32 UTC) #69
jungshik at Google
Sorry for the post-check-in comment. https://codereview.chromium.org/2302313002/diff/220001/ui/gfx/font_names_testing.cc File ui/gfx/font_names_testing.cc (right): https://codereview.chromium.org/2302313002/diff/220001/ui/gfx/font_names_testing.cc#newcode12 ui/gfx/font_names_testing.cc:12: const char kSymbolFontName[] = ...
4 years, 3 months ago (2016-09-16 19:34:55 UTC) #71
drott
https://codereview.chromium.org/2302313002/diff/220001/ui/gfx/font_names_testing.cc File ui/gfx/font_names_testing.cc (right): https://codereview.chromium.org/2302313002/diff/220001/ui/gfx/font_names_testing.cc#newcode12 ui/gfx/font_names_testing.cc:12: const char kSymbolFontName[] = "DejaVu Sans"; On 2016/09/16 at ...
4 years, 3 months ago (2016-09-20 07:37:39 UTC) #72
jungshik at Google
4 years, 3 months ago (2016-09-20 18:10:02 UTC) #73
Message was sent while issue was closed.
On 2016/09/20 07:37:39, drott wrote:
>
https://codereview.chromium.org/2302313002/diff/220001/ui/gfx/font_names_test...
> File ui/gfx/font_names_testing.cc (right):
> 
>
https://codereview.chromium.org/2302313002/diff/220001/ui/gfx/font_names_test...
> ui/gfx/font_names_testing.cc:12: const char kSymbolFontName[] = "DejaVu Sans";
> On 2016/09/16 at 19:34:55, jungshik at google wrote:
> > Will this test ever be run on an actual Chrome OS device (as opposed to on
> Linux)? Perhaps, not. 
> > 
> > Just in case the answer is yes,  kSymbolsFontName had better be 'Noto Sans
> Symbol" on CrOS. Similarly, kCJKFOntName had better be 'Noto Sans CJK JP' (or
> KR, SC or TC). 
> > (I'm planning to remove DejaVu fonts from CrOS).
> 
> It would be much better to have access to Noto indeed, even on Linux.

Hmm... there's a script to run for Chrome OS developers to install Noto and Noto
CJK locally on their Linux box (when they work on CrOS UI, they'd better have
the same set of fonts). The same can be run for trybots, I guess. 

> Unfortunately on Linux we still rely on the bot's/system's/Ubuntu's font
> configuration instead of providing our own set at least for testing. I am not
> sure whether this test runs on CrOS, probably the bots will tell you once you
> remove DejaVu Sans - in that case you can extend the ifdef to put the Noto
fonts
> in there.

Given that kCJKFontName is set to KochiMincho (NOT present on Chromebook) and
there's no test failure, I guess actual Chrome OS devices are not used for
running this test. So, no need to change for now.

Powered by Google App Engine
This is Rietveld 408576698