font/plan9font: derive the example's ascent from the metrics.
The Face.Metrics method is relatively new. Also pick up the unicode.7x13.font fix from the upstream plan9port: https://plan9port-review.googlesource.com/#/c/1490/ Change-Id: Ia6e0feec4ea3c9a35e19d38aa634ca9eb6b2ffa0 Reviewed-on: https://go-review.googlesource.com/21699 Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
14f8673644
commit
f551d3a6b7
|
@ -30,8 +30,7 @@ func ExampleParseFont() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
// TODO: derive the ascent from the face's metrics.
|
ascent := face.Metrics().Ascent.Ceil()
|
||||||
const ascent = 11
|
|
||||||
|
|
||||||
dst := image.NewRGBA(image.Rect(0, 0, 4*7, 13))
|
dst := image.NewRGBA(image.Rect(0, 0, 4*7, 13))
|
||||||
draw.Draw(dst, dst.Bounds(), image.Black, image.Point{}, draw.Src)
|
draw.Draw(dst, dst.Bounds(), image.Black, image.Point{}, draw.Src)
|
||||||
|
|
2
font/testdata/fixed/unicode.7x13.font
vendored
2
font/testdata/fixed/unicode.7x13.font
vendored
|
@ -1,4 +1,4 @@
|
||||||
13 10
|
13 11
|
||||||
0x0000 0x001F 7x13.2400
|
0x0000 0x001F 7x13.2400
|
||||||
0x0000 0x00FF 7x13.0000
|
0x0000 0x00FF 7x13.0000
|
||||||
0x0100 0x01FF 7x13.0100
|
0x0100 0x01FF 7x13.0100
|
||||||
|
|
Loading…
Reference in New Issue
Block a user