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

Issue 1252893002: Fix font height on Mac with Helvetica Neue at size 16 (ResourceBundle::MediumFont) (Closed)

Created:
5 years, 5 months ago by tapted
Modified:
5 years, 4 months ago
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@20150722-MacViews-AppInfoNit
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix font height on Mac with Helvetica Neue at size 16 (ResourceBundle::MediumFont) Currently, descenders are getting clipped during View layout (see bug). PlatformFontMac uses -[NSLayoutManager defaultLineHeightForFont:] to initialize |height_|. However, it has a silly rounding bug. Essentially, it gives round(ascent) + round(descent). E.g. Helvetica Neue at size 16 gives ascent=15.4634, descent=3.38208 -> 15 + 3 = 18. When the height should be at least 19. According to the OpenType specification, these values should simply be added, so do basically that. But since layout in RenderTextMac is performed using an integral baseline, use the rounded value of ascent, to ensure all the descenders fit. BUG=513570 Committed: https://crrev.com/ef6c19f9665ccfa83c27472d01f543f2bbb20249 Cr-Commit-Position: refs/heads/master@{#340627}

Patch Set 1 #

Patch Set 2 : trim tracing #

Patch Set 3 : add floats #

Patch Set 4 : Clobber useless patchset dependency #

Patch Set 5 : Add a test, notes #

Patch Set 6 : go away patchset dependency. you are not wanted. #

Patch Set 7 : nit test comment #

Total comments: 3

Patch Set 8 : style -> styles #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -5 lines) Patch
M ui/gfx/platform_font_mac.mm View 1 2 3 4 1 chunk +12 lines, -5 lines 0 comments Download
M ui/gfx/platform_font_mac_unittest.mm View 1 2 3 4 5 6 7 1 chunk +43 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (5 generated)
tapted
Hi Alexei, please take a look. There's more tracing on the bug at http://crbug.com/513570 (conveniently, ...
5 years, 5 months ago (2015-07-24 06:26:19 UTC) #4
Alexei Svitkine (slow)
Can you also add a unit test?
5 years, 5 months ago (2015-07-24 15:35:39 UTC) #5
tapted
On 2015/07/24 15:35:39, Alexei Svitkine wrote: > Can you also add a unit test? Done. ...
5 years, 5 months ago (2015-07-27 03:58:57 UTC) #6
Alexei Svitkine (slow)
lgtm https://codereview.chromium.org/1252893002/diff/150001/ui/gfx/platform_font_mac_unittest.mm File ui/gfx/platform_font_mac_unittest.mm (right): https://codereview.chromium.org/1252893002/diff/150001/ui/gfx/platform_font_mac_unittest.mm#newcode64 ui/gfx/platform_font_mac_unittest.mm:64: gfx::Font::FontStyle style[] = { Nit: styles
5 years, 4 months ago (2015-07-27 14:48:04 UTC) #7
tapted
https://codereview.chromium.org/1252893002/diff/150001/ui/gfx/platform_font_mac_unittest.mm File ui/gfx/platform_font_mac_unittest.mm (right): https://codereview.chromium.org/1252893002/diff/150001/ui/gfx/platform_font_mac_unittest.mm#newcode64 ui/gfx/platform_font_mac_unittest.mm:64: gfx::Font::FontStyle style[] = { On 2015/07/27 14:48:04, Alexei Svitkine ...
5 years, 4 months ago (2015-07-28 00:38:49 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1252893002/170001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1252893002/170001
5 years, 4 months ago (2015-07-28 00:39:05 UTC) #11
commit-bot: I haz the power
Committed patchset #8 (id:170001)
5 years, 4 months ago (2015-07-28 01:30:39 UTC) #12
commit-bot: I haz the power
5 years, 4 months ago (2015-07-28 01:31:27 UTC) #13
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/ef6c19f9665ccfa83c27472d01f543f2bbb20249
Cr-Commit-Position: refs/heads/master@{#340627}

Powered by Google App Engine
This is Rietveld 408576698