freetype: import path gofixes.
Also update freetype/truetype for s/int/rune/. R=rsc, bradfitz CC=golang-dev http://codereview.appspot.com/5505067
This commit is contained in:
parent
97ddbbf4d0
commit
97fe2fb9c1
10 changed files with 16 additions and 14 deletions
|
@ -9,7 +9,6 @@ import (
|
|||
"bufio"
|
||||
"flag"
|
||||
"fmt"
|
||||
"freetype-go.googlecode.com/hg/freetype"
|
||||
"image"
|
||||
"image/color"
|
||||
"image/draw"
|
||||
|
@ -17,6 +16,8 @@ import (
|
|||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"code.google.com/p/freetype-go/freetype"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -14,7 +14,7 @@ import (
|
|||
"log"
|
||||
"os"
|
||||
|
||||
"freetype-go.googlecode.com/hg/freetype/raster"
|
||||
"code.google.com/p/freetype-go/freetype/raster"
|
||||
)
|
||||
|
||||
func p(x, y int) raster.Point {
|
||||
|
|
|
@ -15,7 +15,7 @@ import (
|
|||
"log"
|
||||
"os"
|
||||
|
||||
"freetype-go.googlecode.com/hg/freetype/raster"
|
||||
"code.google.com/p/freetype-go/freetype/raster"
|
||||
)
|
||||
|
||||
type node struct {
|
||||
|
|
|
@ -21,7 +21,7 @@ import (
|
|||
"math"
|
||||
"os"
|
||||
|
||||
"freetype-go.googlecode.com/hg/freetype/raster"
|
||||
"code.google.com/p/freetype-go/freetype/raster"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -11,7 +11,7 @@ import (
|
|||
"io/ioutil"
|
||||
"log"
|
||||
|
||||
"freetype-go.googlecode.com/hg/freetype/truetype"
|
||||
"code.google.com/p/freetype-go/freetype/truetype"
|
||||
)
|
||||
|
||||
var fontfile = flag.String("fontfile", "../../luxi-fonts/luxisr.ttf", "filename of the ttf font")
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
include $(GOROOT)/src/Make.inc
|
||||
|
||||
TARG=freetype-go.googlecode.com/hg/freetype
|
||||
TARG=code.google.com/p/freetype-go/freetype
|
||||
GOFILES=\
|
||||
freetype.go\
|
||||
|
||||
|
|
|
@ -10,10 +10,11 @@ package freetype
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"freetype-go.googlecode.com/hg/freetype/raster"
|
||||
"freetype-go.googlecode.com/hg/freetype/truetype"
|
||||
"image"
|
||||
"image/draw"
|
||||
|
||||
"code.google.com/p/freetype-go/freetype/raster"
|
||||
"code.google.com/p/freetype-go/freetype/truetype"
|
||||
)
|
||||
|
||||
// These constants determine the size of the glyph cache. The cache is keyed
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
include $(GOROOT)/src/Make.inc
|
||||
|
||||
TARG=freetype-go.googlecode.com/hg/freetype/raster
|
||||
TARG=code.google.com/p/freetype-go/freetype/raster
|
||||
GOFILES=\
|
||||
geom.go\
|
||||
paint.go\
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
include $(GOROOT)/src/Make.inc
|
||||
|
||||
TARG=freetype-go.googlecode.com/hg/freetype/truetype
|
||||
TARG=code.google.com/p/freetype-go/freetype/truetype
|
||||
GOFILES=\
|
||||
truetype.go\
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import (
|
|||
"fmt"
|
||||
)
|
||||
|
||||
// An Index is a Font's index of a Unicode code point.
|
||||
// An Index is a Font's index of a rune.
|
||||
type Index uint16
|
||||
|
||||
// A Bounds holds the co-ordinate range of one or more glyphs.
|
||||
|
@ -287,9 +287,9 @@ func (f *Font) UnitsPerEm() int {
|
|||
return f.unitsPerEm
|
||||
}
|
||||
|
||||
// Index returns a Font's index for the given Unicode code point.
|
||||
func (f *Font) Index(codePoint int) Index {
|
||||
c := uint16(codePoint)
|
||||
// Index returns a Font's index for the given rune.
|
||||
func (f *Font) Index(x rune) Index {
|
||||
c := uint16(x)
|
||||
n := len(f.cm)
|
||||
for i := 0; i < n; i++ {
|
||||
if f.cm[i].start <= c && c <= f.cm[i].end {
|
||||
|
|
Loading…
Reference in a new issue