font/sfnt: support parsing legacy fonts with OS2 table version <= 1

Library assumes that OS/2 header size is at least 96 bytes,
which is not the case for fonts with OS/2 table version <= 1.

This CL adds a version test and handles the legacy header.

Fixes golang/go#28339

Change-Id: I79bd8f8bbf262c1caaf4e66888446159b5e4fb43
Reviewed-on: https://go-review.googlesource.com/c/144079
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Elias Naur <elias.naur@gmail.com>
1 file changed
tree: a67aafa5e4e3d0cd6227c1db8686a41d985bf6bd
  1. bmp/
  2. cmd/
  3. colornames/
  4. draw/
  5. example/
  6. font/
  7. math/
  8. riff/
  9. testdata/
  10. tiff/
  11. vector/
  12. vp8/
  13. vp8l/
  14. webp/
  15. .gitattributes
  16. .gitignore
  17. AUTHORS
  18. codereview.cfg
  19. CONTRIBUTING.md
  20. CONTRIBUTORS
  21. LICENSE
  22. PATENTS
  23. README.md
README.md

Go Images

This repository holds supplementary Go image libraries.

Download/Install

The easiest way to install is to run go get -u golang.org/x/image/.... You can also manually git clone the repository to $GOPATH/src/golang.org/x/image.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.

The main issue tracker for the image repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/image:” in the subject line, so it is easy to find.