FontFace returns the opentype font face for the requested dots-per-inch resolution.
(dpi float64)
| 105 | // FontFace returns the opentype font face for the requested |
| 106 | // dots-per-inch resolution. |
| 107 | func (f *Face) FontFace(dpi float64) font.Face { |
| 108 | face, err := opentype.NewFace(f.Face, &opentype.FaceOptions{ |
| 109 | Size: f.Font.Size.Points(), |
| 110 | DPI: dpi, |
| 111 | }) |
| 112 | if err != nil { |
| 113 | panic(err) |
| 114 | } |
| 115 | return face |
| 116 | } |
| 117 | |
| 118 | // default hinting for OpenType fonts |
| 119 | const defaultHinting = font.HintingNone |