diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-05-17 16:51:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-17 16:51:25 -0400 |
commit | d103ed6ca97ca5a2669f6cf5fe4b3d2a9c945f26 (patch) | |
tree | dbde13123c6add150448f7b75753ac022d862475 /vendor/github.com/golang/freetype | |
parent | cd23b8139a9463b67e3096744321f6f4eb0ca40a (diff) | |
download | chat-d103ed6ca97ca5a2669f6cf5fe4b3d2a9c945f26.tar.gz chat-d103ed6ca97ca5a2669f6cf5fe4b3d2a9c945f26.tar.bz2 chat-d103ed6ca97ca5a2669f6cf5fe4b3d2a9c945f26.zip |
Upgrading server dependancies (#6431)
Diffstat (limited to 'vendor/github.com/golang/freetype')
-rw-r--r-- | vendor/github.com/golang/freetype/truetype/truetype.go | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/vendor/github.com/golang/freetype/truetype/truetype.go b/vendor/github.com/golang/freetype/truetype/truetype.go index 7a17d8e86..7270bbf22 100644 --- a/vendor/github.com/golang/freetype/truetype/truetype.go +++ b/vendor/github.com/golang/freetype/truetype/truetype.go @@ -324,11 +324,20 @@ func (f *Font) parseKern() error { if version != 0 { return UnsupportedError(fmt.Sprintf("kern version: %d", version)) } + n, offset := u16(f.kern, offset), offset+2 - if n != 1 { - return UnsupportedError(fmt.Sprintf("kern nTables: %d", n)) - } - offset += 2 + if n == 0 { + return UnsupportedError("kern nTables: 0") + } + // TODO: support multiple subtables. In practice, almost all .ttf files + // have only one subtable, if they have a kern table at all. But it's not + // impossible. Xolonium Regular (https://fontlibrary.org/en/font/xolonium) + // has 3 subtables. Those subtables appear to be disjoint, rather than + // being the same kerning pairs encoded in three different ways. + // + // For now, we'll use only the first subtable. + + offset += 2 // Skip the version. length, offset := int(u16(f.kern, offset)), offset+2 coverage, offset := u16(f.kern, offset), offset+2 if coverage != 0x0001 { |