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

Issue 924543004: adding baseline options for super/sub scripting (Closed)

Created:
5 years, 10 months ago by dschuyler
Modified:
5 years, 9 months ago
Reviewers:
msw, Jun Mukai, dgrogan
CC:
chromium-reviews, groby-ooo-7-16, Peter Kasting
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

adding baseline options for super/sub scripting This change list adds four options for a smaller font to be used as a style within the render text. Option Example ------ ------- SUPERSCRIPT a mathematical exponent would be superscript SUPERIOR 8th, the "th" would be superior script INFERIOR 1/2, the "2" would be inferior ("1" is superior) SUBSCRIPT H2O, the "2" would be subscript Some imagination is needed to interpret the examples above. To see a clearer references to what is meant, this wikipedia article may be helpful: http://en.wikipedia.org/wiki/Subscript_and_superscript These options may be set in the same way options like BOLD and ITALIC can currently be set, e.g. with a call to my_render_text->ApplyStyle(gfx::SUPERSCRIPT, true, gfx::Range(1, 3)); BUG=459812 Committed: https://crrev.com/eefeef59e4b44727e735e99733799a489b8a6efa Cr-Commit-Position: refs/heads/master@{#319492}

Patch Set 1 #

Total comments: 9

Patch Set 2 : Changing baseline styles from bool list to breaklist #

Total comments: 22

Patch Set 3 : restoring baselines after call to SetText #

Patch Set 4 : manual merge to help try bots #

Total comments: 25

Patch Set 5 : Moved RestoreBreakList to file local function #

Total comments: 4

Patch Set 6 : merge update; adding test cases #

Patch Set 7 : changed to ToRoundedInt #

Total comments: 4

Patch Set 8 : added rough bounds checking that is not yet correct #

Total comments: 12

Patch Set 9 : Refined DoesntClip and DoesClip tests #

Total comments: 9

Patch Set 10 : added debug print in test buffer #

Patch Set 11 : changed draw rect test; added bug numbers #

Total comments: 16

Patch Set 12 : removed debug prints; cleaned up comments #

Total comments: 4

Patch Set 13 : Removed failing strings #

Patch Set 14 : Removed another string #

Patch Set 15 : commented out string failing on Mac #

Patch Set 16 : added space test (for Win8 build) #

Total comments: 2

Patch Set 17 : enabling more tests depending on the platform #

Patch Set 18 : unit test adjustment for mac text smoothing #

Total comments: 2

Patch Set 19 : changed ifdef #

Total comments: 6

Patch Set 20 : Adding SCOPED_TRACE #

Patch Set 21 : Change for Win XP unittest #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -2 lines) Patch
M ui/gfx/render_text_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +5 lines, -2 lines 0 comments Download

Messages

Total messages: 55 (10 generated)
dschuyler
5 years, 10 months ago (2015-02-12 23:08:25 UTC) #2
msw
https://codereview.chromium.org/924543004/diff/1/ui/gfx/render_text_harfbuzz.cc File ui/gfx/render_text_harfbuzz.cc (right): https://codereview.chromium.org/924543004/diff/1/ui/gfx/render_text_harfbuzz.cc#newcode1167 ui/gfx/render_text_harfbuzz.cc:1167: // Calculate a slightly smaller font. nit: remove the ...
5 years, 10 months ago (2015-02-17 23:32:06 UTC) #3
dschuyler
Thanks for the feedback. I tried changing the baseline styles to a break list by ...
5 years, 10 months ago (2015-02-18 01:37:27 UTC) #4
msw
https://codereview.chromium.org/924543004/diff/1/ui/gfx/text_constants.h File ui/gfx/text_constants.h (right): https://codereview.chromium.org/924543004/diff/1/ui/gfx/text_constants.h#newcode52 ui/gfx/text_constants.h:52: SUPERSCRIPT, // e.g. a mathematical exponent would be superscript ...
5 years, 10 months ago (2015-02-18 17:07:23 UTC) #5
dschuyler
https://codereview.chromium.org/924543004/diff/20001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/924543004/diff/20001/ui/gfx/render_text.cc#newcode431 ui/gfx/render_text.cc:431: // Adjust ranged styles and colors to accommodate a ...
5 years, 10 months ago (2015-02-18 22:36:03 UTC) #6
msw
Fix up Mac (no-op is probably okay for now), add unit tests, and it would ...
5 years, 10 months ago (2015-02-18 23:32:09 UTC) #7
msw
Also, don't forget to set BUG=
5 years, 10 months ago (2015-02-18 23:32:28 UTC) #8
dschuyler
https://codereview.chromium.org/924543004/diff/60001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/924543004/diff/60001/ui/gfx/render_text.cc#newcode1287 ui/gfx/render_text.cc:1287: void RenderText::RestoreBreakList(RenderText* render_text, On 2015/02/18 23:32:08, msw wrote: > ...
5 years, 10 months ago (2015-02-19 00:29:15 UTC) #9
msw
Let me know when you've fixed Mac, added unit tests, and optionally added a way ...
5 years, 10 months ago (2015-02-19 02:50:57 UTC) #10
Peter Kasting
https://codereview.chromium.org/924543004/diff/60001/ui/gfx/render_text_harfbuzz.cc File ui/gfx/render_text_harfbuzz.cc (right): https://codereview.chromium.org/924543004/diff/60001/ui/gfx/render_text_harfbuzz.cc#newcode1218 ui/gfx/render_text_harfbuzz.cc:1218: run->font_size = round(primary_font.GetFontSize() * ratio); On 2015/02/19 02:50:57, msw ...
5 years, 10 months ago (2015-02-19 07:27:46 UTC) #12
dschuyler
On 2015/02/19 07:27:46, Peter Kasting wrote: > https://codereview.chromium.org/924543004/diff/60001/ui/gfx/render_text_harfbuzz.cc > File ui/gfx/render_text_harfbuzz.cc (right): > > https://codereview.chromium.org/924543004/diff/60001/ui/gfx/render_text_harfbuzz.cc#newcode1218 ...
5 years, 10 months ago (2015-02-19 19:47:11 UTC) #13
msw
On 2015/02/19 19:47:11, dschuyler wrote: > On the unit tests: I'm looking at render_text_unittest.cc and ...
5 years, 10 months ago (2015-02-19 20:27:43 UTC) #14
dschuyler
Hi Mike, I've got some more changes up. There was a delay while I worked ...
5 years, 10 months ago (2015-02-25 02:23:06 UTC) #15
msw
On 2015/02/25 02:23:06, dschuyler wrote: > I have some unit test code added, yet there ...
5 years, 9 months ago (2015-02-25 16:02:33 UTC) #16
dschuyler
Thanks again for looking that over. Ah, the comment on the text width was a ...
5 years, 9 months ago (2015-02-26 02:11:02 UTC) #17
msw
https://codereview.chromium.org/924543004/diff/140001/ui/gfx/render_text_unittest.cc File ui/gfx/render_text_unittest.cc (right): https://codereview.chromium.org/924543004/diff/140001/ui/gfx/render_text_unittest.cc#newcode2569 ui/gfx/render_text_unittest.cc:2569: surface->peekPixels(NULL, NULL)); nit: nullptr https://codereview.chromium.org/924543004/diff/140001/ui/gfx/render_text_unittest.cc#newcode2587 ui/gfx/render_text_unittest.cc:2587: TEST_F(RenderTextTest, TextBaselineStyleDoesntClip) { ...
5 years, 9 months ago (2015-02-26 03:36:54 UTC) #18
dschuyler
While reworking the clip tests, I've removed the test for the vertical pixel column of ...
5 years, 9 months ago (2015-02-26 23:15:56 UTC) #19
msw
On 2015/02/26 23:15:56, dschuyler wrote: > While reworking the clip tests, I've removed the test ...
5 years, 9 months ago (2015-02-27 01:28:19 UTC) #20
dschuyler
https://codereview.chromium.org/924543004/diff/160001/ui/gfx/render_text_unittest.cc File ui/gfx/render_text_unittest.cc (right): https://codereview.chromium.org/924543004/diff/160001/ui/gfx/render_text_unittest.cc#newcode39 ui/gfx/render_text_unittest.cc:39: class TestRectangleBuffer { On 2015/02/27 01:28:19, msw wrote: > ...
5 years, 9 months ago (2015-02-27 03:05:36 UTC) #21
msw
https://codereview.chromium.org/924543004/diff/160001/ui/gfx/render_text_unittest.cc File ui/gfx/render_text_unittest.cc (right): https://codereview.chromium.org/924543004/diff/160001/ui/gfx/render_text_unittest.cc#newcode2623 ui/gfx/render_text_unittest.cc:2623: // ADD(dschuyler): This should be added because without it ...
5 years, 9 months ago (2015-02-27 03:48:06 UTC) #22
dschuyler
https://codereview.chromium.org/924543004/diff/200001/ui/gfx/render_text_harfbuzz.cc File ui/gfx/render_text_harfbuzz.cc (right): https://codereview.chromium.org/924543004/diff/200001/ui/gfx/render_text_harfbuzz.cc#newcode424 ui/gfx/render_text_harfbuzz.cc:424: line->size.set_width(line->size.width() + width); On 2015/02/27 03:48:05, msw wrote: > ...
5 years, 9 months ago (2015-02-27 21:45:20 UTC) #23
msw
lgtm with nits. https://codereview.chromium.org/924543004/diff/200001/ui/gfx/render_text_harfbuzz.cc File ui/gfx/render_text_harfbuzz.cc (right): https://codereview.chromium.org/924543004/diff/200001/ui/gfx/render_text_harfbuzz.cc#newcode424 ui/gfx/render_text_harfbuzz.cc:424: line->size.set_width(line->size.width() + width); On 2015/02/27 21:45:20, ...
5 years, 9 months ago (2015-02-27 22:05:15 UTC) #24
dschuyler
It's looking like the Windows version is drawing some smoothing before (left of) the rectangle. ...
5 years, 9 months ago (2015-02-28 01:04:21 UTC) #25
dschuyler
Hi, this is an invitation to re-LGTM this change list :)
5 years, 9 months ago (2015-03-02 21:50:51 UTC) #27
msw
https://codereview.chromium.org/924543004/diff/300001/ui/gfx/render_text_unittest.cc File ui/gfx/render_text_unittest.cc (right): https://codereview.chromium.org/924543004/diff/300001/ui/gfx/render_text_unittest.cc#newcode2642 ui/gfx/render_text_unittest.cc:2642: L" ", This test now has one case, which ...
5 years, 9 months ago (2015-03-02 23:05:35 UTC) #28
dschuyler
https://codereview.chromium.org/924543004/diff/300001/ui/gfx/render_text_unittest.cc File ui/gfx/render_text_unittest.cc (right): https://codereview.chromium.org/924543004/diff/300001/ui/gfx/render_text_unittest.cc#newcode2642 ui/gfx/render_text_unittest.cc:2642: L" ", On 2015/03/02 23:05:35, msw wrote: > This ...
5 years, 9 months ago (2015-03-03 23:09:29 UTC) #30
msw
I suppose this lgtm with a nit. Ping Jun about the TODOs you're adding for ...
5 years, 9 months ago (2015-03-03 23:18:29 UTC) #31
dschuyler
Hi Jun, In the render_text_unittest.cc, could you give me your thoughts on some TODO entries ...
5 years, 9 months ago (2015-03-04 00:11:26 UTC) #33
dschuyler
https://codereview.chromium.org/924543004/diff/380001/ui/gfx/render_text_unittest.cc File ui/gfx/render_text_unittest.cc (right): https://codereview.chromium.org/924543004/diff/380001/ui/gfx/render_text_unittest.cc#newcode2702 ui/gfx/render_text_unittest.cc:2702: #ifndef OS_MACOSX On 2015/03/03 23:18:28, msw wrote: > nit: ...
5 years, 9 months ago (2015-03-04 00:12:16 UTC) #34
Jun Mukai
https://codereview.chromium.org/924543004/diff/400001/ui/gfx/render_text_unittest.cc File ui/gfx/render_text_unittest.cc (right): https://codereview.chromium.org/924543004/diff/400001/ui/gfx/render_text_unittest.cc#newcode2664 ui/gfx/render_text_unittest.cc:2664: for (auto string : kTestStrings) { nit: add SCOPED_TRACE ...
5 years, 9 months ago (2015-03-05 22:32:45 UTC) #35
dschuyler
https://codereview.chromium.org/924543004/diff/400001/ui/gfx/render_text_unittest.cc File ui/gfx/render_text_unittest.cc (right): https://codereview.chromium.org/924543004/diff/400001/ui/gfx/render_text_unittest.cc#newcode2664 ui/gfx/render_text_unittest.cc:2664: for (auto string : kTestStrings) { On 2015/03/05 22:32:45, ...
5 years, 9 months ago (2015-03-05 23:19:41 UTC) #36
Jun Mukai
https://codereview.chromium.org/924543004/diff/400001/ui/gfx/render_text_unittest.cc File ui/gfx/render_text_unittest.cc (right): https://codereview.chromium.org/924543004/diff/400001/ui/gfx/render_text_unittest.cc#newcode2664 ui/gfx/render_text_unittest.cc:2664: for (auto string : kTestStrings) { On 2015/03/05 23:19:41, ...
5 years, 9 months ago (2015-03-06 03:02:25 UTC) #37
dschuyler
https://codereview.chromium.org/924543004/diff/400001/ui/gfx/render_text_unittest.cc File ui/gfx/render_text_unittest.cc (right): https://codereview.chromium.org/924543004/diff/400001/ui/gfx/render_text_unittest.cc#newcode2664 ui/gfx/render_text_unittest.cc:2664: for (auto string : kTestStrings) { On 2015/03/05 22:32:45, ...
5 years, 9 months ago (2015-03-06 20:31:57 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/924543004/420001
5 years, 9 months ago (2015-03-06 20:34:43 UTC) #43
commit-bot: I haz the power
Committed patchset #20 (id:420001)
5 years, 9 months ago (2015-03-06 20:40:52 UTC) #44
commit-bot: I haz the power
Patchset 20 (id:??) landed as https://crrev.com/eefeef59e4b44727e735e99733799a489b8a6efa Cr-Commit-Position: refs/heads/master@{#319492}
5 years, 9 months ago (2015-03-06 20:41:39 UTC) #45
dgrogan
Failure on XP: http://build.chromium.org/p/chromium.win/builders/XP%20Tests%20(1)/builds/36109/steps/gfx_unittests/logs/RenderTextTest.TextDoesntClip Many variants of c:\b\build\slave\win_builder\build\src\ui\gfx\render_text_unittest.cc(194): error: Value of: color Actual: 4278190080 Expected: ...
5 years, 9 months ago (2015-03-07 00:28:53 UTC) #47
msw
On 2015/03/07 00:28:53, dgrogan wrote: > Failure on XP: > > http://build.chromium.org/p/chromium.win/builders/XP%20Tests%20(1)/builds/36109/steps/gfx_unittests/logs/RenderTextTest.TextDoesntClip > > Many ...
5 years, 9 months ago (2015-03-07 00:34:39 UTC) #48
dschuyler
On 2015/03/07 00:34:39, msw wrote: > On 2015/03/07 00:28:53, dgrogan wrote: > > Failure on ...
5 years, 9 months ago (2015-03-07 00:42:34 UTC) #49
dschuyler
A revert of this CL (patchset #20 id:420001) has been created in https://codereview.chromium.org/985923002/ by dschuyler@chromium.org. ...
5 years, 9 months ago (2015-03-07 00:44:52 UTC) #50
chromium-reviews
I found this try bot entry for XP: win_chromium_xp_rel_ng That is green with the change ...
5 years, 9 months ago (2015-03-07 01:24:26 UTC) #51
dgrogan
Hm, there's also a ChromeOS failure: https://build.chromium.org/p/chromium.memory/builders/Linux%20Chromium%20OS%20ASan%20LSan%20Tests%20%281%29/builds/7266/steps/gfx_unittests/logs/RenderTextTest.TextDoesntClip RenderTextTest.TextDoesntClip (run #1): [ RUN ] RenderTextTest.TextDoesntClip ../../ui/gfx/render_text_unittest.cc:194: ...
5 years, 9 months ago (2015-03-07 01:27:43 UTC) #52
chromium-reviews
It sounds like I'm not using the correct try bots... Is there a better way ...
5 years, 9 months ago (2015-03-07 01:32:24 UTC) #53
Jun Mukai
Please do not ignore my comments... https://codereview.chromium.org/924543004/diff/400001/ui/gfx/render_text_unittest.cc File ui/gfx/render_text_unittest.cc (right): https://codereview.chromium.org/924543004/diff/400001/ui/gfx/render_text_unittest.cc#newcode2664 ui/gfx/render_text_unittest.cc:2664: for (auto string ...
5 years, 9 months ago (2015-03-07 02:22:45 UTC) #54
chromium-reviews
5 years, 9 months ago (2015-03-07 02:27:15 UTC) #55
Message was sent while issue was closed.
The scoped string is printed out.  I'm confused by the goal.  If I add that
line, the string will be printed twice for each error.

I took your comment to be explaining the intent of the minimum to be done,
and since the change was including more information, a super-set, that
would be acceptable.

On Fri, Mar 6, 2015 at 6:22 PM, <mukai@chromium.org> wrote:

> Please do not ignore my comments...
>
>
> https://codereview.chromium.org/924543004/diff/400001/ui/
> gfx/render_text_unittest.cc
> File ui/gfx/render_text_unittest.cc (right):
>
> https://codereview.chromium.org/924543004/diff/400001/ui/
> gfx/render_text_unittest.cc#newcode2664
> ui/gfx/render_text_unittest.cc:2664: for (auto string : kTestStrings) {
> On 2015/03/06 20:31:56, dschuyler wrote:
>
>> On 2015/03/05 22:32:45, Jun Mukai wrote:
>> > nit: add SCOPED_TRACE to reveal which test case fails.
>>
>
>  Done.
>>
>
> I don't believe you've done what I meant.
>
> I meant:
> for (auto string : kTestStrings) {
>   SCOPED_TRACE(string);
>   ...
>
> }
>
> That way, the failed string is printed out.
>
> https://codereview.chromium.org/924543004/
>

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698