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>
Bigelow & Holmes have prepared new versions of the Go Fonts. The version
numbers have changed from 2.004 to 2.008. ChangeLog:
* New! 2 new fonts, bringing the total to 12: Go Smallcaps and Go
Smallcaps Italic.
* New! U+FFFD REPLACEMENT CHARACTER glyph added.
* U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE ring tweaked.
* U+00F0 LATIN SMALL LETTER ETH glyph lightened.
* Superfluous U+0005 <control> glyph removed.
* Split integral, chart draw, block, shade and related glyphs now span
the full height and have fewer seams when tiled.
* Raised most capital letter diacritics and some lowercase diacritics.
* Mono character widths fixed to be uniform.
* Underline position adjusted.
* SFNT glyph order and cmap table optimized.
* SFNT glyph names (post table) regularized, consistent with the AGLFN.
* ttfautohint upgraded to the latest version, from 1.5 to 1.6.
Change-Id: I0985f07d58b984010199dd723ccdf5892ee59c78
Reviewed-on: https://go-review.googlesource.com/38870
Reviewed-by: Rob Pike <r@golang.org>
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>
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>
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>
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>
go1.8.typealias is the build tag defined by the unreleased
"Go 1.8 + type aliases" variant in the Go repo's dev.typealias branch.
Change-Id: Iff2566249ecc9a6788b78199743d2005708f1cd7
Reviewed-on: https://go-review.googlesource.com/37511
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
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>
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>
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>
This relies on type aliases, a language feature new in Go 1.9.
The package documentation, in draw.go, explicitly gives the intent of
this package:
This package is a superset of and a drop-in replacement for the
image/draw package in the standard library.
Drop-in replacement means that I can replace all of my "image/draw"
imports with "golang.org/x/image/draw", to access additional features in
this package, and no further changes are required. That's mostly true,
but not completely true unless we use type aliases.
Without type aliases, users might need to import both "image/draw" and
"golang.org/x/image/draw" in order to convert from two conceptually
equivalent but different (from the compiler's point of view) types, such
as from one draw.Op type to another draw.Op type, to satisfy some other
interface or function signature.
Change-Id: Ice6d000d49b019c2d8761739a904232e9cd01cae
Reviewed-on: https://go-review.googlesource.com/36730
Run-TryBot: Nigel Tao <nigeltao@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
This is the golang.org/x equivalent of the golang.org/cl/36732 change to
the standard library.
Change-Id: I71c09a72e24c8e1c013769a6fed8f9a031724d9d
Reviewed-on: https://go-review.googlesource.com/36733
Run-TryBot: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
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>
These are analogous to the image.Point and image.Rectangle methods in
the standard library.
Change-Id: If8997421a9aeb31d29cfe5eefb79cc481a39df82
Reviewed-on: https://go-review.googlesource.com/34753
Reviewed-by: David Crawshaw <crawshaw@golang.org>
The bounding box of a string does not necessarily contain the origin.
Prior to this commit, BoundString(etc, "x") would call grow exactly
once, with the first argument being the (empty) zero rectangle.
Change-Id: Id7d4f6c250ac0749f6dae19d11f4e97f9c6f45bc
Reviewed-on: https://go-review.googlesource.com/34674
Reviewed-by: Dave Day <djd@golang.org>
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>
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>
When commit 8874bef1 changed ϕ from 10 to 9, this total diff grew from:
Total diff = 3051, n = 208, avg = 14.66827 out of 65535, or 0.02238%.
to:
Total diff = 6412, n = 208, avg = 30.82692 out of 65535, or 0.04704%.
Also fix a comment typo.
Change-Id: I91cc861a3d3ab282b5431cfb141fb010fd1f8d14
Reviewed-on: https://go-review.googlesource.com/32771
Reviewed-by: David Crawshaw <crawshaw@golang.org>
The f32.Vec2 type doesn't seem worth it.
Change-Id: I021c7e13d7e2dd261334f4aa7e867df4fd8f1c3e
Reviewed-on: https://go-review.googlesource.com/32772
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This makes the fixed point and floating point code more similar.
Benchmarks don't show any significant change.
Change-Id: I723fa1605eaa248b40e784201b680c16cc3d26a2
Reviewed-on: https://go-review.googlesource.com/32134
Reviewed-by: David Crawshaw <crawshaw@golang.org>