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

Issue 875303003: For DirectWrite font metrics use the average character width from the TEXTMETRIC structure. (Closed)

Created:
5 years, 11 months ago by ananta
Modified:
5 years, 10 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

For DirectWrite font metrics use the average character width from the TEXTMETRIC structure. Currently we fetch the average character width from the GetTextExtentPoint32 API for DirectWrite as skia does not return this value. The width returned by the GetTextExtentPoint32 API is 1 px larger than the one reported by the TEXTMETRIC structure causing some dialogs like the bookmark editor to display much larger than that with GDI. We now use the average character width from the TEXTMETRIC structure while reporting back the metrics for DirectWrite fonts. Longer term fix is to find out a way to calculate this from DirectWrite. Does not appear to be straigthforward. Added a TODO to that effect in the code. BUG=434588 TEST=Updated the PlatformFontWinTest.Metrics_SkiaVersusGDI test to validate the average character widths. For manual test, launch Chrome and open the bookmark editor on Windows 7+. Observe that the window size is larger than the window size when using GDI for fonts. Committed: https://crrev.com/0852634071b072ab41e1b255075652cf4c29a0df Cr-Commit-Position: refs/heads/master@{#313801}

Patch Set 1 #

Patch Set 2 : Fixed comment #

Total comments: 2

Patch Set 3 : Fixed comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -4 lines) Patch
M ui/gfx/platform_font_win.cc View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M ui/gfx/platform_font_win_unittest.cc View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
ananta
5 years, 11 months ago (2015-01-27 01:51:03 UTC) #2
Alexei Svitkine (slow)
"Currently we fetch the average character width from the GetTextExtentPoint32 API for DirectWrite as skia ...
5 years, 11 months ago (2015-01-27 20:10:55 UTC) #3
ananta
On 2015/01/27 20:10:55, Alexei Svitkine wrote: > "Currently we fetch the average character width from ...
5 years, 11 months ago (2015-01-27 20:42:54 UTC) #4
Alexei Svitkine (slow)
lgtm https://codereview.chromium.org/875303003/diff/20001/ui/gfx/platform_font_win.cc File ui/gfx/platform_font_win.cc (right): https://codereview.chromium.org/875303003/diff/20001/ui/gfx/platform_font_win.cc#newcode513 ui/gfx/platform_font_win.cc:513: // TODO(ananta) Nit: Usually, there's a : after ...
5 years, 10 months ago (2015-01-29 20:52:10 UTC) #5
ananta
https://codereview.chromium.org/875303003/diff/20001/ui/gfx/platform_font_win.cc File ui/gfx/platform_font_win.cc (right): https://codereview.chromium.org/875303003/diff/20001/ui/gfx/platform_font_win.cc#newcode513 ui/gfx/platform_font_win.cc:513: // TODO(ananta) On 2015/01/29 20:52:10, Alexei Svitkine wrote: > ...
5 years, 10 months ago (2015-01-29 21:04:59 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/875303003/40001
5 years, 10 months ago (2015-01-29 21:13:14 UTC) #8
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 10 months ago (2015-01-29 22:00:50 UTC) #9
commit-bot: I haz the power
5 years, 10 months ago (2015-01-29 22:02:26 UTC) #10
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/0852634071b072ab41e1b255075652cf4c29a0df
Cr-Commit-Position: refs/heads/master@{#313801}

Powered by Google App Engine
This is Rietveld 408576698