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

Issue 23684041: improve bitmap font support (FreeType only) (Closed)

Created:
7 years, 3 months ago by violets
Modified:
7 years ago
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

improve bitmap font support (FreeType only) This commit improves SkFontHost_FreeType's support for bitmap fonts, adding a number of features: - Intelligent bitmap strike selection. - Inter-strike bitmap font scaling. - Colour bitmap font support (FreeType 2.5.0+). BUG= R=reed@google.com Committed: https://code.google.com/p/skia/source/detail?r=12607

Patch Set 1 #

Patch Set 2 : added test fonts #

Patch Set 3 : disable linear text for bitmap fonts #

Patch Set 4 : bring metrics within one pixel of original values, fix linear text + bitmap font #

Patch Set 5 : bring metrics in line with previous values #

Patch Set 6 : match pre-refactor ascent/descent/leading exactly #

Patch Set 7 : no really this time #

Patch Set 8 : filter scaled glyph images #

Total comments: 3

Patch Set 9 : fix silly transcription error #

Total comments: 18

Patch Set 10 : reduce indentation #

Total comments: 1

Patch Set 11 : a round of type-specificity... #

Total comments: 4

Patch Set 12 : Rebase against current; build with older FreeTypes. #

Total comments: 2

Patch Set 13 : Can resize. #

Patch Set 14 : #

Total comments: 5

Patch Set 15 : Correct selection logic, remove debug code. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+588 lines, -217 lines) Patch
gm/coloremoji.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -1 line 1 comment Download
M src/ports/SkFontConfigInterface_direct.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M src/ports/SkFontHost_FreeType.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 13 chunks +223 lines, -105 lines 0 comments Download
M src/ports/SkFontHost_FreeType_common.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 7 chunks +363 lines, -111 lines 0 comments Download

Messages

Total messages: 59 (0 generated)
djsollen
+reed as bungeman is out of the office.
7 years, 3 months ago (2013-09-10 16:14:50 UTC) #1
reed1
We (skia) definitely needs some test font(s) added, so we can always exercise/test this new ...
7 years, 3 months ago (2013-09-10 17:45:50 UTC) #2
violets
On 2013/09/10 17:45:50, reed1 wrote: > We (skia) definitely needs some test font(s) added, so ...
7 years, 3 months ago (2013-09-10 17:47:37 UTC) #3
reed1
the tools look in resources/ for other assets (e.g. images), so that would be my ...
7 years, 3 months ago (2013-09-10 17:48:55 UTC) #4
reed1
We'll want to augment the tests also to load from there, so we can access ...
7 years, 3 months ago (2013-09-10 17:49:26 UTC) #5
violets
On 2013/09/10 17:49:26, reed1 wrote: > We'll want to augment the tests also to load ...
7 years, 3 months ago (2013-09-10 18:25:57 UTC) #6
behdad_google
On 2013/09/10 18:25:57, violets wrote: > On 2013/09/10 17:49:26, reed1 wrote: > > We'll want ...
7 years, 3 months ago (2013-09-10 18:35:10 UTC) #7
reed1
The tree has been red all day today, so we will have to run the ...
7 years, 3 months ago (2013-09-11 19:05:56 UTC) #8
violets
On 2013/09/11 19:05:56, reed1 wrote: > The tree has been red all day today, so ...
7 years, 3 months ago (2013-09-11 20:10:00 UTC) #9
bungeman-skia
I ran patch set 2 against the layout test bots. This can be done by ...
7 years, 3 months ago (2013-09-11 20:10:55 UTC) #10
violets
On 2013/09/11 20:10:55, bungeman1 wrote: > I ran patch set 2 against the layout test ...
7 years, 3 months ago (2013-09-11 20:14:28 UTC) #11
bungeman-skia
On 2013/09/11 20:14:28, violets wrote: > On 2013/09/11 20:10:55, bungeman1 wrote: > > I ran ...
7 years, 3 months ago (2013-09-11 20:27:45 UTC) #12
violets
FreeType only reports linear text advances for outline fonts, so it was necessary to pull ...
7 years, 3 months ago (2013-09-13 00:15:23 UTC) #13
violets
OK, this is ready for review now. I've meticulously compared metrics against previous values and ...
7 years, 3 months ago (2013-09-13 02:34:23 UTC) #14
reed1
We should land the fonts and (new) tests that actually exercise them before we land ...
7 years, 3 months ago (2013-09-13 16:07:01 UTC) #15
bungeman-skia
With patch set 5 the metrics are now somewhat smaller than they used to be. ...
7 years, 3 months ago (2013-09-13 16:17:32 UTC) #16
violets
On 2013/09/13 16:17:32, bungeman1 wrote: > With patch set 5 the metrics are now somewhat ...
7 years, 3 months ago (2013-09-13 16:38:49 UTC) #17
bungeman-skia
On 2013/09/13 16:38:49, violets wrote: > On 2013/09/13 16:17:32, bungeman1 wrote: > > With patch ...
7 years, 3 months ago (2013-09-13 16:53:29 UTC) #18
violets
On 2013/09/13 16:53:29, bungeman1 wrote: > On 2013/09/13 16:38:49, violets wrote: > > On 2013/09/13 ...
7 years, 3 months ago (2013-09-13 17:31:12 UTC) #19
violets
OK, patch set 6 splits ascent/descent/leading metrics calculation back into separate paths for outline/bitmap fonts. ...
7 years, 3 months ago (2013-09-13 20:40:46 UTC) #20
violets
I also simplified the fDoLinearMetrics solution while I was at it.
7 years, 3 months ago (2013-09-13 20:41:24 UTC) #21
violets
On 2013/09/13 20:41:24, violets wrote: > I also simplified the fDoLinearMetrics solution while I was ...
7 years, 3 months ago (2013-09-16 20:37:21 UTC) #22
violets
On 2013/09/16 20:37:21, violets wrote: > On 2013/09/13 20:41:24, violets wrote: > > I also ...
7 years, 3 months ago (2013-09-16 23:48:13 UTC) #23
Xianzhu
Thanks violets@ for upstreaming the change and bungeman@ for examining the layout test results. What ...
7 years, 2 months ago (2013-10-08 18:51:30 UTC) #24
violets
On 2013/10/08 18:51:30, Xianzhu wrote: > Thanks violets@ for upstreaming the change and bungeman@ for ...
7 years, 2 months ago (2013-10-08 21:16:10 UTC) #25
Xianzhu
Just tried the latest patch locally on Linux. The result is same as what bungeman@ ...
7 years, 1 month ago (2013-11-05 00:31:40 UTC) #26
Xianzhu
FYI, skia log (with #define DEBUG_METRICS) when testing fast/text/word-break.html: [10348:10348:1104/165533:1471062214793:INFO:SkFontHost_FreeType.cpp(1305)] post-scale glyph metrics: [10348:10348:1104/165533:1471062215018:INFO:SkFontHost_FreeType.cpp(801)] fAdvanceX: ...
7 years, 1 month ago (2013-11-05 01:02:17 UTC) #27
Xianzhu
https://codereview.chromium.org/23684041/diff/40001/src/ports/SkFontHost_FreeType.cpp File src/ports/SkFontHost_FreeType.cpp (right): https://codereview.chromium.org/23684041/diff/40001/src/ports/SkFontHost_FreeType.cpp#newcode1508 src/ports/SkFontHost_FreeType.cpp:1508: leading = SkIntToScalar(face->height / upem + (face->descender - face->ascender)) ...
7 years, 1 month ago (2013-11-05 18:54:43 UTC) #28
Xianzhu
https://codereview.chromium.org/23684041/diff/40001/src/ports/SkFontHost_FreeType.cpp File src/ports/SkFontHost_FreeType.cpp (right): https://codereview.chromium.org/23684041/diff/40001/src/ports/SkFontHost_FreeType.cpp#newcode1508 src/ports/SkFontHost_FreeType.cpp:1508: leading = SkIntToScalar(face->height / upem + (face->descender - face->ascender)) ...
7 years, 1 month ago (2013-11-05 18:58:37 UTC) #29
reed1
https://codereview.chromium.org/23684041/diff/40001/src/ports/SkFontHost_FreeType.cpp File src/ports/SkFontHost_FreeType.cpp (right): https://codereview.chromium.org/23684041/diff/40001/src/ports/SkFontHost_FreeType.cpp#newcode1508 src/ports/SkFontHost_FreeType.cpp:1508: leading = SkIntToScalar(face->height / upem + (face->descender - face->ascender)) ...
7 years, 1 month ago (2013-11-05 19:00:48 UTC) #30
Xianzhu
All layout tests passed with the line changed to #29/#30 version. violets@ could you upload ...
7 years, 1 month ago (2013-11-05 19:23:09 UTC) #31
violets
On 2013/11/05 19:23:09, Xianzhu wrote: > All layout tests passed with the line changed to ...
7 years, 1 month ago (2013-11-05 20:09:08 UTC) #32
reed1
On 2013/11/05 19:23:09, Xianzhu wrote: > All layout tests passed with the line changed to ...
7 years, 1 month ago (2013-11-05 20:23:12 UTC) #33
Xianzhu
On 2013/11/05 20:23:12, reed1 wrote: > Which proposed change did you test? #29 or #30 ...
7 years, 1 month ago (2013-11-05 20:26:19 UTC) #34
reed1
On 2013/11/05 20:26:19, Xianzhu wrote: > On 2013/11/05 20:23:12, reed1 wrote: > > Which proposed ...
7 years, 1 month ago (2013-11-05 20:29:55 UTC) #35
violets
Oh gosh, this is embarrassing. I went to test the proposed change in the Android ...
7 years, 1 month ago (2013-11-06 18:05:53 UTC) #36
Xianzhu
Thanks violets@ for the new patch. reed@ and bungeman@, could you review the new patch? ...
7 years, 1 month ago (2013-11-13 20:08:00 UTC) #37
reed1
can we try the trybots again? https://codereview.chromium.org/23684041/diff/359001/src/ports/SkFontHost_FreeType.cpp File src/ports/SkFontHost_FreeType.cpp (right): https://codereview.chromium.org/23684041/diff/359001/src/ports/SkFontHost_FreeType.cpp#newcode1162 src/ports/SkFontHost_FreeType.cpp:1162: glyph.fWidth = SkToU16(SkScalarRoundToInt(SkScalarMul(SkIntToScalar(glyph.fWidth), ...
7 years, 1 month ago (2013-11-13 20:21:45 UTC) #38
bungeman-skia
On 2013/11/13 20:21:45, reed1 wrote: > can we try the trybots again? > I used ...
7 years, 1 month ago (2013-11-14 21:52:00 UTC) #39
bungeman-skia
https://codereview.chromium.org/23684041/diff/359001/src/ports/SkFontHost_FreeType_common.cpp File src/ports/SkFontHost_FreeType_common.cpp (right): https://codereview.chromium.org/23684041/diff/359001/src/ports/SkFontHost_FreeType_common.cpp#newcode248 src/ports/SkFontHost_FreeType_common.cpp:248: { This introduces an unnecessary amount of indentation which ...
7 years, 1 month ago (2013-11-15 00:19:48 UTC) #40
violets
On 2013/11/15 00:19:48, bungeman1 wrote: > https://codereview.chromium.org/23684041/diff/359001/src/ports/SkFontHost_FreeType_common.cpp > File src/ports/SkFontHost_FreeType_common.cpp (right): > > https://codereview.chromium.org/23684041/diff/359001/src/ports/SkFontHost_FreeType_common.cpp#newcode248 > ...
7 years, 1 month ago (2013-11-15 16:34:01 UTC) #41
violets
https://codereview.chromium.org/23684041/diff/359001/src/ports/SkFontHost_FreeType.cpp File src/ports/SkFontHost_FreeType.cpp (right): https://codereview.chromium.org/23684041/diff/359001/src/ports/SkFontHost_FreeType.cpp#newcode1162 src/ports/SkFontHost_FreeType.cpp:1162: glyph.fWidth = SkToU16(SkScalarRoundToInt(SkScalarMul(SkIntToScalar(glyph.fWidth), scale))); On 2013/11/13 20:21:46, reed1 wrote: ...
7 years, 1 month ago (2013-11-19 18:38:05 UTC) #42
reed1
https://codereview.chromium.org/23684041/diff/359001/src/ports/SkFontHost_FreeType_common.cpp File src/ports/SkFontHost_FreeType_common.cpp (right): https://codereview.chromium.org/23684041/diff/359001/src/ports/SkFontHost_FreeType_common.cpp#newcode126 src/ports/SkFontHost_FreeType_common.cpp:126: static void copyFTBitmap(const FT_Bitmap& srcFTBitmap, uint8_t* dst, uint8_t dstFormat, ...
7 years, 1 month ago (2013-11-20 21:52:11 UTC) #43
violets
On 2013/11/20 21:52:11, reed1 wrote: > https://codereview.chromium.org/23684041/diff/359001/src/ports/SkFontHost_FreeType_common.cpp > File src/ports/SkFontHost_FreeType_common.cpp (right): > > https://codereview.chromium.org/23684041/diff/359001/src/ports/SkFontHost_FreeType_common.cpp#newcode126 > ...
7 years, 1 month ago (2013-11-20 21:56:12 UTC) #44
bungeman-skia
Mostly looking good, but you'll need to rebase since kerning support was added (which is ...
7 years, 1 month ago (2013-11-22 18:09:13 UTC) #45
bungeman-skia
https://codereview.chromium.org/23684041/diff/589001/src/ports/SkFontHost_FreeType.cpp File src/ports/SkFontHost_FreeType.cpp (right): https://codereview.chromium.org/23684041/diff/589001/src/ports/SkFontHost_FreeType.cpp#newcode1234 src/ports/SkFontHost_FreeType.cpp:1234: #ifdef FT_LOAD_COLOR On 2013/11/22 18:09:14, bungeman1 wrote: > Maybe ...
7 years ago (2013-11-25 16:32:49 UTC) #46
bungeman-skia
Some changes have been made so that the GPU side can eventually render the color ...
7 years ago (2013-11-27 00:04:48 UTC) #47
bungeman-skia
At PS13, the bitmap scaling should work acceptably in all practical cases. However, there are ...
7 years ago (2013-12-04 21:39:58 UTC) #48
violets
On 2013/12/04 21:39:58, bungeman1 wrote: > At PS13, the bitmap scaling should work acceptably in ...
7 years ago (2013-12-04 21:41:32 UTC) #49
bungeman-skia
It turns out the advances being incorrect in PS13 is actually an issue with my ...
7 years ago (2013-12-05 17:24:12 UTC) #50
bungeman-skia
I think we've decided that this is at least ok to land at PS14. The ...
7 years ago (2013-12-06 21:36:05 UTC) #51
reed1
Do we have good gms etc. to exercise the new feature/code? https://codereview.chromium.org/23684041/diff/719001/src/ports/SkFontConfigInterface_direct.cpp File src/ports/SkFontConfigInterface_direct.cpp (right): ...
7 years ago (2013-12-09 16:58:41 UTC) #52
bungeman-skia
The already existing coloremoji gm does cover the color font part of this. In the ...
7 years ago (2013-12-09 19:42:43 UTC) #53
bungeman-skia
Addressed most of reed's comments and some of my own. We still need a test ...
7 years ago (2013-12-09 22:13:33 UTC) #54
reed1
lgtm
7 years ago (2013-12-09 23:04:03 UTC) #55
bungeman-skia
Committed patchset #15 manually as r12607.
7 years ago (2013-12-10 18:10:38 UTC) #56
djsollen
awesome!
7 years ago (2013-12-10 18:34:38 UTC) #57
violets
Oh, lovely! Big thanks to everyone involved, I'm really excited that this finally got upstreamed!
7 years ago (2013-12-10 18:49:48 UTC) #58
behdad_google
7 years ago (2013-12-10 18:54:01 UTC) #59
Message was sent while issue was closed.
On 2013/12/10 18:49:48, violets wrote:
> Oh, lovely! Big thanks to everyone involved, I'm really excited that this
> finally got upstreamed!

Thanks all.  Perhaps this will make it to the next Android release now!

Powered by Google App Engine
This is Rietveld 408576698