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

Issue 19734003: Fixes vertical alignment of RenderTextWin. (Closed)

Created:
7 years, 5 months ago by Yuki
Modified:
7 years, 5 months ago
CC:
chromium-reviews, Alexei Svitkine (slow), ckocagil
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Fixes vertical alignment of RenderTextWin. I don't see the same issue of crbug.com/244323 on Windows so far, but theoretically this CL fixes the same possible issue on Windows. By the way, this CL is effective for the case that some of fonts are unexpectedly smaller than the default font. Not effective for the case that some of fonts are unexpectedly larger than the default font. So, this CL doesn't fix crbug.com/146236 . BUG=244323 TEST=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=213383

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -6 lines) Patch
M ui/gfx/render_text_win.cc View 3 chunks +9 lines, -6 lines 6 comments Download

Messages

Total messages: 8 (0 generated)
Yuki
Could you review this CL? For the issue 146236, we need another fix. I found ...
7 years, 5 months ago (2013-07-22 15:01:15 UTC) #1
msw
I can repro http://crbug.com/244323 on Windows ToT using the EN-US Windows Classic Theme, which uses ...
7 years, 5 months ago (2013-07-23 23:43:29 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yukishiino@chromium.org/19734003/1
7 years, 5 months ago (2013-07-24 07:22:16 UTC) #3
commit-bot: I haz the power
Change committed as 213383
7 years, 5 months ago (2013-07-24 10:13:06 UTC) #4
Alexei Svitkine (slow)
This could also use some tests. https://chromiumcodereview.appspot.com/19734003/diff/1/ui/gfx/render_text_win.cc File ui/gfx/render_text_win.cc (right): https://chromiumcodereview.appspot.com/19734003/diff/1/ui/gfx/render_text_win.cc#newcode492 ui/gfx/render_text_win.cc:492: common_baseline_ = font_list().GetBaseline(); ...
7 years, 5 months ago (2013-07-24 15:29:48 UTC) #5
msw
Agreed, tests would be nice; Yuki, could you oblige, and also consider Alexei's comment w.r.t. ...
7 years, 5 months ago (2013-07-24 18:02:36 UTC) #6
Alexei Svitkine (slow)
https://chromiumcodereview.appspot.com/19734003/diff/1/ui/gfx/render_text_win.cc File ui/gfx/render_text_win.cc (right): https://chromiumcodereview.appspot.com/19734003/diff/1/ui/gfx/render_text_win.cc#newcode568 ui/gfx/render_text_win.cc:568: int descent = font_list().GetHeight() - font_list().GetBaseline(); On 2013/07/24 18:02:36, ...
7 years, 5 months ago (2013-07-24 18:12:28 UTC) #7
Yuki
7 years, 5 months ago (2013-07-25 14:32:40 UTC) #8
Message was sent while issue was closed.
I've send out http://crrev.com/20287002
Could you review that CL?

https://codereview.chromium.org/19734003/diff/1/ui/gfx/render_text_win.cc
File ui/gfx/render_text_win.cc (right):

https://codereview.chromium.org/19734003/diff/1/ui/gfx/render_text_win.cc#new...
ui/gfx/render_text_win.cc:492: common_baseline_ = font_list().GetBaseline();
On 2013/07/24 15:29:48, Alexei Svitkine wrote:
> This value will be clobbered unless the text is empty, so your CL is changing
> the behaviour of GetBaseline() for when there is no text.
> 
> Which isn't necessarily bad, but we should have clear expectations for how
that
> works and accompanying tests.

Done.

https://codereview.chromium.org/19734003/diff/1/ui/gfx/render_text_win.cc#new...
ui/gfx/render_text_win.cc:568: int descent = font_list().GetHeight() -
font_list().GetBaseline();
On 2013/07/24 18:12:28, Alexei Svitkine wrote:
> On 2013/07/24 18:02:36, msw wrote:
> > On 2013/07/24 15:29:48, Alexei Svitkine wrote:
> > > I'm not sure it makes sense to start with the metrics of the font_list,
> after
> > > all - none of the fonts in it may end up actually being used by the string
> due
> > > to fallback.
> > > 
> > > Why not just use the fonts of the runs?
> > 
> > Using just the fonts of the runs and not including the selected 'primary'
font
> > is the bug. If you enter a character that uses a fallback font with a
smaller
> > baseline/height, then enter a character that uses the primary font with a
> larger
> > baseline/height, it will shift the baseline. Granted, there are still other
> > related defects, since new fallback fonts can arrive on any keystroke; I'm
not
> > sure how we'll fix that, but we should try, and this seems like a reasonable
> > step forward (always support the baseline/height of the primary font).
> 
> Ah, I understand now. Thanks for the explanation - I think the code should
have
> a comment that also mentions this too (in addition to tests).

Done.

Powered by Google App Engine
This is Rietveld 408576698