Example #1
0
File: ont.go Project: evmar/smash
// metricsFromCairo fills in the font metrics with the font metrics as
// measured on a cairo Context.
func (f *Font) metricsFromCairo(cr *cairo.Context) {
	ext := cairo.FontExtents{}
	cr.FontExtents(&ext)
	f.cw = int(ext.MaxXAdvance)
	f.ch = int(ext.Height)
	f.descent = int(ext.Descent)
}