// NewDrawer returns a new tile Drawer given a monospace font face.
NewDrawer returns a new tile Drawer given a monospace font face.
// NewDrawer returns a new tile Drawer given a monospace font face .
func NewDrawer(face font.Face) (*Drawer, error) {
	d := &Drawer{}
	d.drawer = &font.Drawer{
		Face: face,
	}
	width, ok := face.GlyphAdvance('W')
	if !ok {
		return nil, errors.New("could not get glyph advance")
	}
	metrics := face.Metrics()
	height := metrics.Height
	d.rect = image.Rect(0, 0, width.Ceil(), height.Ceil())
	d.dot = fixed.Point26_6{X: 0, Y: metrics.Ascent}
	return d, nil
}
func NewDrawer ( face font . Face ) ( * Drawer , error ) { d := & Drawer { } d . drawer = & font . Drawer { Face : face , } width , ok := face . GlyphAdvance ( 'W' ) if ! ok { return nil , errors . New ( " " ) } metrics := face . Metrics ( ) height := metrics . Height d . rect = image . Rect ( 0 , 0 , width . Ceil ( ) , height . Ceil ( ) ) d . dot = fixed . Point26_6 { X : 0 , Y : metrics . Ascent } return d , nil }
NewDrawer returns a new tile Drawer given a monospace font face.
NewDrawer returns a new tile Drawer given a monospace font face .