Commit graph

128 commits

Author SHA1 Message Date
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
Nigel Tao
1f97ea5d8e freetype/truetype: apply the pp1x adjustment to the unhinted points
*before* hinting.

R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/35070044
2013-11-29 22:12:55 +11:00
Nigel Tao
114d43ecfe freetype/truetype: load vertical metrics from the OS/2 table.
R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/34700043
2013-11-29 10:33:11 +11:00
Nigel Tao
1c0c5a1f9a freetype/truetype: upgrade testdata to C Freetype 2.5.1.
R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/33650044
2013-11-28 14:02:28 +11:00
Nigel Tao
02a88bab17 freetype/truetype: fix SHC, MIRP opcodes.
R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/33750043
2013-11-27 20:09:54 +11:00
Nigel Tao
5a5d117404 freetype/truetype: normalize and set dual vector for SPVFS and SFVFS
opcodes. Calculate dot product with 32-bit math to match C Freetype's
rounding.

R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/32740043
2013-11-27 17:48:57 +11:00
Nigel Tao
cce54f9bf8 freetype/truetype: fix order of 1st phantom point adjustment and
2nd / 4th phantom point rounding.

R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/32040043
2013-11-26 20:06:51 +11:00
Nigel Tao
cef9ca89c7 freetype/truetype: implement ISECT, SHC, WCVTF, DELTAC and SDPVTL
opcodes.

R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/29510043
2013-11-21 08:51:09 +11:00
Nigel Tao
f6106a9f8b freetype/truetype: adjust ends slice when hinting a compound glyph.
Successfully hint all of DejaVu Sans Oblique, barring 4 exceptions
that are errors in the upstream C Freetype project. See
http://lists.nongnu.org/archive/html/freetype/2013-11/msg00004.html
for details.

R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/21580044
2013-11-07 08:53:15 +11:00
Nigel Tao
cdaff3c716 freetype/truetype: run compound glyph hinting instructions.
Also add API for vertical metrics.

R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/21330043
2013-11-05 09:58:40 +11:00
Nigel Tao
1f81822fe1 freetype/truetype: recalculate 'phantom point 1' after rounding.
R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/19090043
2013-10-30 07:50:48 +11:00
Nigel Tao
e849ac9382 freetype: fix MDRP/MIRP Set-RP0 bit and fix normalize rounding.
Also make phantom point delta-X adjustment.

Also make print-glyph-points require Freetype version >= 2.5, which is
the latest version, at the time of writing.

R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/18370043
2013-10-29 20:59:39 +11:00
Nigel Tao
ab80f5823d freetype/truetype: implement SHP and DELTAP opcodes.
R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/16500043
2013-10-25 20:07:33 +11:00
R?my Oudompheng
486e1683dd freetype/truetype: handle control value cut-in in MIRP.
The difference is quite large on glyph 509 (period character)
of Adobe Source Sans Pro Bold Italic.

R=golang-dev, nigeltao, bsiegert
CC=golang-dev
https://codereview.appspot.com/16820043

Committer: Nigel Tao <nigeltao@golang.org>
2013-10-25 11:01:57 +11:00
R?my Oudompheng
5ac614f802 freetype/truetype: implement MSIRP instruction.
R=golang-dev, nigeltao, bsiegert
CC=golang-dev
https://codereview.appspot.com/16630044

Committer: Nigel Tao <nigeltao@golang.org>
2013-10-25 11:00:02 +11:00
R?my Oudompheng
7bee3b6fe0 freetype/truetype: implement GC and MD instructions.
These instructions are found in Adobe Source Sans Pro fonts.

R=golang-dev, nigeltao, bsiegert
CC=golang-dev
https://codereview.appspot.com/16440043

Committer: Nigel Tao <nigeltao@golang.org>
2013-10-24 20:17:56 +11:00
Nigel Tao
ab106efa01 freetype/truetype: implement SPVTL, SFVTL, SHZ, SHPIX opcodes.
Fix MIRP opcodes, scaled CVT initialization and Hinter.move.

R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/14930050
2013-10-24 10:47:50 +11:00
R?my Oudompheng
e1f638ef1d freetype/truetype: fix IP rounding for negative numbers.
Found in Adobe Source Sans Pro.

R=golang-dev, bsiegert, nigeltao
CC=golang-dev
https://codereview.appspot.com/15360043

Committer: Nigel Tao <nigeltao@golang.org>
2013-10-22 17:13:52 +11:00
Nigel Tao
3d51db0e38 freetype: C: add R?my Oudompheng's gmail.com address.
I fail at copy/pasting from the main Go repo.

R=adg, remyoudompheng
CC=golang-dev
https://codereview.appspot.com/14960051
2013-10-22 17:13:00 +11:00
Nigel Tao
2c9a24fb31 freetype: A+C: R?my Oudompheng (individual CLA)
R=dsymonds, adg
CC=golang-dev
https://codereview.appspot.com/15050048
2013-10-22 15:48:40 +11:00
Nigel Tao
b821f16356 freetype/truetype: WCVTP, RCVT opcodes.
R=bsiegert
CC=golang-dev
https://codereview.appspot.com/14802046
2013-10-19 10:04:03 +11:00
Nigel Tao
bb775957cb freetype/truetype: propagate the useMyMetrics flag to nested components.
Also increase the maximum recursion depth from 4 to 8, since some
x-deja-vu-sans-oblique glyphs are actually depth 4. It's an arbitrary
limit. The C Freetype code doesn't seem to limit recursion (below
whatever the font says it needs), but it seems safer to have a limit.

R=bsiegert
CC=golang-dev
https://codereview.appspot.com/14494062
2013-10-17 10:21:20 +11:00
Nigel Tao
8373bbf0e6 freetype/truetype: implement compound glyph transforms.
R=bsiegert
CC=golang-dev
https://codereview.appspot.com/14425064
2013-10-16 21:39:06 +11:00
Nigel Tao
c8094ec963 freetype/truetype: refactor glyph.go; match C Freetype's rounding on
one more test case.

R=bsiegert
CC=golang-dev
https://codereview.appspot.com/14691043
2013-10-16 18:54:54 +11:00
Nigel Tao
95f62386c3 freetype/truetype: enable the Times New Roman tests.
R=bsiegert
CC=golang-dev
https://codereview.appspot.com/14641043
2013-10-15 09:26:07 +11:00
Nigel Tao
30be3ed95b freetype/truetype: speed up the testScaling test function.
"go test" drops from 5.203s to 0.474s.

R=bsiegert
CC=golang-dev
https://codereview.appspot.com/14566047
2013-10-13 15:43:34 +11:00
Nigel Tao
9e24a6204e freetype/truetype: implement Font.Index binary search.
R=bsiegert
CC=golang-dev
https://codereview.appspot.com/14604044
2013-10-12 09:29:59 +11:00
Nigel Tao
0a778f7f02 freetype/truetype: parse UCS-4 encoded cmap tables.
R=bsiegert
CC=golang-dev
https://codereview.appspot.com/14548046
2013-10-11 07:29:40 +11:00
Nigel Tao
ba07cbfbc8 freetype/truetype: set the four phantom points, and adjust the glyph
points accordingly.

Yes, it's a mess, but let's pass the tests first, and then refactor.

R=bsiegert
CC=golang-dev
https://codereview.appspot.com/14419052
2013-10-10 07:43:32 +11:00
Nigel Tao
b76427be47 freetype: add script to create more hinting tests.
R=bsiegert, r
CC=golang-dev
https://codereview.appspot.com/14414044
2013-10-09 20:07:32 +11:00
Nigel Tao
b968fb0953 freeetype: move the test fonts from the luxi-fonts/ directory to
testdata/, in anticipation of having other test data.

R=dsymonds
CC=bsiegert, golang-dev
https://codereview.appspot.com/14361044
2013-10-04 17:03:59 +10:00
Nigel Tao
0ec7c0ecae freetype/truetype: fix IUP rounding for negative numbers.
We now match Freetype C exactly for hinting luxisr.ttf. Yay.

R=bsiegert
CC=golang-dev
https://codereview.appspot.com/14336044
2013-10-04 08:30:53 +10:00
Nigel Tao
7e90529703 freetype/truetype: fix the SSW instruction to scale the single-width
value and the MDRP instruction's use of the single-width value.

R=bsiegert
CC=golang-dev
https://codereview.appspot.com/14273043
2013-10-03 21:32:43 +10:00
Nigel Tao
7505dadf20 freetype/truetype: make a (sub-)glyph's points an explicit part of a
Hinter's state, instead of having a glyph shrink and restore its
points around hinting.

R=bsiegert
CC=golang-dev
https://codereview.appspot.com/14203043
2013-10-02 20:37:11 +10:00