mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
text: add Metrics method to Face interface. font/opentype: implement Metrics method for Font struct.
Signed-off-by: Werner Laurensse <werner@alman.ax>
This commit is contained in:
committed by
Elias Naur
parent
aca511f849
commit
4bcb4ec8b6
@@ -46,6 +46,11 @@ func (f *Font) Shape(ppem fixed.Int26_6, str text.String) clip.Op {
|
||||
return textPath(&f.buf, ppem, &opentype{Font: f.font, Hinting: font.HintingFull}, str)
|
||||
}
|
||||
|
||||
func (f *Font) Metrics(ppem fixed.Int26_6) font.Metrics {
|
||||
o := &opentype{Font: f.font, Hinting: font.HintingFull}
|
||||
return o.Metrics(&f.buf, ppem)
|
||||
}
|
||||
|
||||
func layoutText(buf *sfnt.Buffer, ppem fixed.Int26_6, str string, f *opentype, opts text.LayoutOptions) *text.Layout {
|
||||
m := f.Metrics(buf, ppem)
|
||||
lineTmpl := text.Line{
|
||||
|
||||
Reference in New Issue
Block a user