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
x/image/font/sfnt: implement font.Face #22451
Comments
There totally needs to be a font.Face implementation somewhere under golang.org/x/image/sfnt, either using or being part of golang.org/x/image/font/sfnt. I just haven't had the time to do it myself. I was thinking it would be a separate package, perhaps golang.org/x/image/font/opentype, so that people could import just the sfnt package if they wanted e.g. metrics and layout without having to pull in all of the rasterization code. But I haven't given a lot of thought to it. |
I have mailed what I got so far: https://go-review.googlesource.com/#/c/image/+/73870 |
Change https://golang.org/cl/73870 mentions this issue: |
This CL adds the type Face that implements the font.Face interface. This CL also adds tests using gofont/goregular as an input font, using github.com/golang/freetype/truetype as reference values. Updates golang/go#22451. Change-Id: I2a6945309331b251ec2ddec95b6e809ad10aa116 Reviewed-on: https://go-review.googlesource.com/73870 Reviewed-by: Nigel Tao <nigeltao@golang.org>
What's up on this issue? Thank you! |
That's for @sbinet to answer. I don't have any time to work on this myself. |
CL-73870 didn't close this issue as the I did try a bit to see how one would go with implementing them but I quickly reached my level of incompetence. (sorry.) happy to get some more insights on how I would go about implementing those. (or encourage a new champion to do that) |
Change https://golang.org/cl/170578 mentions this issue: |
Hi, what's going on this? |
I can't speak for others, but for myself, I'll repeat what I've said before: I'd like to see this happen, but I don't have any time to work on this myself. |
See also https://go-review.googlesource.com/c/image/+/170578 "font/opentype: implement Glyph and GlyphBounds" which is incomplete and abandoned, but might be educational for anyone who wants to tackle this themselves. |
Change https://golang.org/cl/217817 mentions this issue: |
Change https://golang.org/cl/240897 mentions this issue: |
Implementing font.Face allows sfnt-parsed fonts to be used in code that uses DrawString, DrawRune, etc. Fixes a bug in sfnt GlyphBounds when the advance-width table is truncated. Adds an updated source link for font measurement terms. Fixes golang/go#22451 Change-Id: Ie3a434c2b4c5152e72cd6a992f853725658101bb
Change https://golang.org/cl/255237 mentions this issue: |
To ease the migration from
github.com/golang/freetype/truetype
togolang.org/x/image/font/sfnt
, it would be valuable to havefont/sfnt
provide a type that implementsfont.Face
on top of thesfnt
facilities.with https://golang.org/cl/67330 it seems possible to implement most of the
font.Face
interface.truetype
does it via NewFace.I'd propose to do the same with a new
sfnt.NewFace
function:@nigeltao what do you think ?
The text was updated successfully, but these errors were encountered: