Commit graph

41 commits

Author SHA1 Message Date
Nigel Tao
380b6363b2 freetype: s/float/float64/.
R=adg, r2
CC=golang-dev
http://codereview.appspot.com/4040045
2011-01-21 12:27:50 +11:00
Nigel Tao
18fe7866b3 freetype: update log to s/Stderr/Println/.
R=r, nigeltao_gnome, adg
CC=golang-dev
http://codereview.appspot.com/2527041
2010-10-15 14:02:11 +11:00
Nigel Tao
220b691d5c freetype: add NewAlpha{Src,Over}Painter constructor function for
consistency with existing NewFooPainter functions.

Unbreak build from ColorImage change in the core image package.

R=adg
CC=golang-dev
http://codereview.appspot.com/2450041
2010-10-12 16:55:01 +11:00
Nigel Tao
5792b75123 freetype: implement stroke for quadratic segments.
Fix bug where the String representation of a Fix32 representing minus
one quarter was "0:064" instead of "-0:064".

R=r, rsc, rog, nigeltao_gnome
CC=golang-dev
http://codereview.appspot.com/2275043
2010-10-03 13:53:04 +11:00
Nigel Tao
ad78f67dc2 freetype: Fix panic when drawing a span to the right of the
bounding rect.

This does for Alpha{Over,Src}Painter what revision 7329234544
did for RGBAPainter.

R=r
CC=golang-dev
http://codereview.appspot.com/2210041
2010-09-15 16:05:32 +10:00
Nigel Tao
eda48ef1c3 freetype: make the point an argument to DrawString, not part of the
context state. Also rename DrawText to DrawString.

R=r
CC=golang-dev
http://codereview.appspot.com/2208041
2010-09-15 14:35:22 +10:00
Nigel Tao
06369b10f7 freetype: add a clip rectangle.
R=r
CC=golang-dev
http://codereview.appspot.com/2171045
2010-09-13 18:20:47 +10:00
Nigel Tao
570e8c24b9 freetype: Split AlphaPainter into two separate types depending on the
Porter-Duff composition operator used. This saves a malloc when passing
an AlphaSrcPainter as a value of Painter interface type.

R=r
CC=golang-dev
http://codereview.appspot.com/2149044
2010-09-10 12:06:50 +10:00
Nigel Tao
84097fa410 freetype: cache glyphs during DrawText.
A freetype.Context now has dst and src image setters and the notion of
a current point, instead of having to pass a painter and pt to DrawText.

R=r, rsc
CC=golang-dev
http://codereview.appspot.com/2169041
2010-09-09 19:22:48 +10:00
Nigel Tao
c92eed8b0c freetype: fix doc comment typo.
R=r
CC=golang-dev
http://codereview.appspot.com/2116046
2010-09-08 20:21:29 +10:00
Nigel Tao
b8ed0a9c12 freetype-go: change freetype.DrawText's point to be at the baseline
instead of at 1em above the baseline.

R=r
CC=golang-dev
http://codereview.appspot.com/2042041
2010-08-27 15:49:35 +10:00
Nigel Tao
29c473cb3e freetype-go: Fix panic when drawing a span to the right of the
bounding rect.

This bug was introduced when an image.RGBA's representation went from
slice of slices to one linear buffer.

R=r
CC=golang-dev
http://codereview.appspot.com/2020044
2010-08-27 10:51:14 +10:00
Nigel Tao
6a75ac002d freetype-go: update examples for draw.Rect being renamed to image.Rect.
R=r
CC=golang-dev
http://codereview.appspot.com/1961046
2010-08-27 10:47:48 +10:00
Nigel Tao
acecb39ad9 freetype-go: fix Makefiles.
R=rsc
CC=golang-dev
http://codereview.appspot.com/1989044
2010-08-26 09:47:25 +10:00
Nigel Tao
3657abe884 freetype: update for image representation change (1849041).
R=r, adg
CC=golang-dev
http://codereview.appspot.com/1850041
2010-08-10 17:39:32 +10:00
Nigel Tao
2e8bf4f4fa freetype: Update examples to use explicit colors.
R=rsc
CC=golang-dev
http://codereview.appspot.com/1848055
2010-08-04 18:49:10 +10:00
Nigel Tao
2af394dab9 freetype: clarify that the GPL licence is "version 2 or later", not
just version 2. The FTL (Freetype Licence) is still available. This
matches the original Freetype library (written in C).

This only expands and does not further restrict the licensing options
available to users of the freetype-go library.

R=adg
CC=golang-dev
http://codereview.appspot.com/1731049
2010-08-03 11:07:23 +10:00
Nigel Tao
88b1bd09f8 freetype/raster: make cap and join functions instead of enums.
R=adg
CC=golang-dev, rog
http://codereview.appspot.com/1711048
2010-07-07 21:54:10 +10:00
Nigel Tao
05e3a903e8 freetype: Add top-level Makefile.
R=r
CC=golang-dev
http://codereview.appspot.com/1725049
2010-07-05 21:36:35 +10:00
Nigel Tao
3e38a96419 freetype/raster: Rename Fixed and Fixed64 to Fix32 and Fix64.
R=rsc
CC=golang-dev, rog
http://codereview.appspot.com/1686048
2010-07-01 09:42:43 +10:00
Nigel Tao
4d90648d2c freetype/raster: Implement round joins.
R=r, rsc
CC=golang-dev, rog
http://codereview.appspot.com/1746043
2010-06-30 15:10:17 +10:00
Nigel Tao
c95fb230fe freetype/raster: improve the stroking algorithm.
It still isn't perfect (e.g. it doesn't join), but it's getting closer.

Also fix the bug where RotateCW and RotateCCW was mixed up, since the
Y-axis grows down in a computer graphics co-ordinate system, not up as
in classical mathematics.

R=r, rsc, rog
CC=golang-dev
http://codereview.appspot.com/1736043
2010-06-29 10:46:59 +10:00
Nigel Tao
2316e5355d freetype/raster: new Path and Stroke API.
The stroking algorithm is a placeholder. A proper one will land in a
future change once the API is agreed upon.

R=r, rsc
CC=golang-dev, rog
http://codereview.appspot.com/1708045
2010-06-23 17:38:35 +10:00
Roger Peppe
bfc68b0d61 Fix raster.Point.String() for new Printf semantics
R=nigeltao_golang, r2
CC=golang-dev
http://codereview.appspot.com/1728041

Committer: Nigel Tao <nigeltao@golang.org>
2010-06-18 11:19:04 +10:00
Nigel Tao
9858718c4d Freetype-Go: Add lib/codereview/codereview.cfg.
R=rsc
CC=golang-dev
http://codereview.appspot.com/1392041
2010-05-28 14:17:10 -07:00
Nigel Tao
638bb958f7 Freetype-Go: image.Color.RGBA now returns 16 bit color instead of
32 bit.

R=rsc
CC=golang-dev
http://codereview.appspot.com/1389041
2010-05-28 12:59:38 -07:00
Nigel Tao
5836d0e202 Freetype-Go: take the RGBAPainter out of a RGBAContext. Instead,
a Context can now take any Painter during DrawText.

R=r
CC=rog, golang-dev
http://codereview.appspot.com/1341041
2010-05-27 22:22:49 -07:00
Nigel Tao
0c4b93bdc3 Freetype-Go: move the pixel offset from the painter to the rasterizer.
R=rsc, r
CC=rog, golang-dev
http://codereview.appspot.com/1332041
2010-05-26 13:23:24 -07:00
Nigel Tao
aaeb64cef7 Freetype-Go: A+C: add Roger Peppe.
Roger is already in the A+C list for the main Go repo.

R=r
CC=rog, golang-dev
http://codereview.appspot.com/1313043
2010-05-26 13:22:55 -07:00
Nigel Tao
8552c06628 Freetype-Go: Paint now takes an explicit done bool instead of using a
magic zero value to indicate end of painting.

This means that Painter implementations can assume thant the Spans' Y
values are monotonic.

R=rsc
CC=golang-dev, rog
http://codereview.appspot.com/1261043
2010-05-21 15:09:13 -07:00
Nigel Tao
7707aeaf6a Freetype-Go: support compound glyphs.
R=r
CC=golang-dev
http://codereview.appspot.com/1196045
2010-05-20 05:30:00 -07:00
Nigel Tao
9c4da76964 Freetype-Go: gamma is now a float instead of a float64.
R=r
CC=golang-dev
http://codereview.appspot.com/1236042
2010-05-19 17:37:01 -07:00
Nigel Tao
25c38cfec1 Freetype-Go: new freetype package to provide a convenience API to
draw text onto an image.

This is a simple API that doesn't handle line breaking, ligatures,
right-to-left or vertical scripts, and other fancy features.

R=r, rsc
CC=golang-dev
http://codereview.appspot.com/1121045
2010-05-14 13:29:53 +10:00
Nigel Tao
7b02573579 Freetype-Go: fast-path vertical lines in the rasterizer.
This follows ftgrays.c in the C Freetype code.
http://www.google.com/codesearch/p?hl=en#Z2JqmT2tnYQ/Amaya/Distribution/amaya-lib-src-9.54.tgz%7CcsdX8RtClJ4/freetype/src/smooth/ftgrays.c&l=653

R=rsc
CC=golang-dev
http://codereview.appspot.com/1155041
2010-05-10 10:46:39 +10:00
Nigel Tao
f6caa104ec Freetype-Go: truetype parser initial check-in.
Parsing a malformed TTF may result in an index out-of-bounds panic,
rather than guaranteeing to return an error. This may be tightened
in the future.

R=r, rsc
CC=golang-dev
http://codereview.appspot.com/940044
2010-05-04 09:54:43 +10:00
Nigel Tao
01b35309ee Fix luxi-fonts/README to say there are only 3 fonts, not 12. 2010-04-29 08:56:26 +10:00
Nigel Tao
6023e5b75d Freetype-Go: Add Luxi .ttf fonts, and the human-readable .ttx equivalents.
This is a manual hg commit of codereview change 982044
	http://codereview.appspot.com/982044

	The codereview submission did not work, possibly because some of the
	files were too large.
2010-04-28 22:25:52 +10:00
Nigel Tao
4aa7375072 Freetype-Go: batch Spans when painting.
Introduce MonochromePainter and GammaCorrectionPainter.

R=r, rsc
CC=golang-dev
http://codereview.appspot.com/904041
2010-04-13 22:26:10 +10:00
Nigel Tao
593a182c4e Freetype-Go: Implement cubic splines; rename MoveN to AddN.
R=rsc
CC=golang-dev, r
http://codereview.appspot.com/894041
2010-04-06 21:25:48 +10:00
Nigel Tao
14f2df1aef Freetype-Go: Initial code check-in.
R=r, rsc
CC=golang-dev
http://codereview.appspot.com/841042
2010-04-02 10:07:24 +11:00
nigeltao
5b17c09a3a Initial check-in. 2010-04-02 02:20:35 +11:00