diff --git a/ebitenutil/debugprint.go b/ebitenutil/debugprint.go index 59aae90a6..604c3fcad 100644 --- a/ebitenutil/debugprint.go +++ b/ebitenutil/debugprint.go @@ -22,15 +22,10 @@ import ( ) var ( - debugPrintTextImage *ebiten.Image + debugPrintTextImage = ebiten.NewImageFromImage(assets.CreateTextImage()) debugPrintTextSubImages = map[rune]*ebiten.Image{} ) -func init() { - img := assets.CreateTextImage() - debugPrintTextImage, _ = ebiten.NewImageFromImage(img) -} - // DebugPrint draws the string str on the image on left top corner. // // The available runes are in U+0000 to U+00FF, which is C0 Controls and Basic Latin and C1 Controls and Latin-1 Supplement. diff --git a/ebitenutil/loadimage.go b/ebitenutil/loadimage.go index 99ecd9bad..3f2f0648a 100644 --- a/ebitenutil/loadimage.go +++ b/ebitenutil/loadimage.go @@ -45,9 +45,6 @@ func NewImageFromFile(path string) (*ebiten.Image, image.Image, error) { if err != nil { return nil, nil, err } - img2, err := ebiten.NewImageFromImage(img) - if err != nil { - return nil, nil, err - } + img2 := ebiten.NewImageFromImage(img) return img2, img, err } diff --git a/ebitenutil/url.go b/ebitenutil/url.go index 57ce9f571..97980ed54 100644 --- a/ebitenutil/url.go +++ b/ebitenutil/url.go @@ -37,6 +37,6 @@ func NewImageFromURL(url string) (*ebiten.Image, error) { return nil, err } - eimg, _ := ebiten.NewImageFromImage(img) + eimg := ebiten.NewImageFromImage(img) return eimg, nil } diff --git a/examples/additive/main.go b/examples/additive/main.go index 5e4491e78..372dcb098 100644 --- a/examples/additive/main.go +++ b/examples/additive/main.go @@ -82,7 +82,7 @@ func main() { if err != nil { log.Fatal(err) } - ebitenImage, _ = ebiten.NewImageFromImage(img) + ebitenImage = ebiten.NewImageFromImage(img) ebiten.SetWindowSize(screenWidth*2, screenHeight*2) ebiten.SetWindowTitle("Additive Blending (Ebiten Demo)") diff --git a/examples/address/main.go b/examples/address/main.go index 458004252..da264c62f 100644 --- a/examples/address/main.go +++ b/examples/address/main.go @@ -48,7 +48,7 @@ func init() { if err != nil { log.Fatal(err) } - ebitenImage, _ = ebiten.NewImageFromImage(img) + ebitenImage = ebiten.NewImageFromImage(img) } func drawRect(screen *ebiten.Image, img *ebiten.Image, x, y, width, height float32, address ebiten.Address, msg string) { diff --git a/examples/airship/main.go b/examples/airship/main.go index a0e85f678..351629f25 100644 --- a/examples/airship/main.go +++ b/examples/airship/main.go @@ -61,7 +61,7 @@ func init() { if err != nil { log.Fatal(err) } - gophersImage, _ = ebiten.NewImageFromImage(img) + gophersImage = ebiten.NewImageFromImage(img) const repeat = 5 w, h := gophersImage.Size() @@ -89,7 +89,7 @@ func init() { fogRGBA.SetRGBA(i, j, clr) } } - fogImage, _ = ebiten.NewImageFromImage(fogRGBA) + fogImage = ebiten.NewImageFromImage(fogRGBA) } // player represents the current airship's position. diff --git a/examples/alphablending/main.go b/examples/alphablending/main.go index c7bb1f203..981cbb2d4 100644 --- a/examples/alphablending/main.go +++ b/examples/alphablending/main.go @@ -91,7 +91,7 @@ func main() { if err != nil { log.Fatal(err) } - ebitenImage, _ = ebiten.NewImageFromImage(img) + ebitenImage = ebiten.NewImageFromImage(img) ebiten.SetWindowSize(screenWidth*2, screenHeight*2) ebiten.SetWindowTitle("Alpha Blending (Ebiten Demo)") diff --git a/examples/animation/main.go b/examples/animation/main.go index 4562acfc9..acf33abb3 100644 --- a/examples/animation/main.go +++ b/examples/animation/main.go @@ -77,7 +77,7 @@ func main() { if err != nil { log.Fatal(err) } - runnerImage, _ = ebiten.NewImageFromImage(img) + runnerImage = ebiten.NewImageFromImage(img) ebiten.SetWindowSize(screenWidth*2, screenHeight*2) ebiten.SetWindowTitle("Animation (Ebiten Demo)") diff --git a/examples/audiopanning/main.go b/examples/audiopanning/main.go index dc504f5f0..f9cd1d6e9 100644 --- a/examples/audiopanning/main.go +++ b/examples/audiopanning/main.go @@ -132,7 +132,7 @@ func main() { if err != nil { log.Fatal(err) } - img, _ = ebiten.NewImageFromImage(rawimg) + img = ebiten.NewImageFromImage(rawimg) ebiten.SetWindowSize(screenWidth*2, screenHeight*2) ebiten.SetWindowTitle("Audio Panning Loop (Ebiten Demo)") diff --git a/examples/blocks/blocks/gamescene.go b/examples/blocks/blocks/gamescene.go index 86bf2ddda..ad853546e 100644 --- a/examples/blocks/blocks/gamescene.go +++ b/examples/blocks/blocks/gamescene.go @@ -76,7 +76,7 @@ func init() { if err != nil { panic(err) } - imageGameBG, _ = ebiten.NewImageFromImage(img) + imageGameBG = ebiten.NewImageFromImage(img) // Windows: Field x, y := fieldWindowPosition() diff --git a/examples/blocks/blocks/piece.go b/examples/blocks/blocks/piece.go index f202ed2b6..1019746c2 100644 --- a/examples/blocks/blocks/piece.go +++ b/examples/blocks/blocks/piece.go @@ -30,7 +30,7 @@ func init() { if err != nil { panic(err) } - imageBlocks, _ = ebiten.NewImageFromImage(img) + imageBlocks = ebiten.NewImageFromImage(img) } diff --git a/examples/blocks/blocks/titlescene.go b/examples/blocks/blocks/titlescene.go index d39ea1752..d3d97c298 100644 --- a/examples/blocks/blocks/titlescene.go +++ b/examples/blocks/blocks/titlescene.go @@ -32,7 +32,7 @@ func init() { if err != nil { panic(err) } - imageBackground, _ = ebiten.NewImageFromImage(img) + imageBackground = ebiten.NewImageFromImage(img) } type TitleScene struct { diff --git a/examples/blur/main.go b/examples/blur/main.go index 1d6112cb2..161f57c96 100644 --- a/examples/blur/main.go +++ b/examples/blur/main.go @@ -82,7 +82,7 @@ func main() { if err != nil { log.Fatal(err) } - gophersImage, _ = ebiten.NewImageFromImage(img) + gophersImage = ebiten.NewImageFromImage(img) ebiten.SetWindowSize(screenWidth, screenHeight) ebiten.SetWindowTitle("Blur (Ebiten Demo)") diff --git a/examples/camera/main.go b/examples/camera/main.go index 45f0a05b6..9cc5bebe2 100644 --- a/examples/camera/main.go +++ b/examples/camera/main.go @@ -65,7 +65,7 @@ func init() { if err != nil { log.Fatal(err) } - tilesImage, _ = ebiten.NewImageFromImage(img) + tilesImage = ebiten.NewImageFromImage(img) } type Camera struct { diff --git a/examples/drag/main.go b/examples/drag/main.go index 8a490305a..c779ebd53 100644 --- a/examples/drag/main.go +++ b/examples/drag/main.go @@ -203,7 +203,7 @@ func init() { if err != nil { log.Fatal(err) } - ebitenImage, _ = ebiten.NewImageFromImage(img) + ebitenImage = ebiten.NewImageFromImage(img) } func NewGame() *Game { diff --git a/examples/filter/main.go b/examples/filter/main.go index 9cda97078..8cd540a19 100644 --- a/examples/filter/main.go +++ b/examples/filter/main.go @@ -79,7 +79,7 @@ func main() { log.Fatal(err) } - ebitenImage, _ = ebiten.NewImageFromImage(img) + ebitenImage = ebiten.NewImageFromImage(img) ebiten.SetWindowSize(screenWidth, screenHeight) ebiten.SetWindowTitle("Filter (Ebiten Demo)") diff --git a/examples/flappy/main.go b/examples/flappy/main.go index 845ca3f34..ebe96f7c1 100644 --- a/examples/flappy/main.go +++ b/examples/flappy/main.go @@ -82,13 +82,13 @@ func init() { if err != nil { log.Fatal(err) } - gopherImage, _ = ebiten.NewImageFromImage(img) + gopherImage = ebiten.NewImageFromImage(img) img, _, err = image.Decode(bytes.NewReader(resources.Tiles_png)) if err != nil { log.Fatal(err) } - tilesImage, _ = ebiten.NewImageFromImage(img) + tilesImage = ebiten.NewImageFromImage(img) } func init() { diff --git a/examples/flood/main.go b/examples/flood/main.go index f19558e27..916cf6aaf 100644 --- a/examples/flood/main.go +++ b/examples/flood/main.go @@ -103,7 +103,7 @@ func main() { if err != nil { log.Fatal(err) } - ebitenImage, _ = ebiten.NewImageFromImage(img) + ebitenImage = ebiten.NewImageFromImage(img) ebiten.SetWindowSize(screenWidth*2, screenHeight*2) ebiten.SetWindowTitle("Flood fill with solid colors (Ebiten Demo)") diff --git a/examples/fullscreen/main.go b/examples/fullscreen/main.go index f89e40443..28e86ac6c 100644 --- a/examples/fullscreen/main.go +++ b/examples/fullscreen/main.go @@ -55,7 +55,7 @@ func init() { if err != nil { log.Fatal(err) } - gophersImage, _ = ebiten.NewImageFromImage(img) + gophersImage = ebiten.NewImageFromImage(img) } func initFont() { diff --git a/examples/hsv/main.go b/examples/hsv/main.go index 81fb097bb..7c5ee3256 100644 --- a/examples/hsv/main.go +++ b/examples/hsv/main.go @@ -149,7 +149,7 @@ func main() { if err != nil { log.Fatal(err) } - gophersImage, _ = ebiten.NewImageFromImage(img) + gophersImage = ebiten.NewImageFromImage(img) ebiten.SetWindowSize(screenWidth*2, screenHeight*2) ebiten.SetWindowTitle("HSV (Ebiten Demo)") diff --git a/examples/hue/main.go b/examples/hue/main.go index 270fe335d..ac372ddb9 100644 --- a/examples/hue/main.go +++ b/examples/hue/main.go @@ -75,7 +75,7 @@ func main() { if err != nil { log.Fatal(err) } - gophersImage, _ = ebiten.NewImageFromImage(img) + gophersImage = ebiten.NewImageFromImage(img) ebiten.SetWindowSize(screenWidth*2, screenHeight*2) ebiten.SetWindowTitle("Hue (Ebiten Demo)") diff --git a/examples/infinitescroll/main.go b/examples/infinitescroll/main.go index 2685ba668..efce8346c 100644 --- a/examples/infinitescroll/main.go +++ b/examples/infinitescroll/main.go @@ -51,7 +51,7 @@ func init() { if err != nil { log.Fatal(err) } - bgImage, _ = ebiten.NewImageFromImage(img) + bgImage = ebiten.NewImageFromImage(img) } type viewport struct { diff --git a/examples/keyboard/main.go b/examples/keyboard/main.go index 457c4ff32..a5c417714 100644 --- a/examples/keyboard/main.go +++ b/examples/keyboard/main.go @@ -42,7 +42,7 @@ func init() { log.Fatal(err) } - keyboardImage, _ = ebiten.NewImageFromImage(img) + keyboardImage = ebiten.NewImageFromImage(img) } type Game struct { diff --git a/examples/mascot/main.go b/examples/mascot/main.go index aa5477066..8ac84517f 100644 --- a/examples/mascot/main.go +++ b/examples/mascot/main.go @@ -55,19 +55,19 @@ func init() { if err != nil { log.Fatal(err) } - gopher1, _ = ebiten.NewImageFromImage(img1) + gopher1 = ebiten.NewImageFromImage(img1) img2, _, err := image.Decode(bytes.NewReader(rmascot.Out02_png)) if err != nil { log.Fatal(err) } - gopher2, _ = ebiten.NewImageFromImage(img2) + gopher2 = ebiten.NewImageFromImage(img2) img3, _, err := image.Decode(bytes.NewReader(rmascot.Out03_png)) if err != nil { log.Fatal(err) } - gopher3, _ = ebiten.NewImageFromImage(img3) + gopher3 = ebiten.NewImageFromImage(img3) } func init() { diff --git a/examples/masking/main.go b/examples/masking/main.go index b53c0c6f3..407ee0068 100644 --- a/examples/masking/main.go +++ b/examples/masking/main.go @@ -54,13 +54,13 @@ func init() { if err != nil { log.Fatal(err) } - bgImage, _ = ebiten.NewImageFromImage(img) + bgImage = ebiten.NewImageFromImage(img) img, _, err = image.Decode(bytes.NewReader(images.FiveYears_jpg)) if err != nil { log.Fatal(err) } - fgImage, _ = ebiten.NewImageFromImage(img) + fgImage = ebiten.NewImageFromImage(img) // Initialize the spot light image. const r = 64 @@ -75,7 +75,7 @@ func init() { a.SetAlpha(i, j, color.Alpha{b}) } } - spotLightImage, _ = ebiten.NewImageFromImage(a) + spotLightImage = ebiten.NewImageFromImage(a) } type Game struct { diff --git a/examples/minify/main.go b/examples/minify/main.go index 799892a6f..8f071ada7 100644 --- a/examples/minify/main.go +++ b/examples/minify/main.go @@ -111,7 +111,7 @@ func main() { log.Fatal(err) } - gophersImage, _ = ebiten.NewImageFromImage(img) + gophersImage = ebiten.NewImageFromImage(img) ebiten.SetWindowSize(screenWidth, screenHeight) ebiten.SetWindowTitle("Minify (Ebiten Demo)") diff --git a/examples/mosaic/main.go b/examples/mosaic/main.go index 28e615027..4f7c96cd1 100644 --- a/examples/mosaic/main.go +++ b/examples/mosaic/main.go @@ -52,7 +52,7 @@ func init() { if err != nil { log.Fatal(err) } - gophersImage, _ = ebiten.NewImageFromImage(img) + gophersImage = ebiten.NewImageFromImage(img) } type Game struct { diff --git a/examples/paint/main.go b/examples/paint/main.go index e92d0d660..3801325d3 100644 --- a/examples/paint/main.go +++ b/examples/paint/main.go @@ -49,7 +49,7 @@ func init() { a1, a2, a2, a1, a0, a1, a1, a0, } - brushImage, _ = ebiten.NewImageFromImage(&image.Alpha{ + brushImage = ebiten.NewImageFromImage(&image.Alpha{ Pix: pixels, Stride: 4, Rect: image.Rect(0, 0, 4, 4), diff --git a/examples/particles/main.go b/examples/particles/main.go index 5e7853856..4c818e844 100644 --- a/examples/particles/main.go +++ b/examples/particles/main.go @@ -58,7 +58,7 @@ func init() { if err != nil { log.Fatal(err) } - smokeImage, _ = ebiten.NewImageFromImage(img) + smokeImage = ebiten.NewImageFromImage(img) } type sprite struct { diff --git a/examples/perspective/main.go b/examples/perspective/main.go index 4ecddc89b..ed04643c8 100644 --- a/examples/perspective/main.go +++ b/examples/perspective/main.go @@ -82,7 +82,7 @@ func main() { if err != nil { log.Fatal(err) } - gophersImage, _ = ebiten.NewImageFromImage(img) + gophersImage = ebiten.NewImageFromImage(img) ebiten.SetWindowSize(screenWidth*2, screenHeight*2) ebiten.SetWindowTitle("Perspective (Ebiten Demo)") diff --git a/examples/platformer/main.go b/examples/platformer/main.go index 697500f59..8448f231e 100644 --- a/examples/platformer/main.go +++ b/examples/platformer/main.go @@ -47,25 +47,25 @@ func init() { if err != nil { panic(err) } - rightSprite, _ = ebiten.NewImageFromImage(img) + rightSprite = ebiten.NewImageFromImage(img) img, _, err = image.Decode(bytes.NewReader(rplatformer.Left_png)) if err != nil { panic(err) } - leftSprite, _ = ebiten.NewImageFromImage(img) + leftSprite = ebiten.NewImageFromImage(img) img, _, err = image.Decode(bytes.NewReader(rplatformer.MainChar_png)) if err != nil { panic(err) } - idleSprite, _ = ebiten.NewImageFromImage(img) + idleSprite = ebiten.NewImageFromImage(img) img, _, err = image.Decode(bytes.NewReader(rplatformer.Background_png)) if err != nil { panic(err) } - backgroundImage, _ = ebiten.NewImageFromImage(img) + backgroundImage = ebiten.NewImageFromImage(img) } const ( diff --git a/examples/raycasting/main.go b/examples/raycasting/main.go index 92dd54153..ca87c26af 100644 --- a/examples/raycasting/main.go +++ b/examples/raycasting/main.go @@ -59,7 +59,7 @@ func init() { if err != nil { log.Fatal(err) } - bgImage, _ = ebiten.NewImageFromImage(img) + bgImage = ebiten.NewImageFromImage(img) triangleImage.Fill(color.White) } diff --git a/examples/rotate/main.go b/examples/rotate/main.go index 03e3461d5..a097dd1e7 100644 --- a/examples/rotate/main.go +++ b/examples/rotate/main.go @@ -82,7 +82,7 @@ func main() { if err != nil { log.Fatal(err) } - gophersImage, _ = ebiten.NewImageFromImage(img) + gophersImage = ebiten.NewImageFromImage(img) ebiten.SetWindowSize(screenWidth*2, screenHeight*2) ebiten.SetWindowTitle("Rotate (Ebiten Demo)") diff --git a/examples/shader/main.go b/examples/shader/main.go index 2c6317ca5..40d5438cf 100644 --- a/examples/shader/main.go +++ b/examples/shader/main.go @@ -54,7 +54,7 @@ func init() { if err != nil { log.Fatal(err) } - gopherImage, _ = ebiten.NewImageFromImage(img) + gopherImage = ebiten.NewImageFromImage(img) } func init() { @@ -62,7 +62,7 @@ func init() { if err != nil { log.Fatal(err) } - gopherBgImage, _ = ebiten.NewImageFromImage(img) + gopherBgImage = ebiten.NewImageFromImage(img) } func init() { @@ -70,7 +70,7 @@ func init() { if err != nil { log.Fatal(err) } - normalImage, _ = ebiten.NewImageFromImage(img) + normalImage = ebiten.NewImageFromImage(img) } func init() { @@ -78,7 +78,7 @@ func init() { if err != nil { log.Fatal(err) } - noiseImage, _ = ebiten.NewImageFromImage(img) + noiseImage = ebiten.NewImageFromImage(img) } var shaderSrcs = [][]byte{ diff --git a/examples/sprites/main.go b/examples/sprites/main.go index bef751cbd..0a08d3f30 100644 --- a/examples/sprites/main.go +++ b/examples/sprites/main.go @@ -54,7 +54,7 @@ func init() { if err != nil { log.Fatal(err) } - origEbitenImage, _ := ebiten.NewImageFromImage(img) + origEbitenImage := ebiten.NewImageFromImage(img) w, h := origEbitenImage.Size() ebitenImage = ebiten.NewImage(w, h) diff --git a/examples/spriteshd/main.go b/examples/spriteshd/main.go index 096be54cb..b84aaf47c 100644 --- a/examples/spriteshd/main.go +++ b/examples/spriteshd/main.go @@ -56,7 +56,7 @@ func init() { if err != nil { log.Fatal(err) } - origEbitenImage, _ := ebiten.NewImageFromImage(img) + origEbitenImage := ebiten.NewImageFromImage(img) w, h := origEbitenImage.Size() ebitenImage = ebiten.NewImage(w, h) diff --git a/examples/tiles/main.go b/examples/tiles/main.go index c567a3b0a..d357e6cb7 100644 --- a/examples/tiles/main.go +++ b/examples/tiles/main.go @@ -56,7 +56,7 @@ func init() { if err != nil { log.Fatal(err) } - tilesImage, _ = ebiten.NewImageFromImage(img) + tilesImage = ebiten.NewImageFromImage(img) } type Game struct { diff --git a/examples/ui/main.go b/examples/ui/main.go index 3721006ab..b4262adae 100644 --- a/examples/ui/main.go +++ b/examples/ui/main.go @@ -58,7 +58,7 @@ func init() { if err != nil { log.Fatal(err) } - uiImage, _ = ebiten.NewImageFromImage(img) + uiImage = ebiten.NewImageFromImage(img) tt, err := opentype.Parse(goregular.TTF) if err != nil { diff --git a/examples/windowsize/main.go b/examples/windowsize/main.go index 174dd1e64..b047fa605 100644 --- a/examples/windowsize/main.go +++ b/examples/windowsize/main.go @@ -349,7 +349,7 @@ func main() { if err != nil { log.Fatal(err) } - gophersImage, _ = ebiten.NewImageFromImage(img) + gophersImage = ebiten.NewImageFromImage(img) ebiten.SetWindowIcon([]image.Image{createRandomIconImage()}) diff --git a/image.go b/image.go index a7822f68e..f043eda0e 100644 --- a/image.go +++ b/image.go @@ -31,8 +31,6 @@ var panicOnErrorAtImageAt bool // Image represents a rectangle set of pixels. // The pixel format is alpha-premultiplied RGBA. // Image implements image.Image and draw.Image. -// -// Functions of Image never returns error as of 1.5.0, and error values are always nil. type Image struct { // addr holds self to check copying. // See strings.Builder for similar examples. @@ -729,9 +727,7 @@ func NewImage(width, height int) *Image { // NewImageFromImage creates a new image with the given image (source). // // If source's width or height is less than 1 or more than device-dependent maximum size, NewImageFromImage panics. -// -// Error returned by NewImageFromImage is always nil as of 1.5.0. -func NewImageFromImage(source image.Image) (*Image, error) { +func NewImageFromImage(source image.Image) *Image { size := source.Bounds().Size() width, height := size.X, size.Y @@ -743,7 +739,7 @@ func NewImageFromImage(source image.Image) (*Image, error) { i.addr = i i.ReplacePixels(imageToBytes(source)) - return i, nil + return i } func newScreenFramebufferImage(width, height int) *Image { diff --git a/image_test.go b/image_test.go index 08bb569c3..f379d4331 100644 --- a/image_test.go +++ b/image_test.go @@ -59,10 +59,7 @@ func openEbitenImage() (*Image, image.Image, error) { return nil, nil, err } - eimg, err := NewImageFromImage(img) - if err != nil { - return nil, nil, err - } + eimg := NewImageFromImage(img) return eimg, img, nil } @@ -248,7 +245,7 @@ func TestImageDotByDotInversion(t *testing.T) { func TestImageReplacePixels(t *testing.T) { // Create a dummy image so that the shared texture is used and origImg's position is shfited. - dummyImg, _ := NewImageFromImage(image.NewRGBA(image.Rect(0, 0, 16, 16))) + dummyImg := NewImageFromImage(image.NewRGBA(image.Rect(0, 0, 16, 16))) defer dummyImg.Dispose() _, origImg, err := openEbitenImage() @@ -361,9 +358,7 @@ func TestNewImageFromEbitenImage(t *testing.T) { t.Fatal(err) return } - if _, err := NewImageFromImage(img); err != nil { - t.Errorf("NewImageFromImage returns error: %v", err) - } + _ = NewImageFromImage(img) } func TestNewImageFromSubImage(t *testing.T) { @@ -374,11 +369,7 @@ func TestNewImageFromSubImage(t *testing.T) { } w, h := img.Bounds().Dx(), img.Bounds().Dy() subImg := img.(*image.NRGBA).SubImage(image.Rect(1, 1, w-1, h-1)) - eimg, err := NewImageFromImage(subImg) - if err != nil { - t.Fatal(err) - return - } + eimg := NewImageFromImage(subImg) sw, sh := subImg.Bounds().Dx(), subImg.Bounds().Dy() w2, h2 := eimg.Size() if w2 != sw { diff --git a/text/text.go b/text/text.go index 300b8f149..58a8bd03b 100644 --- a/text/text.go +++ b/text/text.go @@ -154,7 +154,7 @@ func getGlyphImages(face font.Face, runes []rune) []*ebiten.Image { d.Dot = fixed.Point26_6{X: x, Y: y} d.DrawString(string(r)) - img, _ := ebiten.NewImageFromImage(rgba) + img := ebiten.NewImageFromImage(rgba) if _, ok := glyphImageCache[face][r]; !ok { glyphImageCache[face][r] = &glyphImageCacheEntry{ image: img,