-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
docs seem wrong about textFont return type #4926
Comments
The way textToPoints works (if I remember correctly) is that it uses the glyph data within a .ttf or .otf font. So if there is no font loaded (by the user) there is no glyph data to be accessed. To provide this functionality in the future we'd need to bundle a freely-usable .ttf or .otf font, for which there is some cost in the size of the package. But if we can find a small-enough font (or create one that includes only the basic characters for the locale) it might make sense to do, especially as (I think) we can only draw text in 3D with a custom loaded font, so this would solve both issues. There are previous discussions on this issue here and here -- in the latter you can find arguments against including such a font. |
Thank you. I figured as much after looking at the source. |
Sorry, I accidentally closed this. Since this is a feature request, it would be helpful to have an answer to the PR template that asks: How would this new feature help increase access to p5.js? |
The documentation for
As I user, I'd have wanted to know that. |
Ah ok, so this is more of a missing documentation bug. Thanks for clarifying! |
The documentation page on textFont() gives the impression that the method returns the current font object. This seems to only work when a font has been loaded before. When working with the default font,
textFont()
returns a string, the font name. When called with a name as argument, e.g.textFont("sans-serif")
, it returns the p5 object.Is it at all possible to get a font object for the default fonts? I'd like to run textToPoints on them.
The text was updated successfully, but these errors were encountered: