Closed benoitkugler closed 1 year ago
@sbinet Thank you for your review, all your suggestions have been applied.
Thanks so much, am trying to grok it all but there is a lot here!
- used by the GUI toolkits when rendering glyphs
Regarding this I was not sure what the main entry point is or how it would be used. Is one of the tests demoing the expected toolkit usage?
Thanks so much, am trying to grok it all but there is a lot here!
- used by the GUI toolkits when rendering glyphs
Regarding this I was not sure what the main entry point is or how it would be used. Is one of the tests demoing the expected toolkit usage?
The main entry point is the Face.GlyphData
method, with a similar API to textlayout
. For instance, you should be able to use it as a drop-in replacement in the new go-text/render implementation.
There are basic tests in renderer_test.go, but no complete example (as I feel like it is outside the scope of the package).
Great, thanks !
This PR adds an higher level API to use Opentype font files. It is meant to be
The structure of the package, with
api
andapi/font
is designed to support futur extension. For instance, a package fetching font metadata (footprints) could nicely be added asapi/metadata
; a sub-setter could go inapi/subset
.(I've no strong opinion about the package names though.)
The
api/font
implementation exposes two types : a read-only*Font
, which support concurrent uses and a light wrapperFace
, so that toolkits may re-use*Font
objects across the whole application. Besides, theFace
object is to be the direct replacement of the existingtextlayout/fonts.Face
.Thank you for your suggestions !