Commit Graph

21 Commits

Author SHA1 Message Date
Nigel Tao
426cfd8eeb font/sfnt: implement hflex and hflex1.
Change-Id: I288a014a5b6c54e54ffa69b76a8b12fa7fdbc708
Reviewed-on: https://go-review.googlesource.com/43474
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-05-23 02:19:15 +00:00
Nigel Tao
d835a09709 font/sfnt: add ErrColoredGlyph.
Also add tests for the Noto proprietary fonts. Prior to this commit,
NotoColorEmoji.ttf was unsupported. It's still not well supported, but
the error message returned is now more informative.

Change-Id: I61a3301d7f2458a4b838eb1de7a73d6472e3486f
Reviewed-on: https://go-review.googlesource.com/43694
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-05-23 02:17:49 +00:00
Nigel Tao
f483456c9f font/sfnt: don't reject multiple kern subtables.
A future commit will actually use subtables past the first one, but for
now, ignore them instead of failing on their presence.

Also add tests for the DejaVu proprietary fonts. Prior to this commit,
DejaVuSans-ExtraLight.ttf was unsupported.

Change-Id: Ic78a59c5ab30e4091efa2a04b89b12cb786157db
Reviewed-on: https://go-review.googlesource.com/42192
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-05-04 00:22:41 +00:00
Nigel Tao
3210c0296b font/sfnt: support .dfont files.
Change-Id: Id7aa18c48c65586c688cee230ce87f4d88dae9b5
Reviewed-on: https://go-review.googlesource.com/40893
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-04-21 22:58:11 +00:00
Nigel Tao
7c3fafc74f font/sfnt: explicitly close glyph contours.
Change-Id: I4a59167cfe5d84f0ef6732711cca9b46a52b445c
Reviewed-on: https://go-review.googlesource.com/39930
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-04-10 07:42:48 +00:00
Nigel Tao
f36ba34967 font/sfnt: implement Font Dict Select.
Change-Id: I8c463b41421a35455701847520367add4727cbe3
Reviewed-on: https://go-review.googlesource.com/38871
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-03-30 23:40:04 +00:00
Nigel Tao
59d151bf14 font/sfnt: implement implicit vstem before hintmask.
Change-Id: I811bcf94b518dabcfbebd085ad3c6a47c17ef38e
Reviewed-on: https://go-review.googlesource.com/38288
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-03-30 01:47:42 +00:00
Nigel Tao
c0851fbc5b font/sfnt: support PostScript compound glyphs (subroutines).
Change-Id: I8aa10150aa004b1bc1128bf0b3d5c14b74ee089c
Reviewed-on: https://go-review.googlesource.com/38280
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-03-22 22:20:00 +00:00
Nigel Tao
2e35bd52b4 font/sfnt: increase proprietary_test coverage.
Recent commits (probably 792d36e1 "support TrueType compound glyphs" and
1995ed1a "support TrueType glyph transformations") let us decode all the
glyphs in the Adobe TrueType fonts, but I forgot to update the test
coverage in those commits.

Change-Id: I7b135005cd67082f84aee16d296debdedcc9488e
Reviewed-on: https://go-review.googlesource.com/38281
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-03-22 21:47:50 +00:00
Nigel Tao
88e2d806a0 font/sfnt: ignore version 1 kern tables.
The format is relatively complicated but rarely seen. It doesn't seem
worth the effort. Ignoring it is what Microsoft Windows and FreeType do.

Change-Id: I4415bd591c832650066de1d4e035b20a7230a4da
Reviewed-on: https://go-review.googlesource.com/38273
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-03-18 23:50:03 +00:00
Nigel Tao
6847effb9b font/sfnt: support font collections (.ttc and .otc files).
Also add tests for Apple proprietary fonts.

Change-Id: I5ce8efa2397bb01c5255d956a77c955ba1383105
Reviewed-on: https://go-review.googlesource.com/38272
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-03-18 07:04:21 +00:00
Nigel Tao
1995ed1a25 font/sfnt: support TrueType glyph transformations.
Change-Id: Iea2387b5e30dd0fff53e2808b25599c3be5b1cdb
Reviewed-on: https://go-review.googlesource.com/38210
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-03-18 06:57:45 +00:00
Nigel Tao
792d36e11d font/sfnt: support TrueType compound glyphs.
Change-Id: I129e3f7894ad0edccc9e8ca4a21fc9e60e23105b
Reviewed-on: https://go-review.googlesource.com/38111
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-03-15 23:27:06 +00:00
Nigel Tao
c1a19c11c3 font/sfnt: implement rcurveline and rlinecurve.
Change-Id: I563f9e4a76a5c91d2ef2b6ffccc78550ab582d08
Reviewed-on: https://go-review.googlesource.com/38110
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-03-15 23:13:12 +00:00
Nigel Tao
793f3be7da font/sfnt: implement {hh,vv}curveto.
Change-Id: I873f8b273d2fe9f39df7d333c36976f1b45239a0
Reviewed-on: https://go-review.googlesource.com/37917
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-03-12 00:23:23 +00:00
Nigel Tao
c8ae36c95e font/sfnt: implement Font.Kern.
Change-Id: I9ffb93dd3ee08b8871dadf5bc36578710b800199
Reviewed-on: https://go-review.googlesource.com/37410
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-24 09:00:53 +00:00
Nigel Tao
b952c941a6 font/sfnt: check the versions of proprietary fonts.
Change-Id: If8d104f5d0e60b6270e7f6a0762432dfe66cfe48
Reviewed-on: https://go-review.googlesource.com/37174
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-22 03:10:26 +00:00
Nigel Tao
ed91dc314e font/sfnt: add a ppem arg to Font.LoadGlyph.
This lets us load a glyph at e.g. 12 pixels per em.

Change-Id: I048b3db89af8670782953a8361afe0e6373df9b0
Reviewed-on: https://go-review.googlesource.com/37175
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-22 03:05:44 +00:00
Nigel Tao
791b615328 font/sfnt: update test for adobe/SourceSansPro-Regular.ttf.
The latest version of that TTF file fixes the inconsistency between the
TTF and OTF versions.

Change-Id: I0b86f6ddc3f0326e538bdd18fe097be9ad8533ae
Reviewed-on: https://go-review.googlesource.com/37173
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-17 22:17:21 +00:00
Nigel Tao
153d857a8f font/sfnt: support Symbol fonts such as MS Webdings.
Change-Id: I1297246dad6288345b4b87b885fbeda06a6516ff
Reviewed-on: https://go-review.googlesource.com/37031
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-17 10:20:08 +00:00
Nigel Tao
28d9a8b4a3 font/sfnt: add tests for proprietary fonts.
Change-Id: I1886e24f726598654d2474f0219a8046ba184a9f
Reviewed-on: https://go-review.googlesource.com/36370
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-04 04:20:41 +00:00