Nigel Tao
fb514f71f0
A+C: add Stephen Edwards <cureadvocate@gmail.com>.
2015-09-21 16:40:42 +10:00
Nigel Tao
41fa49aa5b
Update x/exp/shiny/font to x/image/font.
2015-09-01 15:49:46 +10:00
Nigel Tao
494079eb2b
Cache the glyph index lookup.
...
benchmark old ns/op new ns/op delta
BenchmarkDrawString-8 8618239 8149527 -5.44%
2015-08-31 14:14:50 +10:00
Nigel Tao
03bdcc0fe1
Have face.Glyph return an advance width, not the new dot.
...
This tracks an upstream change in the x/exp/shiny/font package.
2015-08-31 11:34:42 +10:00
Nigel Tao
8a4428169d
Make raster.Painter's max alpha 1<<16-1, not 1<<32-1.
...
This is more consistent with the standard library's image/color package.
The benchmarks didn't seem to change significantly.
2015-08-30 23:48:43 +10:00
Nigel Tao
3ba1c0f728
Rename Point and End slices to Points and Ends.
...
The slice Foos is plural; it refers to multiple elements. The element Foos[i]
is the i'th Foo.
2015-08-30 22:27:18 +10:00
Nigel Tao
3cc748686b
Use fixed.Rectangle26_6 instead of truetype.Bounds.
...
The previous "the endpoints are inclusive" comment seems confusing. It's true
that the bounding box's max X equals the right-most coordinate, which suggests
<= instead of <, but that node's coordinate is itself exclusive. Consider the
solid 1-pixel square: (0, 0), (64, 0), (64, 64), (0, 64) in fixed.Point26_6
coordinates. The right-most coordinate is 64, and the bounding box's max X
equals 64, but rasterizing that square only affects sub-pixels up to but not
including 64.
Instead, it seems accurate to follow the fixed.Rectangle26_6 description, in
that the max values are exclusive.
2015-08-30 22:06:37 +10:00
Nigel Tao
7a598da6de
Delete the truetype.NewGlyphBuf function.
...
The zero value of a GlyphBuf is already perfectly usable.
2015-08-30 21:35:58 +10:00
Nigel Tao
fe26067669
Cache glyph mask images.
...
benchmark old ns/op new ns/op delta
BenchmarkDrawString-4 88103151 14188817 -83.90%
2015-08-27 22:16:16 +10:00
Nigel Tao
62e59645ee
Quantize sub-pixel glyph rendering.
...
This is in anticipation of caching glyph images. Quantization means that cache
hits are more likely.
Also make NewFace take an *Options instead of an Options.
2015-08-25 22:34:31 +10:00
Nigel Tao
a021a5f23e
Rename Kerning to Kern.
2015-08-24 16:17:16 +10:00
Nigel Tao
db77c6a161
Delete some unnecessary fixed.Int26_6 conversions.
2015-08-24 15:57:20 +10:00
Nigel Tao
24265d1c91
Implement GlyphBounds and GlyphAdvance.
2015-08-24 15:51:50 +10:00
Nigel Tao
9c46b87503
Make face.Glyph not allocate a new mask each time.
...
benchmark old ns/op new ns/op delta
BenchmarkDrawString-4 96914389 88683659 -8.49%
benchmark old allocs new allocs delta
BenchmarkDrawString-4 32287 0 -100.00%
benchmark old bytes new bytes delta
BenchmarkDrawString-4 1929619 156 -99.99%
2015-08-23 21:11:02 +10:00
Nigel Tao
2d84b72ff6
Add a DrawString benchmark.
2015-08-23 20:45:19 +10:00
Nigel Tao
d8618774be
Fix some comment typos.
...
These comments weren't updated when we went from 24.8 to 26.6.
2015-08-22 14:48:07 +10:00
Nigel Tao
6deea24143
Add a truetype.Face type.
...
Its implementation is mostly a copy/paste of the freetype.Context type.
Follow-up commits will make it more efficient.
Also add an example that uses a truetype.Face and the
golang.org/x/exp/shiny/font package to draw text.
2015-08-22 14:46:12 +10:00
Nigel Tao
7166253831
Fix rounding up for 26.6 fixed point, not 24.8.
2015-08-21 14:00:51 +10:00
Nigel Tao
071d96ed47
Update BenchmarkDrawString testdata dir.
2015-08-20 16:09:11 +10:00
Nigel Tao
f42630ca7a
Use the common golang.org/x/exp/shiny/font.Hinting type.
2015-08-20 16:07:51 +10:00
Nigel Tao
7e2154db58
Delete the f26dot6 type in favor of fixed.Int26_6.
2015-08-18 16:47:46 +10:00
Nigel Tao
43fc220ebd
Make f26dot6 methods prefix, not infix.
...
This is in anticipation of removing the f26dot6 type entirely. Instead,
we will use the fixed.Int26_6 type from golang.org/x/image/math/fixed.
2015-08-18 16:36:59 +10:00
Nigel Tao
e8121e3c7d
Don't use backtick quotes in the comments.
2015-08-18 16:33:14 +10:00
Nigel Tao
2a5cbfd47e
Use the fixed.Int26_6 type in package truetype.
2015-08-18 16:30:37 +10:00
Nigel Tao
a9554eda48
Fix example/freetype for the s/Fix32/fixed.Int26_6/ change.
2015-08-18 16:08:44 +10:00
Nigel Tao
856a70c395
Use the fixed.Int26_6 and fixed.Point26_6 types.
2015-08-17 10:26:09 +10:00
Nigel Tao
d91c1d6844
Remove Point methods other than Add, Sub, Mul.
...
This is in anticipation of removing the Point type entirely. Instead, we will
use the fixed.Point26_6 type from golang.org/x/image/math/fixed.
2015-08-13 21:17:25 +10:00
Nigel Tao
84ba7fbd7a
Add "+build ignore" tags to the examples.
2015-08-12 14:41:46 +10:00
Nigel Tao
5193f9f147
Add canonical import paths.
2015-08-12 14:34:19 +10:00
Nigel Tao
d1c460896e
Fix testdata paths after moving files up one level.
2015-08-12 14:32:40 +10:00
Nigel Tao
bf25f8ce0e
Move files up one level.
2015-08-12 14:30:01 +10:00
Nigel Tao
2f0c939b0a
Delete hg related detritus.
...
We use git and github now, not hg and code.google.com.
2015-08-11 14:38:11 +10:00
Nigel Tao
160e1d6137
freetype: fix drawContour when the first point is off the curve.
...
Fixes issue 16.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews, philipz
https://codereview.appspot.com/209280043
2015-03-09 11:32:30 +11:00
Nigel Tao
78edcde0f3
freetype/raster: fix some style nits.
...
This code dates from before Go 1.0.
LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://codereview.appspot.com/206860043
2015-02-24 10:52:08 +11:00
Nigel Tao
cf94cb9b43
freetype/truetype: update the golden tests for Ubuntu 14.04's version
...
of standard fonts like Deja Vu Sans Oblique.
LGTM=bsiegert
R=bsiegert
CC=golang-codereviews
https://codereview.appspot.com/164660043
2014-11-07 09:38:15 +11:00
Nigel Tao
c3ec330230
freetype/truetype: fix some typos in hint.go.
...
Fixes issue 12.
Fixes issue 13.
LGTM=bsiegert
R=bsiegert
CC=golang-codereviews
https://codereview.appspot.com/164650043
2014-11-07 09:37:26 +11:00
Nigel Tao
e009753234
freetype/truetype: support symbol fonts such as Webdings.
...
LGTM=bsiegert
R=bsiegert
CC=golang-codereviews
https://codereview.appspot.com/60380043
2014-02-06 10:38:58 +11:00
Nigel Tao
49fa4a4de0
freetype: add a Hinting enum in the top-level freetype package, and
...
hide the Hinter implementation in the freetype/truetype package.
LGTM=bsiegert
R=bsiegert
CC=golang-codereviews
https://codereview.appspot.com/58940043
2014-02-01 14:12:48 +11:00
Nigel Tao
51c4a7ede4
freetype/truetype: merge the deltap and deltac code.
...
LGTM=bsiegert
R=bsiegert
CC=golang-codereviews
https://codereview.appspot.com/54730043
2014-01-30 13:07:29 +11:00
Nigel Tao
c3fc397167
freetype/truetype: refactor dispatch for high opcodes.
...
Also delete "q means that that opcode is not yet implemented", as all
valid opcodes are now implemented.
R=bsiegert
CC=golang-codereviews
https://codereview.appspot.com/53050044
2014-01-21 09:31:51 +11:00
Nigel Tao
39b0167875
freetype/truetype: implement the remaining opcodes.
...
R=bsiegert
CC=golang-codereviews
https://codereview.appspot.com/51760043
2014-01-20 14:33:40 +11:00
Nigel Tao
10cb3b4280
freetype/truetype: calculate advance widths correctly.
...
The logic is a little clunky, but as before, let's get it right first,
then get it clean once we have a full battery of tests.
R=bsiegert
CC=golang-codereviews
https://codereview.appspot.com/50910043
2014-01-14 09:58:07 +11:00
Nigel Tao
897255e610
freetype/truetype: fix bounding box calculation.
...
R=bsiegert
CC=golang-codereviews, remyoudompheng
https://codereview.appspot.com/39440045
2013-12-21 10:03:04 +11:00
Russ Cox
5ed83878d0
codereview: switch defaultcc to golang-codereviews
...
See this thread for background:
https://groups.google.com/forum/#!topic/golang-dev/xG7vPi21r8g
R=golang-codereviews, r
CC=golang-codereviews
https://codereview.appspot.com/36380046
2013-12-20 10:59:27 -05:00
Nigel Tao
9fd1f2aca9
freetype/truetype: add testdata for advance widths and bounding boxes.
...
R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/40690045
2013-12-16 13:47:21 +11:00
Nigel Tao
f3eade8b5f
freetype/truetype: fix MD0/MD1 opcodes and f26dot6 multiplication
...
rounding.
Pass all the hinting tests. Hooray! Removing the hintingBrokenAt field
will be a follow-up CL.
R=bsiegert, remyoudompheng, jeremyjackins
CC=golang-dev
https://codereview.appspot.com/36880043
2013-12-05 09:09:03 +11:00
Nigel Tao
4c33bd09f5
freetype/truetype: implement SCFS, FLIPPT, FLIPRGON, FLIPRGOFF opcodes.
...
R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/36300043
2013-12-04 10:04:19 +11:00
Nigel Tao
25cb1e119f
freetype/truetype: fix SHC opcode.
...
R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/36220043
2013-12-03 10:57:02 +11:00
Nigel Tao
11bef13aa5
freetype/truetype: track phantom points across compound glyphs.
...
The very subtle pp1x versus phantomPoints[0].X distinction is pretty
ugly code, but let's get all the tests passing first, so that we can
refactor with confidence.
R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/35850043
2013-12-03 08:21:05 +11:00
Nigel Tao
5cb0a99dcd
freetype/truetype: fix Super45 rounding.
...
R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/34790045
2013-11-30 15:19:12 +11:00