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

Issue 8575020: Improve RenderTextWin font fallback. (Closed)

Created:
9 years, 1 month ago by Alexei Svitkine (slow)
Modified:
9 years ago
Reviewers:
msw, sky, xji
CC:
chromium-reviews, yusukes+watch_chromium.org, penghuang+watch_chromium.org, Paweł Hajdan Jr., James Su, dhollowa, tfarina
Visibility:
Public.

Description

Improve RenderTextWin font fallback. Don't use SCRIPT_UNDEFINED in the case of font fallback, unless font fallback actually fails to return a script that can display the characters. This fixes the problem of some scripts not being properly displayed. This actually makes RenderTextWin properly validate whether a text position accepts a cursor, which caused several tests to fail and revealed some additional issues in RenderTextWin. The CL includes some modifications to address this. Some tests are disabled under XP, see: http://crbug.com/106450 Also, fixes some lint warnings. BUG=90426 TEST=Run chrome.exe --use-pure-views and paste some Bengali text into the omnibox. It should show up properly. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=113635

Patch Set 1 : '' #

Patch Set 2 : '' #

Patch Set 3 : sync #

Total comments: 6

Patch Set 4 : Improve RenderTextWin font fallback. #

Total comments: 4

Patch Set 5 : '' #

Total comments: 6

Patch Set 6 : '' #

Total comments: 13

Patch Set 7 : '' #

Patch Set 8 : '' #

Total comments: 4

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : '' #

Patch Set 12 : Disabling more under XP. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+253 lines, -74 lines) Patch
M ui/gfx/render_text.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +8 lines, -0 lines 0 comments Download
M ui/gfx/render_text.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +7 lines, -8 lines 0 comments Download
M ui/gfx/render_text_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M ui/gfx/render_text_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +117 lines, -0 lines 0 comments Download
M ui/gfx/render_text_win.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +71 lines, -23 lines 0 comments Download
M ui/views/controls/textfield/textfield_views_model_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +48 lines, -43 lines 0 comments Download

Messages

Total messages: 49 (0 generated)
Alexei Svitkine (slow)
msw: review sky: OWNERS review
9 years ago (2011-11-21 20:08:02 UTC) #1
tfarina
On 2011/11/21 20:08:02, Alexei Svitkine wrote: > msw: review > sky: OWNERS review Looks like ...
9 years ago (2011-11-22 00:33:18 UTC) #2
Alexei Svitkine (slow)
On 2011/11/22 00:33:18, tfarina wrote: > On 2011/11/21 20:08:02, Alexei Svitkine wrote: > > msw: ...
9 years ago (2011-11-22 02:04:14 UTC) #3
msw
It would be best if xji could review the IsCursorablePosition change, etc. I'll take a ...
9 years ago (2011-11-22 06:07:27 UTC) #4
Alexei Svitkine (slow)
Ping.
9 years ago (2011-11-29 16:00:53 UTC) #5
msw
Sorry for my questions; BiDi specifics can confuse even those that wrote the code :) ...
9 years ago (2011-11-29 20:41:59 UTC) #6
xji
I did not look at RenderTextWin part. http://codereview.chromium.org/8575020/diff/16001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): http://codereview.chromium.org/8575020/diff/16001/ui/gfx/render_text.cc#newcode212 ui/gfx/render_text.cc:212: (sel.caret_placement() == ...
9 years ago (2011-11-29 21:15:48 UTC) #7
Alexei Svitkine (slow)
> For example: > ABC, "BC" belongs to one grapheme, > cursorable positions are |ABC, ...
9 years ago (2011-11-29 22:09:21 UTC) #8
xji
On 2011/11/29 22:09:21, Alexei Svitkine wrote: > > For example: > > ABC,  "BC" belongs ...
9 years ago (2011-11-29 23:51:56 UTC) #9
Alexei Svitkine (slow)
> IsCursorablePosition() is doing the right thing, instead of changing its > behavior, you need ...
9 years ago (2011-11-30 15:47:41 UTC) #10
Alexei Svitkine (slow)
I guess my question just boils down to, given that Hindi string, what is the ...
9 years ago (2011-11-30 15:52:33 UTC) #11
xji
On 2011/11/30 15:52:33, Alexei Svitkine wrote: > I guess my question just boils down to, ...
9 years ago (2011-11-30 18:22:49 UTC) #12
xji
On 2011/11/30 15:47:41, Alexei Svitkine wrote: > > IsCursorablePosition() is doing the right thing, instead ...
9 years ago (2011-11-30 18:25:46 UTC) #13
Alexei Svitkine (slow)
On Wed, Nov 30, 2011 at 1:25 PM, <xji@chromium.org> wrote: > On 2011/11/30 15:47:41, Alexei ...
9 years ago (2011-11-30 18:40:03 UTC) #14
Alexei Svitkine (slow)
PTAL. There were problems in RenderTextWin's RightEndSelectionModel() and IndexOfAdjacentGrapheme() functions that were responsible for the ...
9 years ago (2011-11-30 21:12:42 UTC) #15
msw
LGTM with some additional comments and one nit. You are awesome for resolving this complicated ...
9 years ago (2011-11-30 21:37:33 UTC) #16
msw
Oh, also, please update the CL description.
9 years ago (2011-11-30 21:38:26 UTC) #17
msw
Doh, nvm, it contains the right info.
9 years ago (2011-11-30 21:38:49 UTC) #18
sky
Rubber stamp LGTM
9 years ago (2011-11-30 21:54:59 UTC) #19
xji
http://codereview.chromium.org/8575020/diff/31001/ui/gfx/render_text_win.cc File ui/gfx/render_text_win.cc (right): http://codereview.chromium.org/8575020/diff/31001/ui/gfx/render_text_win.cc#newcode478 ui/gfx/render_text_win.cc:478: index = IndexOfAdjacentGrapheme(last, false); is the reason of this ...
9 years ago (2011-12-01 08:31:57 UTC) #20
Alexei Svitkine (slow)
Please take another look. I've added unit tests for both IndexOfAdjacentGrapheme() and LeftEndSelectionModel()/RightEndSelectionModel() and fixed ...
9 years ago (2011-12-01 18:17:23 UTC) #21
xji
http://codereview.chromium.org/8575020/diff/37001/ui/gfx/render_text_linux.cc File ui/gfx/render_text_linux.cc (right): http://codereview.chromium.org/8575020/diff/37001/ui/gfx/render_text_linux.cc#newcode288 ui/gfx/render_text_linux.cc:288: return text().length(); Thanks for fixing this. Without the fix, ...
9 years ago (2011-12-01 20:19:14 UTC) #22
Alexei Svitkine (slow)
http://codereview.chromium.org/8575020/diff/37001/ui/gfx/render_text_linux.cc File ui/gfx/render_text_linux.cc (right): http://codereview.chromium.org/8575020/diff/37001/ui/gfx/render_text_linux.cc#newcode288 ui/gfx/render_text_linux.cc:288: return text().length(); On 2011/12/01 20:19:15, xji wrote: > Thanks ...
9 years ago (2011-12-01 20:58:58 UTC) #23
xji
http://codereview.chromium.org/8575020/diff/37001/ui/gfx/render_text_win.cc File ui/gfx/render_text_win.cc (right): http://codereview.chromium.org/8575020/diff/37001/ui/gfx/render_text_win.cc#newcode513 ui/gfx/render_text_win.cc:513: while (ch > 0 && run->logical_clusters[ch - 1] == ...
9 years ago (2011-12-01 22:56:06 UTC) #24
Alexei Svitkine (slow)
On 2011/12/01 22:56:06, xji wrote: > http://codereview.chromium.org/8575020/diff/37001/ui/gfx/render_text_win.cc > File ui/gfx/render_text_win.cc (right): > > http://codereview.chromium.org/8575020/diff/37001/ui/gfx/render_text_win.cc#newcode513 > ...
9 years ago (2011-12-01 22:59:06 UTC) #25
Alexei Svitkine (slow)
> > Then, why line 507 is "else if" instead of "else"? > > Because ...
9 years ago (2011-12-01 23:01:40 UTC) #26
Alexei Svitkine (slow)
On Thu, Dec 1, 2011 at 6:01 PM, <asvitkine@chromium.org> wrote: >> > Then, why line ...
9 years ago (2011-12-01 23:09:32 UTC) #27
Alexei Svitkine (slow)
I've simplified the code per our discussion; I was also able to get rid of ...
9 years ago (2011-12-02 14:40:28 UTC) #28
xji
On 2011/12/02 14:40:28, Alexei Svitkine wrote: > I've simplified the code per our discussion; I ...
9 years ago (2011-12-02 18:09:19 UTC) #29
msw
LGTM with nits. Thanks! http://codereview.chromium.org/8575020/diff/36007/ui/gfx/render_text_unittest.cc File ui/gfx/render_text_unittest.cc (right): http://codereview.chromium.org/8575020/diff/36007/ui/gfx/render_text_unittest.cc#newcode547 ui/gfx/render_text_unittest.cc:547: scoped_ptr<RenderText> render_text(RenderText::CreateRenderText()); Move this down ...
9 years ago (2011-12-03 00:03:58 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/asvitkine@chromium.org/8575020/45001
9 years ago (2011-12-05 14:43:43 UTC) #31
commit-bot: I haz the power
Change committed as 112983
9 years ago (2011-12-05 16:11:27 UTC) #32
Alexei Svitkine (slow)
On 2011/12/05 16:11:27, I haz the power (commit-bot) wrote: > Change committed as 112983 Sigh. ...
9 years ago (2011-12-05 18:21:53 UTC) #33
xji
On 2011/12/05 18:21:53, Alexei Svitkine wrote: > On 2011/12/05 16:11:27, I haz the power (commit-bot) ...
9 years ago (2011-12-05 18:35:22 UTC) #34
msw
Please file a bug and leave a comment if you disable the test on XP. ...
9 years ago (2011-12-05 18:44:29 UTC) #35
Alexei Svitkine (slow)
So, some more info: SelectionModels also fails under XP in the same way as GraphemeBoundaries. ...
9 years ago (2011-12-05 20:03:38 UTC) #36
msw
On 2011/12/05 20:03:38, Alexei Svitkine wrote: > So, some more info: > > SelectionModels also ...
9 years ago (2011-12-05 20:18:53 UTC) #37
Alexei Svitkine (slow)
> Please only reset hr when it equals USP_E_SCRIPT_NOT_IN_FONT, and add a comment > there ...
9 years ago (2011-12-05 20:54:20 UTC) #38
msw
LGTM, thanks for being thorough!
9 years ago (2011-12-05 21:02:37 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/asvitkine@chromium.org/8575020/53002
9 years ago (2011-12-05 21:11:46 UTC) #40
xji
On 2011/12/05 21:02:37, msw wrote: > LGTM, thanks for being thorough! LGTM. Thanks for carrying ...
9 years ago (2011-12-05 21:17:43 UTC) #41
commit-bot: I haz the power
Change committed as 113075
9 years ago (2011-12-06 00:32:34 UTC) #42
Alexei Svitkine (slow)
On 2011/12/06 00:32:34, I haz the power (commit-bot) wrote: > Change committed as 113075 And ...
9 years ago (2011-12-06 02:00:55 UTC) #43
msw
Bummer, sorry you've had a rough time with that. Perhaps delay landing until after the ...
9 years ago (2011-12-06 02:12:17 UTC) #44
msw
On 2011/12/06 02:12:17, msw wrote: > Bummer, sorry you've had a rough time with that. ...
9 years ago (2011-12-06 02:12:47 UTC) #45
Alexei Svitkine (slow)
> PS, those links are broken for me. Looks like a Rietveld bug, I've filed ...
9 years ago (2011-12-06 16:04:42 UTC) #46
Alexei Svitkine (slow)
Updated CL disabled both RenderTextTest.GraphemePositions and RenderTextTest.SelectionModels on XP and disabled another check in TextfieldViewsModelTest.EditString_ComplexScript ...
9 years ago (2011-12-06 16:19:26 UTC) #47
msw
That's a shame, but I think we're out of options besides disabling for now. We ...
9 years ago (2011-12-06 18:07:59 UTC) #48
xji
9 years ago (2011-12-06 19:05:43 UTC) #49
LGTM. Sorry to hear the trouble...

Powered by Google App Engine
This is Rietveld 408576698