freetype/truetype: upgrade testdata to C Freetype 2.5.1.

R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/33650044
This commit is contained in:
Nigel Tao 2013-11-28 14:02:28 +11:00
parent 02a88bab17
commit 1c0c5a1f9a
5 changed files with 30 additions and 7 deletions

View File

@ -43,12 +43,7 @@ int main(int argc, char** argv) {
return 1;
}
FT_Library_Version(library, &major, &minor, &patch);
if ((major < 2) || ((major == 2) && (minor < 5))) {
fprintf(stderr, "%s needs freetype version >= 2.5.\n"
"Try setting LD_LIBRARY_PATH=/path/to/freetype_built_from_src/objs/.libs/\n",
argv[0]);
return 1;
}
printf("freetype version %d.%d.%d\n", major, minor, patch);
error = FT_New_Face(library, argv[2], 0, &face);
if (error) {
fprintf(stderr, "FT_New_Face: error #%d\n", error);

View File

@ -262,9 +262,14 @@ var scalingTestCases = []struct {
}
var scalingExceptions = map[string]map[int]bool{
// TODO: remove these exceptions when C Freetype version 2.5.1 is released:
// TODO: fix these exceptions now that C Freetype version 2.5.1 is released:
// see http://lists.nongnu.org/archive/html/freetype/2013-11/msg00004.html
"x-deja-vu-sans-oblique": map[int]bool{
269: true,
733: true,
734: true,
2071: true,
2072: true,
2077: true,
2078: true,
2171: true,
@ -299,6 +304,23 @@ func testScaling(t *testing.T, hinter *Hinter) {
wants := [][]Point{}
scanner := bufio.NewScanner(f)
if scanner.Scan() {
major, minor, patch := 0, 0, 0
_, err := fmt.Sscanf(scanner.Text(), "freetype version %d.%d.%d", &major, &minor, &patch)
if err != nil {
t.Errorf("%s: version information: %v", tc.name, err)
}
if (major < 2) || (major == 2 && minor < 5) || (major == 2 && minor == 5 && patch < 1) {
t.Errorf("%s: need freetype version >= 2.5.1.\n"+
"Try setting LD_LIBRARY_PATH=/path/to/freetype_built_from_src/objs/.libs/\n"+
"and re-running testdata/make-other-hinting-txts.sh",
tc.name)
continue
}
} else {
t.Errorf("%s: no version information", tc.name)
continue
}
for scanner.Scan() {
wants = append(wants, scalingTestParse(scanner.Text()))
}

View File

@ -1,3 +1,4 @@
freetype version 2.5.1
21 0 1, 21 555 1, 192 555 1, 192 0 1, 171 21 1, 171 534 1, 43 534 1, 43 21 1

View File

@ -1,3 +1,4 @@
freetype version 2.5.1
0 0 1, 0 576 1, 192 576 1, 192 0 1, 128 64 1, 128 512 1, 64 512 1, 64 64 1

View File

@ -18,6 +18,10 @@ ln -sf $FONTDIR/ttf-dejavu/DejaVuSans-Oblique.ttf x-deja-vu-sans-oblique.ttf
${CC:=gcc} ../cmd/print-glyph-points/main.c $(pkg-config --cflags --libs freetype2) -o print-glyph-points
# Uncomment these lines to also recreate the luxisr-*-hinting.txt files.
# ./print-glyph-points 12 luxisr.ttf sans_hinting > luxisr-12pt-sans-hinting.txt
# ./print-glyph-points 12 luxisr.ttf with_hinting > luxisr-12pt-with-hinting.txt
./print-glyph-points 9 x-droid-sans-japanese.ttf sans_hinting > x-droid-sans-japanese-9pt-sans-hinting.txt
./print-glyph-points 9 x-droid-sans-japanese.ttf with_hinting > x-droid-sans-japanese-9pt-with-hinting.txt
./print-glyph-points 11 x-arial-bold.ttf sans_hinting > x-arial-bold-11pt-sans-hinting.txt