// Px sets character size in pixels. func (f *Face) Px(px int) error { height := C.FT_UInt(px) errno := C.FT_Set_Pixel_Sizes(f.handle, 0, height) if errno != 0 { return fmt.Errorf("freetype2: %s", errstr(errno)) } return nil }
// Pt sets character size in points, and resolution in dots-per-inch (typically 72). func (f *Face) Pt(pt, dpi int) error { height := C.FT_F26Dot6(pt << 6) res := C.FT_UInt(dpi) errno := C.FT_Set_Char_Size(f.handle, 0, height, res, res) if errno != 0 { return fmt.Errorf("freetype2: %s", errstr(errno)) } return nil }