mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
font/opentype,text/opentype: move package
Opentype parsing, layout and shaping will be used by subpackages to package font. Move the opentype package accordingly. Remove the Must helper function; programs will no longer use the opentype package in the normal case. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -39,15 +39,6 @@ func Parse(src []byte) (*Font, error) {
|
|||||||
return &Font{font: fnt}, nil
|
return &Font{font: fnt}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Must is a helper that wraps a call to a function returning (*Font,
|
|
||||||
// error) and panics if the error is non-nil.
|
|
||||||
func Must(font *Font, err error) *Font {
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
return font
|
|
||||||
}
|
|
||||||
|
|
||||||
func (f *Font) Layout(ppem fixed.Int26_6, str string, opts text.LayoutOptions) *text.Layout {
|
func (f *Font) Layout(ppem fixed.Int26_6, str string, opts text.LayoutOptions) *text.Layout {
|
||||||
return layoutText(&f.buf, ppem, str, &opentype{Font: f.font, Hinting: font.HintingFull}, opts)
|
return layoutText(&f.buf, ppem, str, &opentype{Font: f.font, Hinting: font.HintingFull}, opts)
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user