Chromium Code Reviews
DescriptionFix 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 #Messages
Total messages: 13 (5 generated)
|