Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: move x/exp/shiny/font to x/image/font #12410

Closed
nigeltao opened this issue Aug 31, 2015 · 5 comments
Closed

proposal: move x/exp/shiny/font to x/image/font #12410

nigeltao opened this issue Aug 31, 2015 · 5 comments

Comments

@nigeltao
Copy link
Contributor

I've recently told people (https://groups.google.com/forum/#!topic/golang-nuts/tr-MftD7kbo) to update their code's imports from code.google.com/p/freetype-go to github.com/golang/freetype.

The old code.google.com version's text drawing code was tightly coupled to the freetype/truetype package. The github version is less coupled, and uses a newer font package under golang.org/x, one that supports a variety of font file formats. This "package font" currently lives at golang.org/x/exp/shiny/font, because I was working on shiny as well, and they're sort of related, in that many GUI programs want to render text. It isn't necessarily tied to shiny (an experimental GUI library), though, and long term, the font packages should live somewhere other than under golang.org/x/exp.

Given that people will be updating their import paths anyway, it might make sense to move "package font" out from exp now, so that people update their import paths just once instead of once now and a second time later.

Thus, I propose to move font, font/plan9font and its example program out from
golang.org/x/exp/shiny/font
to live instead at
golang.org/x/image/font

"package font"'s exported API isn't frozen yet, but this new location is still under golang.org/x, not the standard library, so the API freeze doesn't necessarily apply.

@crawshaw
Copy link
Member

SGTM

@adg
Copy link
Contributor

adg commented Sep 1, 2015

SGTM

On 31 August 2015 at 16:32, Nigel Tao notifications@github.com wrote:

I've recently told people (
https://groups.google.com/forum/#!topic/golang-nuts/tr-MftD7kbo) to
update their code's imports from code.google.com/p/freetype-go to
github.com/golang/freetype.

The old code.google.com version's text drawing code was tightly coupled
to the freetype/truetype package. The github version is less coupled, and
uses a newer font package under golang.org/x, one that supports a variety
of font file formats. This "package font" currently lives at
golang.org/x/exp/shiny/font, because I was working on shiny as well, and
they're sort of related, in that many GUI programs want to render text. It
isn't necessarily tied to shiny (an experimental GUI library), though, and
long term, the font packages should live somewhere other than under
golang.org/x/exp.

Given that people will be updating their import paths anyway, it might
make sense to move "package font" out from exp now, so that people update
their import paths just once instead of once now and a second time later.

Thus, I propose to move font, font/plan9font and its example program out
from
golang.org/x/exp/shiny/font
to live instead at
golang.org/x/image/font

"package font"'s exported API isn't frozen yet, but this new location is
still under golang.org/x, not the standard library, so the API freeze
doesn't necessarily apply.


Reply to this email directly or view it on GitHub
#12410.

@nigeltao
Copy link
Contributor Author

nigeltao commented Sep 1, 2015

This move has happened.

(Well, a copy, not a move, for now. The x/exp/shiny/font edition is deprecated and I'll delete it after a grace period.)

@nigeltao nigeltao closed this as completed Sep 1, 2015
@josharian
Copy link
Contributor

For those who arrive here later (like me), what is the recommended font package for new projects? github.com/golang/freetype or golang.org/x/image/font or something else?

@nigeltao
Copy link
Contributor Author

github.com/golang/freetype will be deprecated at some point. It is limited to only truetype fonts.

github.com/golang/freetype/truetype is still current, but it now implements an interface defined by golang.org/x/image/font. The latter is independent of any particular font format. Think of it like package image in the standard library, and the former package, g.c/g/f/t, as like package image/jpeg or golang.org/x/image/webp, except that it happens to be in a separate repo, mainly because it has a separate license.

@golang golang locked and limited conversation to collaborators Feb 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants