Commit Graph

15 Commits

Author SHA1 Message Date
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
10ed294205 font/sfnt: implement Font.GlyphAdvance.
Change-Id: I3e15c6e634d858a87e73221bd9d5a9e3979d674a
Reviewed-on: https://go-review.googlesource.com/39250
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-04-05 22:26:46 +00:00
Nigel Tao
ce0faa1867 font/sfnt: flip the Y axis for LoadGlyph's Segments.
The underlying font format's Y axis increases up. The Go standard
graphics libraries' Y axis increases down. This change makes the Go API
consistent with the other Go libraries.

Also change Segment.Args from [6]fixed.Int26_6 to [3]fixed.Point26_6 to
emphasize that the Args are consistent with other fixed.Point26_6 use.

Change-Id: Idd7b89eb4d86890dea477ac2ef96ff8f6b1dee8d
Reviewed-on: https://go-review.googlesource.com/39072
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-03-31 23:39:16 +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
ecc1a9abb6 font/sfnt: fix argStack size check for moveto ops.
The *moveto ops don't take multiple args or arg pairs. For example, in
http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/font/pdfs/5177.Type2.pdf
page 16, the rmoveto args are listed as:
dx1 dy1
which is not the same as rlineto's args, which can be repeated:
{dxa dya}+

Change-Id: I5d13f686e604955909eb0b7e52f20ce5f0522c5d
Reviewed-on: https://go-review.googlesource.com/38289
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-03-30 01:44:25 +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
fb59e5ba10 font/sfnt: rename a "stack" field to "argStack".
This will lessen the diff in a subsequent commit, which introduces a
call stack.

Change-Id: I478857675f47b53e6bd3ee270087a00b9d1d4d34
Reviewed-on: https://go-review.googlesource.com/38279
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-03-19 05:24:11 +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
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
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