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

Issue 2839873003: PlatformFontMac: better guess for average width (Closed)

Created:
3 years, 8 months ago by Elly Fong-Jones
Modified:
3 years, 7 months ago
CC:
chromium-reviews, mac-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

PlatformFontMac: better guess for average width PlatformFontMac::GetExpectedTextWidth() was wildly over-estimating text widths, causing dialogs that try to size using Widget::GetLocalizedContentsWidth to be extremely wide on Mac. This change replaces the guess in PlatformFontMac's CalculateMetricsAndInitRenderParams() with a more empirically accurate guess. BUG=654128 Review-Url: https://codereview.chromium.org/2839873003 Cr-Commit-Position: refs/heads/master@{#469336} Committed: https://chromium.googlesource.com/chromium/src/+/3ff0361da27135ec64b787f2630af4ae960399b0

Patch Set 1 #

Total comments: 4

Patch Set 2 : fixes #

Total comments: 4

Patch Set 3 : add a bit of safety checking #

Total comments: 1

Patch Set 4 : as -> attr_string #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -6 lines) Patch
M ui/gfx/platform_font_mac.h View 1 1 chunk +3 lines, -1 line 0 comments Download
M ui/gfx/platform_font_mac.mm View 1 2 3 3 chunks +14 lines, -5 lines 0 comments Download

Messages

Total messages: 21 (10 generated)
Elly Fong-Jones
tapted: ptal? :)
3 years, 8 months ago (2017-04-25 15:11:36 UTC) #3
tapted
this seems reasonable - just some suggestions for possible improvements https://codereview.chromium.org/2839873003/diff/1/ui/gfx/platform_font_mac.mm File ui/gfx/platform_font_mac.mm (right): https://codereview.chromium.org/2839873003/diff/1/ui/gfx/platform_font_mac.mm#newcode225 ...
3 years, 7 months ago (2017-05-01 06:48:05 UTC) #4
Elly Fong-Jones
tapted: ptal? :) https://codereview.chromium.org/2839873003/diff/1/ui/gfx/platform_font_mac.mm File ui/gfx/platform_font_mac.mm (right): https://codereview.chromium.org/2839873003/diff/1/ui/gfx/platform_font_mac.mm#newcode225 ui/gfx/platform_font_mac.mm:225: NSAttributedString* as = [[[NSAttributedString alloc] On ...
3 years, 7 months ago (2017-05-02 14:41:23 UTC) #5
tapted
lgtm with the following https://codereview.chromium.org/2839873003/diff/20001/ui/gfx/platform_font_mac.mm File ui/gfx/platform_font_mac.mm (right): https://codereview.chromium.org/2839873003/diff/20001/ui/gfx/platform_font_mac.mm#newcode136 ui/gfx/platform_font_mac.mm:136: if (!average_width_) { I think ...
3 years, 7 months ago (2017-05-03 00:43:35 UTC) #6
Elly Fong-Jones
https://codereview.chromium.org/2839873003/diff/20001/ui/gfx/platform_font_mac.mm File ui/gfx/platform_font_mac.mm (right): https://codereview.chromium.org/2839873003/diff/20001/ui/gfx/platform_font_mac.mm#newcode136 ui/gfx/platform_font_mac.mm:136: if (!average_width_) { On 2017/05/03 00:43:35, tapted wrote: > ...
3 years, 7 months ago (2017-05-03 18:06:09 UTC) #9
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/2839873003/40001
3 years, 7 months ago (2017-05-03 18:06:44 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/426524)
3 years, 7 months ago (2017-05-03 18:18:55 UTC) #12
Elly Fong-Jones
asvitkine: ptal as ui/font owner? :)
3 years, 7 months ago (2017-05-03 19:20:22 UTC) #14
Alexei Svitkine (slow)
lgtm https://codereview.chromium.org/2839873003/diff/40001/ui/gfx/platform_font_mac.mm File ui/gfx/platform_font_mac.mm (right): https://codereview.chromium.org/2839873003/diff/40001/ui/gfx/platform_font_mac.mm#newcode142 ui/gfx/platform_font_mac.mm:142: base::scoped_nsobject<NSAttributedString> as([[NSAttributedString alloc] Nit: |as| is too short ...
3 years, 7 months ago (2017-05-03 19:24:30 UTC) #15
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/2839873003/60001
3 years, 7 months ago (2017-05-04 14:45:27 UTC) #18
commit-bot: I haz the power
3 years, 7 months ago (2017-05-04 15:06:30 UTC) #21
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/3ff0361da27135ec64b787f2630a...

Powered by Google App Engine
This is Rietveld 408576698