From edf0d8ef999f73e76337c01fb0071ff775beaf18 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sun, 13 Oct 2019 18:15:25 +0200 Subject: [PATCH] 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 --- {text => font}/opentype/opentype.go | 9 --------- 1 file changed, 9 deletions(-) rename {text => font}/opentype/opentype.go (96%) diff --git a/text/opentype/opentype.go b/font/opentype/opentype.go similarity index 96% rename from text/opentype/opentype.go rename to font/opentype/opentype.go index 72ae175f..ac83f46c 100644 --- a/text/opentype/opentype.go +++ b/font/opentype/opentype.go @@ -39,15 +39,6 @@ func Parse(src []byte) (*Font, error) { 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 { return layoutText(&f.buf, ppem, str, &opentype{Font: f.font, Hinting: font.HintingFull}, opts) }