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

Font renderer #111

Open
watzon opened this issue Aug 15, 2019 · 7 comments
Open

Font renderer #111

watzon opened this issue Aug 15, 2019 · 7 comments

Comments

@watzon
Copy link

watzon commented Aug 15, 2019

This would be a nice thing to have which could augment the abilities of the stumpy libraries. Currently there's no way to add text to images, but with a font renderer it would be pretty easy to add that ability.

@bew
Copy link

bew commented Aug 16, 2019

Something like #55 or harfbuzz would be great :)

@watzon
Copy link
Author

watzon commented Aug 16, 2019

@bew agreed, I remember seeing harfbuzz recently as a suggested repo from github. A wrapper around it would be awesome, although it would also be pretty cool to have a pure Crystal font renderer as well.

@bew
Copy link

bew commented Aug 16, 2019

In stumpy_utils, there is a way to write text, but it's pretty basic compared to the mentioned libs above

https://github.com/stumpycr/stumpy_utils/blob/master/README.md#canvastextx-baseline_y-text-font--pcfparserfont-color--rgbaback

@watzon
Copy link
Author

watzon commented Aug 17, 2019

That's cool, I didn't even realize that. Never actually heard of the pcf format.

@bew
Copy link

bew commented Aug 17, 2019

From what I read, text rendering is a hard topic, and I think it would be simpler to wrap a library that does it well instead of re-inventing such a complex wheel..

Also, I read that HarfBuzz is a text shaping engine, and Pango uses it for the display/placement of text, so wrapping Pango would be the best option here (and it's cross-plateform!).

@watzon
Copy link
Author

watzon commented Aug 17, 2019

Sounds good to me! Now someone just needs to do it 😁

@hugopl
Copy link

hugopl commented Oct 25, 2020

You can acess Pango and/or Harfbuzz using https://github.com/jhass/crystal-gobject, i.e. problem solved. :-)

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

No branches or pull requests

3 participants