Skip to content

WIP: Replace freetype with sfnt#21

Open
fhs wants to merge 1 commit intoktye:masterfrom
fhs:sfnt-pr
Open

WIP: Replace freetype with sfnt#21
fhs wants to merge 1 commit intoktye:masterfrom
fhs:sfnt-pr

Conversation

@fhs
Copy link
Contributor

@fhs fhs commented Apr 2, 2019

DO NOT SUBMIT

I'd like to see if I can get the opentype changes merged upstream first. I'm not sure if the changes are general enough. Also, I'm not sure if this fixes #17 because sfnt docs state this:

It is valid to re-use a *Buffer with multiple Font method calls, even with different *Font receivers, as long as they are not concurrent calls.

All of the Font methods are safe to call concurrently, as long as each call has a different *Buffer (or nil).

The Font methods that don't take a *Buffer argument are always safe to call concurrently.

So, I think either opentype or duitdraw needs a lock?

@ktye
Copy link
Owner

ktye commented Apr 3, 2019

Very nice! It would be great to merge it upstream.

@sbinet
Copy link

sbinet commented Apr 3, 2019

I'd be willing to review those :)
migrating gonum/plot to drop freetype (and use font.Face) has been on my want-to list for the longest time...

@fhs
Copy link
Contributor Author

fhs commented Apr 3, 2019

This is the CL: https://go-review.googlesource.com/c/image/+/170578

@cryptix
Copy link

cryptix commented Jun 12, 2019

@fhs thanks a ton for this!! Could you maybe give us a rough summary of where the CL is hanging before I try to load the review discussion in my head? 😅

If you rather let someone else take a stab at finishing it that is more than fine (it's quite a complex thing after all) was just sad to see it stalled.

@fhs
Copy link
Contributor Author

fhs commented Jun 12, 2019

Sorry I didn't get around to finishing this. The CL I created probably works well enough for duitdraw's needs, but it gets a lot of details wrong. It doesn't compute glyph bounds correctly. Unlike Plan 9 fonts, the glyphs can actually overlap each other, as I understand it. Also, I don't take into account sub-pixels.

I'd be glad if someone else finishes the CL. Freetype can be used as reference, and it may be as simple as copying stuff from it.

@cryptix
Copy link

cryptix commented Jun 12, 2019

Cool, thanks for the overview! That was very helpful to understand where it's at and your suggestion seems feasable enough even without a solid background in text rendering.

I don't want to get to specific with time commitments but I have a project in the back of my mind that could really use this... stay tuned? 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

freetype crashes occasionally in GlyphAdvance

4 participants