Commit Graph

25 Commits

Author SHA1 Message Date
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
069db1da13 font/sfnt: make parseXxx dependencies explicit.
Change-Id: Ib0b76c48cd0b4288700458407077aae4e5911233
Reviewed-on: https://go-review.googlesource.com/37553
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-03-07 07:36:15 +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
8491f88afc font/sfnt: implement Font.GlyphName.
This is based on the post table in the sfnt file.

Change-Id: I11f7a9bd9024cfc8f92adc5abb4d5356521f0df7
Reviewed-on: https://go-review.googlesource.com/36972
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-17 10:37:04 +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
05f0a469d9 font/sfnt: support non-zero offsets in format-4 cmap tables.
Change-Id: I52592fcde96ce2f3b7700a29169b517a813f9f3c
Reviewed-on: https://go-review.googlesource.com/36371
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-07 21:45:33 +00:00
Nigel Tao
993cf229e6 font/sfnt: fix proprietary fonts and cmap format 12.
Two recent commits ("proprietary fonts" and "cmap format 12") each
passed all of its own tests, but the combination wasn't tested until
both were submitted.

Change-Id: Ic4c2ae8deb1e4623ca5543672dc46d55bfce91a4
Reviewed-on: https://go-review.googlesource.com/36372
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-07 21:42:49 +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
Nigel Tao
c8ab450c16 font/sfnt: support cmap format 12.
Change-Id: I2791f5aec860bbb16c6c6945703827afd55c11dc
Reviewed-on: https://go-review.googlesource.com/36291
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-04 03:42:56 +00:00
Nigel Tao
55ae12acc9 font/sfnt: use ../testdata/cmapTest.ttf.
The index numbers can be verified by running ttx over the ttf file:

<GlyphOrder>
<!-- The 'id' attribute is only for humans; it is ignored when parsed. -->
<GlyphID id="0" name=".notdef"/>
<GlyphID id="1" name=".null"/>
<GlyphID id="2" name="nonmarkingreturn"/>
<GlyphID id="3" name="zero"/>
<GlyphID id="4" name="one"/>
<GlyphID id="5" name="two"/>
<GlyphID id="6" name="A"/>
<GlyphID id="7" name="B"/>
<GlyphID id="8" name="a"/>
<GlyphID id="9" name="ydieresis"/>
<GlyphID id="10" name="Amacron"/>
<GlyphID id="11" name="amacron"/>
<GlyphID id="12" name="uni4E2D"/>
<GlyphID id="13" name="u1F0A1"/>
<GlyphID id="14" name="u1F0B1"/>
<GlyphID id="15" name="u1F0B2"/>
</GlyphOrder>

Change-Id: I8c3b3f09ca25c14d92725d121481287cf57d0d01
Reviewed-on: https://go-review.googlesource.com/36080
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03 07:45:48 +00:00
Nigel Tao
69afd001f7 font/sfnt: parse the cmap table.
Change-Id: I757d42c9caf419f549696543f0f156cfe3dbfe1a
Reviewed-on: https://go-review.googlesource.com/35512
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-02 02:23:30 +00:00
Nigel Tao
83686c5479 font/sfnt: parse the glyf table.
Change-Id: Ib7ff75d99d3641f68f621db4ba2279cc1bda8c3a
Reviewed-on: https://go-review.googlesource.com/35271
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-01-19 08:01:09 +00:00
Nigel Tao
2d771d3c32 font/sfnt: add a Font.Name method.
Also make all of the Buffer fields non-exported. LoadGlyph now returns
the segments instead of setting Buffer.Segments for the caller to use.

Change-Id: I3f87070da5e8f014f88dbca70b62a4cd30e3fd66
Reviewed-on: https://go-review.googlesource.com/34532
Reviewed-by: Dave Day <djd@golang.org>
2016-12-20 10:23:14 +00:00
Nigel Tao
ed90ab82a8 font/sfnt: add a comment about contour ordering.
Change-Id: I591c735cc1c3108aa806b0a7be6c54152fe2029e
Reviewed-on: https://go-review.googlesource.com/34174
Reviewed-by: Dave Day <djd@golang.org>
2016-12-15 04:48:35 +00:00
Nigel Tao
88b013251f font/sfnt: implement rrcurveto.
Change-Id: I2e24293568b296dd916b2ef6a9c1113ffd5f9253
Reviewed-on: https://go-review.googlesource.com/34171
Reviewed-by: Dave Day <djd@golang.org>
2016-12-12 04:37:57 +00:00
Nigel Tao
ce50dba65c font/sfnt: parse Type 2 Charstrings.
Change-Id: I61beec4611612800a519045e2552c513eb83c3f8
Reviewed-on: https://go-review.googlesource.com/33932
Reviewed-by: Dave Day <djd@golang.org>
2016-12-09 07:38:38 +00:00
Nigel Tao
e2d0a9f0e6 font/sfnt: parse CFF 2-byte operators and real numbers.
Change-Id: I6f2cdfb44817832cf833883ef6fca692a001b6b1
Reviewed-on: https://go-review.googlesource.com/33813
Reviewed-by: Dave Day <djd@golang.org>
2016-12-05 08:11:59 +00:00
Nigel Tao
5286ed5c2a font/sfnt: parse the CFF table.
Parsing the per-glyph Charstrings will be a follow-up commit.

Change-Id: I52f849a77dd7fa14b6e07420820bdfb4347c2438
Reviewed-on: https://go-review.googlesource.com/33593
Reviewed-by: Dave Day <djd@golang.org>
2016-12-01 07:43:55 +00:00
Nigel Tao
c39d899a5b font/sfnt: new package for parsing SFNT fonts.
Updates golang/go#16904

Change-Id: Ic4c55865741b712f7d82448276fc357f2edf9b45
Reviewed-on: https://go-review.googlesource.com/33417
Reviewed-by: Dave Day <djd@golang.org>
2016-11-23 02:01:16 +00:00