diff --git a/go.mod b/go.mod index abe5249456..4b93833328 100644 --- a/go.mod +++ b/go.mod @@ -96,7 +96,7 @@ require ( go.opentelemetry.io/otel/trace v1.19.0 golang.org/x/crypto v0.14.0 golang.org/x/exp v0.0.0-20230905200255-921286631fa9 - golang.org/x/image v0.13.0 + golang.org/x/image v0.14.0 golang.org/x/net v0.17.0 golang.org/x/oauth2 v0.13.0 golang.org/x/sync v0.5.0 diff --git a/go.sum b/go.sum index e7472ad223..afeb7505cf 100644 --- a/go.sum +++ b/go.sum @@ -2179,8 +2179,8 @@ golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeap golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.13.0 h1:3cge/F/QTkNLauhf2QoE9zp+7sr+ZcL4HnoZmdwg9sg= -golang.org/x/image v0.13.0/go.mod h1:6mmbMOeV28HuMTgA6OSRkdXKYw/t5W9Uwn2Yv1r3Yxk= +golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4= +golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/vendor/golang.org/x/image/font/sfnt/sfnt.go b/vendor/golang.org/x/image/font/sfnt/sfnt.go index 8d0dba7793..8ed19e21a9 100644 --- a/vendor/golang.org/x/image/font/sfnt/sfnt.go +++ b/vendor/golang.org/x/image/font/sfnt/sfnt.go @@ -745,7 +745,7 @@ func (f *Font) initialize(offset int, isDfont bool) error { f.cached.xHeight = xHeight if !hasXHeightCapHeight { - xh, ch, err := f.initOS2Version1() + xh, ch, err := f.initOS2VersionBelow2() if err != nil { return err } @@ -1201,7 +1201,7 @@ func (f *Font) glyphTopOS2(b *Buffer, ppem fixed.Int26_6, r rune) (int32, error) return int32(min), nil } -func (f *Font) initOS2Version1() (xHeight, capHeight int32, err error) { +func (f *Font) initOS2VersionBelow2() (xHeight, capHeight int32, err error) { ppem := fixed.Int26_6(f.UnitsPerEm()) var b Buffer @@ -1235,12 +1235,14 @@ func (f *Font) parseOS2(buf []byte) (buf1 []byte, hasXHeightCapHeight bool, xHei if err != nil { return nil, false, 0, 0, err } - if vers <= 1 { - const headerSize = 86 + if vers < 2 { + // "The original TrueType specification had this table at 68 bytes long." + // https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6OS2.html + const headerSize = 68 if f.os2.length < headerSize { return nil, false, 0, 0, errInvalidOS2Table } - // Will resolve xHeight and capHeight later, see initOS2Version1. + // Will resolve xHeight and capHeight later, see initOS2VersionBelow2. return buf, false, 0, 0, nil } const headerSize = 96 diff --git a/vendor/modules.txt b/vendor/modules.txt index 92852fcd13..e01eb6e577 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1992,7 +1992,7 @@ golang.org/x/crypto/ssh/knownhosts golang.org/x/exp/constraints golang.org/x/exp/maps golang.org/x/exp/slices -# golang.org/x/image v0.13.0 +# golang.org/x/image v0.14.0 ## explicit; go 1.18 golang.org/x/image/bmp golang.org/x/image/ccitt