diff options
Diffstat (limited to 'utf8fontfile.go')
-rw-r--r-- | utf8fontfile.go | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/utf8fontfile.go b/utf8fontfile.go index 07cf169..4d90f28 100644 --- a/utf8fontfile.go +++ b/utf8fontfile.go @@ -1139,18 +1139,15 @@ func keySortArrayRangeMap(s map[int][]int) []int { return keys } -// UTF8CutFont cuts a set in cutset and returns the customized font bytes -// Parameters: -// in - the ttf bytes in, -// cutset - the cutset runes in string, -// Returns: -// out - the ttf bytes out, -func UTF8CutFont(in []byte, cutset string) (out []byte) { - f := newUTF8Font(&fileReader{readerPosition: 0, array: in}) +// UTF8CutFont is a utility function that generates a TrueType font composed +// only of the runes included in cutset. The rune glyphs are copied from This +// function is demonstrated in ExampleUTF8CutFont(). +func UTF8CutFont(inBuf []byte, cutset string) (outBuf []byte) { + f := newUTF8Font(&fileReader{readerPosition: 0, array: inBuf}) runes := map[int]int{} for i, r := range cutset { runes[i] = int(r) } - out = f.GenerateСutFont(runes) + outBuf = f.GenerateСutFont(runes) return } |