(dst draw.Image, x, y int, ch byte, c color.Color)
| 68 | } |
| 69 | |
| 70 | func DrawCharacter(dst draw.Image, x, y int, ch byte, c color.Color) { |
| 71 | if ch < 32 || ch > 128 { |
| 72 | return |
| 73 | } |
| 74 | cx := int((ch-32)%16) * 16 |
| 75 | cy := int((ch-32)/16) * 16 |
| 76 | r := image.Rect(x, y, x+16, y+16) |
| 77 | src := &image.Uniform{c} |
| 78 | sp := image.Pt(cx, cy) |
| 79 | draw.DrawMask(dst, r, src, sp, fontMask, sp, draw.Over) |
| 80 | } |
| 81 | |
| 82 | func DrawText(dst draw.Image, x, y int, text string, c color.Color) { |
| 83 | for i := range text { |
no outgoing calls
no test coverage detected
searching dependent graphs…