go-text / typesetting

High quality text shaping in pure Go.
Other
88 stars 11 forks source link

[font, opentype/*] Reorganize and clean up font packages #116

Closed benoitkugler closed 2 months ago

benoitkugler commented 7 months ago

We currently have several packages dealing with font loading, namely font, opentype/api, opentype/api/font, opentype/api/metadata. This is mainly an historical consequence of the fact that go-text used to depend on an external package to support parsing Opentype fonts.

I would like to tidy things up and remove what I think is now an unnecessary API complication. While at it, we could also handle #113. To do so I propose to :

The changes would essentially be API modifications/renaming, but would be backward incompatible. One of the more subtle change user would have to account for is that the font.{Font, Face} types would become struct types, not pointer anymore (they are currently defined as alias to *opentype/font.{Font, Face}), requiring to add * everywhere they use it.

It seems to me that this is still a good time to do such changes, before we enter a more stable phase. As suggested in #99, we could perhaps tag a version before this change (say 0.1.0) and right after (say 0.2.0).

What do you all think ?

whereswaldon commented 7 months ago

This is a welcome simplification. I see no reason not to do it. I'm open to tagging versions before/after as well.