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
This commit is contained in:
parent
0ec7c0ecae
commit
b968fb0953
5
LICENSE
5
LICENSE
|
@ -8,6 +8,5 @@ The text of these licenses are available in the licenses/ftl.txt and the
|
||||||
licenses/gpl.txt files respectively. They are also available at
|
licenses/gpl.txt files respectively. They are also available at
|
||||||
http://freetype.sourceforge.net/license.html
|
http://freetype.sourceforge.net/license.html
|
||||||
|
|
||||||
The files in the luxi-fonts directory are licensed separately. See the
|
The Luxi fonts in the testdata directory are licensed separately. See the
|
||||||
luxi-fonts/COPYING file for details.
|
testdata/COPYING file for details.
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ int main(int argc, char** argv) {
|
||||||
printf("FT_Init_FreeType: error #%d\n", error);
|
printf("FT_Init_FreeType: error #%d\n", error);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
error = FT_New_Face(library, "../../luxi-fonts/luxisr.ttf", 0, &face);
|
error = FT_New_Face(library, "../../testdata/luxisr.ttf", 0, &face);
|
||||||
if (error) {
|
if (error) {
|
||||||
printf("FT_New_Face: error #%d\n", error);
|
printf("FT_New_Face: error #%d\n", error);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -22,7 +22,7 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
dpi = flag.Float64("dpi", 72, "screen resolution in Dots Per Inch")
|
dpi = flag.Float64("dpi", 72, "screen resolution in Dots Per Inch")
|
||||||
fontfile = flag.String("fontfile", "../../luxi-fonts/luxisr.ttf", "filename of the ttf font")
|
fontfile = flag.String("fontfile", "../../testdata/luxisr.ttf", "filename of the ttf font")
|
||||||
size = flag.Float64("size", 12, "font size in points")
|
size = flag.Float64("size", 12, "font size in points")
|
||||||
spacing = flag.Float64("spacing", 1.5, "line spacing (e.g. 2 means double spaced)")
|
spacing = flag.Float64("spacing", 1.5, "line spacing (e.g. 2 means double spaced)")
|
||||||
wonb = flag.Bool("whiteonblack", false, "white text on a black background")
|
wonb = flag.Bool("whiteonblack", false, "white text on a black background")
|
||||||
|
|
|
@ -14,7 +14,7 @@ import (
|
||||||
"code.google.com/p/freetype-go/freetype/truetype"
|
"code.google.com/p/freetype-go/freetype/truetype"
|
||||||
)
|
)
|
||||||
|
|
||||||
var fontfile = flag.String("fontfile", "../../luxi-fonts/luxisr.ttf", "filename of the ttf font")
|
var fontfile = flag.String("fontfile", "../../testdata/luxisr.ttf", "filename of the ttf font")
|
||||||
|
|
||||||
func printBounds(b truetype.Bounds) {
|
func printBounds(b truetype.Bounds) {
|
||||||
fmt.Printf("XMin:%d YMin:%d XMax:%d YMax:%d\n", b.XMin, b.YMin, b.XMax, b.YMax)
|
fmt.Printf("XMin:%d YMin:%d XMax:%d YMax:%d\n", b.XMin, b.YMin, b.XMax, b.YMax)
|
||||||
|
|
|
@ -21,7 +21,7 @@ func BenchmarkDrawString(b *testing.B) {
|
||||||
}
|
}
|
||||||
lines := strings.Split(string(data), "\n")
|
lines := strings.Split(string(data), "\n")
|
||||||
|
|
||||||
data, err = ioutil.ReadFile("../luxi-fonts/luxisr.ttf")
|
data, err = ioutil.ReadFile("../testdata/luxisr.ttf")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
b.Fatal(err)
|
b.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ import (
|
||||||
// TestParse tests that the luxisr.ttf metrics and glyphs are parsed correctly.
|
// TestParse tests that the luxisr.ttf metrics and glyphs are parsed correctly.
|
||||||
// The numerical values can be manually verified by examining luxisr.ttx.
|
// The numerical values can be manually verified by examining luxisr.ttx.
|
||||||
func TestParse(t *testing.T) {
|
func TestParse(t *testing.T) {
|
||||||
b, err := ioutil.ReadFile("../../luxi-fonts/luxisr.ttf")
|
b, err := ioutil.ReadFile("../../testdata/luxisr.ttf")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ func TestParse(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func testScaling(t *testing.T, filename string, hinter *Hinter) {
|
func testScaling(t *testing.T, filename string, hinter *Hinter) {
|
||||||
b, err := ioutil.ReadFile("../../luxi-fonts/luxisr.ttf")
|
b, err := ioutil.ReadFile("../../testdata/luxisr.ttf")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("ReadFile: %v", err)
|
t.Fatalf("ReadFile: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ func testScaling(t *testing.T, filename string, hinter *Hinter) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Parse: %v", err)
|
t.Fatalf("Parse: %v", err)
|
||||||
}
|
}
|
||||||
f, err := os.Open("../../luxi-fonts/" + filename)
|
f, err := os.Open("../../testdata/" + filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Open: %v", err)
|
t.Fatalf("Open: %v", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue