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

enable custom fonts in polygon text #259

Closed
tvt173 opened this issue Apr 4, 2022 · 4 comments
Closed

enable custom fonts in polygon text #259

tvt173 opened this issue Apr 4, 2022 · 4 comments

Comments

@tvt173
Copy link
Collaborator

tvt173 commented Apr 4, 2022

it would be nice if the user could easily load a custom font to use for polygon text.

currently the text() function references private variables for character glyphs, widths, and indents. it would be nice if it was easier to do this, maybe from a library of gds characters.

relevant to
heitzmann/gdspy/issues/207

@joamatab
Copy link
Contributor

@spauka worked on this for phidl

@spauka
Copy link

spauka commented Apr 15, 2022

Hi @tvt173,

The implementation for PHIDL is here https://github.com/amccaugh/phidl/blob/master/phidl/font.py (Docs here: https://phidl.readthedocs.io/en/latest/geometry_reference.html#Text)

Font reading is performed using freetype-py, and once this is done you would need a curve implementation that supports cubic or quadratic bezier curves.

It would be reasonable straightforward to port to use GDSPY polygons/curves (which do support the right curves) rather than PHIDLs Device, although it's not something I would likely have the time to do, but let me know if I could help at all.

@tvt173
Copy link
Collaborator Author

tvt173 commented Apr 15, 2022

very cool, @spauka ! thanks for sharing. will re-share this on the original gdspy ticket

@joamatab
Copy link
Contributor

joamatab commented Oct 7, 2022

@joamatab joamatab closed this as completed Oct 7, 2022
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