diff --git a/example/capjoin/main.go b/example/capjoin/main.go index c19ba80..e4443da 100644 --- a/example/capjoin/main.go +++ b/example/capjoin/main.go @@ -3,7 +3,9 @@ // FreeType License or the GNU General Public License version 2 (or // any later version), both of which can be found in the LICENSE file. +//go:build example // +build example + // // This build tag means that "go install github.com/golang/freetype/..." // doesn't install this example program. Use "go run main.go" to run it or "go @@ -21,8 +23,8 @@ import ( "log" "os" + "git.fireandbrimst.one/aw/golang-image/math/fixed" "github.com/golang/freetype/raster" - "git.gutmet.org/golang-image.git/math/fixed" ) func main() { diff --git a/example/drawer/main.go b/example/drawer/main.go index 9cd398a..da43c82 100644 --- a/example/drawer/main.go +++ b/example/drawer/main.go @@ -3,7 +3,9 @@ // FreeType License or the GNU General Public License version 2 (or // any later version), both of which can be found in the LICENSE file. +//go:build example // +build example + // // This build tag means that "go install github.com/golang/freetype/..." // doesn't install this example program. Use "go run main.go" to run it or "go @@ -24,9 +26,9 @@ import ( "math" "os" + "git.fireandbrimst.one/aw/golang-image/font" + "git.fireandbrimst.one/aw/golang-image/math/fixed" "github.com/golang/freetype/truetype" - "git.gutmet.org/golang-image.git/font" - "git.gutmet.org/golang-image.git/math/fixed" ) var ( diff --git a/example/freetype/main.go b/example/freetype/main.go index 5dda0aa..979b292 100644 --- a/example/freetype/main.go +++ b/example/freetype/main.go @@ -3,7 +3,9 @@ // FreeType License or the GNU General Public License version 2 (or // any later version), both of which can be found in the LICENSE file. +//go:build example // +build example + // // This build tag means that "go install github.com/golang/freetype/..." // doesn't install this example program. Use "go run main.go" to run it or "go @@ -23,8 +25,8 @@ import ( "log" "os" + "git.fireandbrimst.one/aw/golang-image/font" "github.com/golang/freetype" - "git.gutmet.org/golang-image.git/font" ) var ( diff --git a/example/gamma/main.go b/example/gamma/main.go index 878448f..3e45bee 100644 --- a/example/gamma/main.go +++ b/example/gamma/main.go @@ -3,7 +3,9 @@ // FreeType License or the GNU General Public License version 2 (or // any later version), both of which can be found in the LICENSE file. +//go:build example // +build example + // // This build tag means that "go install github.com/golang/freetype/..." // doesn't install this example program. Use "go run main.go" to run it or "go @@ -20,8 +22,8 @@ import ( "log" "os" + "git.fireandbrimst.one/aw/golang-image/math/fixed" "github.com/golang/freetype/raster" - "git.gutmet.org/golang-image.git/math/fixed" ) func p(x, y int) fixed.Point26_6 { diff --git a/example/genbasicfont/main.go b/example/genbasicfont/main.go index 74528b2..afc0d57 100644 --- a/example/genbasicfont/main.go +++ b/example/genbasicfont/main.go @@ -3,14 +3,16 @@ // FreeType License or the GNU General Public License version 2 (or // any later version), both of which can be found in the LICENSE file. +//go:build example // +build example + // // This build tag means that "go install github.com/golang/freetype/..." // doesn't install this example program. Use "go run main.go" to run it or "go // install -tags=example" to install it. // Program genbasicfont generates Go source code that imports -// git.gutmet.org/golang-image.git/font/basicfont to provide a fixed width font face. +// git.fireandbrimst.one/aw/golang-image/font/basicfont to provide a fixed width font face. package main import ( @@ -26,9 +28,9 @@ import ( "strings" "unicode" + "git.fireandbrimst.one/aw/golang-image/font" + "git.fireandbrimst.one/aw/golang-image/math/fixed" "github.com/golang/freetype/truetype" - "git.gutmet.org/golang-image.git/font" - "git.gutmet.org/golang-image.git/math/fixed" ) var ( @@ -203,7 +205,7 @@ func main() { buf := new(bytes.Buffer) fmt.Fprintf(buf, "// generated by go generate; DO NOT EDIT.\n\npackage %s\n\n", *pkg) - fmt.Fprintf(buf, "import (\n\"image\"\n\n\"git.gutmet.org/golang-image.git/font/basicfont\"\n)\n\n") + fmt.Fprintf(buf, "import (\n\"image\"\n\n\"git.fireandbrimst.one/aw/golang-image/font/basicfont\"\n)\n\n") fmt.Fprintf(buf, "// %s contains %d %d×%d glyphs in %d Pix bytes.\n", *vr, len(glyphs), width, height, len(glyphs)*width*height) fmt.Fprintf(buf, `var %s = basicfont.Face{ diff --git a/example/raster/main.go b/example/raster/main.go index ac409d9..3ac2d53 100644 --- a/example/raster/main.go +++ b/example/raster/main.go @@ -3,7 +3,9 @@ // FreeType License or the GNU General Public License version 2 (or // any later version), both of which can be found in the LICENSE file. +//go:build example // +build example + // // This build tag means that "go install github.com/golang/freetype/..." // doesn't install this example program. Use "go run main.go" to run it or "go @@ -21,8 +23,8 @@ import ( "log" "os" + "git.fireandbrimst.one/aw/golang-image/math/fixed" "github.com/golang/freetype/raster" - "git.gutmet.org/golang-image.git/math/fixed" ) type node struct { diff --git a/example/round/main.go b/example/round/main.go index f87b108..a9f027b 100644 --- a/example/round/main.go +++ b/example/round/main.go @@ -3,7 +3,9 @@ // FreeType License or the GNU General Public License version 2 (or // any later version), both of which can be found in the LICENSE file. +//go:build example // +build example + // // This build tag means that "go install github.com/golang/freetype/..." // doesn't install this example program. Use "go run main.go" to run it or "go @@ -27,8 +29,8 @@ import ( "math" "os" + "git.fireandbrimst.one/aw/golang-image/math/fixed" "github.com/golang/freetype/raster" - "git.gutmet.org/golang-image.git/math/fixed" ) // pDot returns the dot product p·q. diff --git a/example/truetype/main.go b/example/truetype/main.go index a73f52a..9620b18 100644 --- a/example/truetype/main.go +++ b/example/truetype/main.go @@ -3,7 +3,9 @@ // FreeType License or the GNU General Public License version 2 (or // any later version), both of which can be found in the LICENSE file. +//go:build example // +build example + // // This build tag means that "go install github.com/golang/freetype/..." // doesn't install this example program. Use "go run main.go" to run it or "go @@ -17,9 +19,9 @@ import ( "io/ioutil" "log" + "git.fireandbrimst.one/aw/golang-image/font" + "git.fireandbrimst.one/aw/golang-image/math/fixed" "github.com/golang/freetype/truetype" - "git.gutmet.org/golang-image.git/font" - "git.gutmet.org/golang-image.git/math/fixed" ) var fontfile = flag.String("fontfile", "../../testdata/luxisr.ttf", "filename of the ttf font") diff --git a/freetype.go b/freetype.go index c35c598..c031ca3 100644 --- a/freetype.go +++ b/freetype.go @@ -6,17 +6,17 @@ // The freetype package provides a convenient API to draw text onto an image. // Use the freetype/raster and freetype/truetype packages for lower level // control over rasterization and TrueType parsing. -package freetype // import "git.gutmet.org/golang-freetype.git" +package freetype // import "git.fireandbrimst.one/aw/golang-freetype" import ( "errors" "image" "image/draw" - "git.gutmet.org/golang-freetype.git/raster" - "git.gutmet.org/golang-freetype.git/truetype" - "git.gutmet.org/golang-image.git/font" - "git.gutmet.org/golang-image.git/math/fixed" + "git.fireandbrimst.one/aw/golang-freetype/raster" + "git.fireandbrimst.one/aw/golang-freetype/truetype" + "git.fireandbrimst.one/aw/golang-image/font" + "git.fireandbrimst.one/aw/golang-image/math/fixed" ) // These constants determine the size of the glyph cache. The cache is keyed diff --git a/raster/geom.go b/raster/geom.go index 6d81b9e..deec854 100644 --- a/raster/geom.go +++ b/raster/geom.go @@ -9,7 +9,7 @@ import ( "fmt" "math" - "git.gutmet.org/golang-image.git/math/fixed" + "git.fireandbrimst.one/aw/golang-image/math/fixed" ) // maxAbs returns the maximum of abs(a) and abs(b). diff --git a/raster/raster.go b/raster/raster.go index 4c33670..59135f5 100644 --- a/raster/raster.go +++ b/raster/raster.go @@ -13,12 +13,12 @@ // the Freetype "smooth" module, and the Anti-Grain Geometry library. A // description of the area/coverage algorithm is at // http://projects.tuxee.net/cl-vectors/section-the-cl-aa-algorithm -package raster // import "git.gutmet.org/golang-freetype.git/raster" +package raster // import "git.fireandbrimst.one/aw/golang-freetype/raster" import ( "strconv" - "git.gutmet.org/golang-image.git/math/fixed" + "git.fireandbrimst.one/aw/golang-image/math/fixed" ) // A cell is part of a linked list (for a given yi co-ordinate) of accumulated diff --git a/raster/stroke.go b/raster/stroke.go index 4ea895a..9774e44 100644 --- a/raster/stroke.go +++ b/raster/stroke.go @@ -6,7 +6,7 @@ package raster import ( - "git.gutmet.org/golang-image.git/math/fixed" + "git.fireandbrimst.one/aw/golang-image/math/fixed" ) // Two points are considered practically equal if the square of the distance diff --git a/truetype/face.go b/truetype/face.go index 9f2e93b..c555ffe 100644 --- a/truetype/face.go +++ b/truetype/face.go @@ -9,9 +9,9 @@ import ( "image" "math" - "git.gutmet.org/golang-freetype.git/raster" - "git.gutmet.org/golang-image.git/font" - "git.gutmet.org/golang-image.git/math/fixed" + "git.fireandbrimst.one/aw/golang-freetype/raster" + "git.fireandbrimst.one/aw/golang-image/font" + "git.fireandbrimst.one/aw/golang-image/math/fixed" ) func powerOf2(i int) bool { @@ -134,11 +134,12 @@ func (o *Options) subPixelsY() (value uint32, halfQuantum, mask fixed.Int26_6) { // // For example, q == 4 leads to a bias of 8 and a mask of 0xfffffff0, or -16, // because we want to round fractions of fixed.Int26_6 as: -// - 0 to 7 rounds to 0. -// - 8 to 23 rounds to 16. -// - 24 to 39 rounds to 32. -// - 40 to 55 rounds to 48. -// - 56 to 63 rounds to 64. +// - 0 to 7 rounds to 0. +// - 8 to 23 rounds to 16. +// - 24 to 39 rounds to 32. +// - 40 to 55 rounds to 48. +// - 56 to 63 rounds to 64. +// // which means to add 8 and then bitwise-and with -16, in two's complement // representation. // diff --git a/truetype/face_test.go b/truetype/face_test.go index 46a863f..55da9f1 100644 --- a/truetype/face_test.go +++ b/truetype/face_test.go @@ -12,8 +12,8 @@ import ( "strings" "testing" - "git.gutmet.org/golang-image.git/font" - "git.gutmet.org/golang-image.git/math/fixed" + "git.fireandbrimst.one/aw/golang-image/font" + "git.fireandbrimst.one/aw/golang-image/math/fixed" ) func BenchmarkDrawString(b *testing.B) { diff --git a/truetype/glyph.go b/truetype/glyph.go index dc947eb..6d8f2e2 100644 --- a/truetype/glyph.go +++ b/truetype/glyph.go @@ -6,8 +6,8 @@ package truetype import ( - "git.gutmet.org/golang-image.git/font" - "git.gutmet.org/golang-image.git/math/fixed" + "git.fireandbrimst.one/aw/golang-image/font" + "git.fireandbrimst.one/aw/golang-image/math/fixed" ) // TODO: implement VerticalHinting. diff --git a/truetype/hint.go b/truetype/hint.go index c51f759..462380b 100644 --- a/truetype/hint.go +++ b/truetype/hint.go @@ -12,7 +12,7 @@ import ( "errors" "math" - "git.gutmet.org/golang-image.git/math/fixed" + "git.fireandbrimst.one/aw/golang-image/math/fixed" ) const ( @@ -1677,11 +1677,13 @@ func fmul(x, y fixed.Int26_6) fixed.Int26_6 { } // dotProduct returns the dot product of [x, y] and q. It is almost the same as +// // px := int64(x) // py := int64(y) // qx := int64(q[0]) // qy := int64(q[1]) // return fixed.Int26_6((px*qx + py*qy + 1<<13) >> 14) +// // except that the computation is done with 32-bit integers to produce exactly // the same rounding behavior as C Freetype. func dotProduct(x, y fixed.Int26_6, q [2]f2dot14) fixed.Int26_6 { diff --git a/truetype/hint_test.go b/truetype/hint_test.go index ab0cb9f..fcf0c52 100644 --- a/truetype/hint_test.go +++ b/truetype/hint_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "git.gutmet.org/golang-image.git/math/fixed" + "git.fireandbrimst.one/aw/golang-image/math/fixed" ) func TestBytecode(t *testing.T) { diff --git a/truetype/truetype.go b/truetype/truetype.go index 9997c1f..ceb12d0 100644 --- a/truetype/truetype.go +++ b/truetype/truetype.go @@ -15,12 +15,12 @@ // // To measure a TrueType font in ideal FUnit space, use scale equal to // font.FUnitsPerEm(). -package truetype // import "git.gutmet.org/golang-freetype.git/truetype" +package truetype // import "git.fireandbrimst.one/aw/golang-freetype/truetype" import ( "fmt" - "git.gutmet.org/golang-image.git/math/fixed" + "git.fireandbrimst.one/aw/golang-image/math/fixed" ) // An Index is a Font's index of a rune. diff --git a/truetype/truetype_test.go b/truetype/truetype_test.go index 31a761b..91a8613 100644 --- a/truetype/truetype_test.go +++ b/truetype/truetype_test.go @@ -15,8 +15,8 @@ import ( "strings" "testing" - "git.gutmet.org/golang-image.git/font" - "git.gutmet.org/golang-image.git/math/fixed" + "git.fireandbrimst.one/aw/golang-image/font" + "git.fireandbrimst.one/aw/golang-image/math/fixed" ) func parseTestdataFont(name string) (f *Font, testdataIsOptional bool, err error) {