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 paths to points #844

Closed
dhowe opened this issue Aug 5, 2015 · 9 comments
Closed

Font paths to points #844

dhowe opened this issue Aug 5, 2015 · 9 comments

Comments

@dhowe
Copy link
Contributor

dhowe commented Aug 5, 2015

So I'd like to integrate some path routines I've written into the p5.Font class to handle conversion back and forth between paths (both opentype or svg) and points. This will allow people to do stuff like the little demo below. However, its a big chunk of code (~20k before minimization), so wanted to check that others thought this a good idea (some of it would likely be reusable in future PShape or PPath objects). Thoughts?

screen shot 2015-08-05 at 7 36 02 pm
http://rednoise.org/GlyphFlock/

@lmccart
Copy link
Member

lmccart commented Aug 11, 2015

the demo is awesome!! what would you think about putting this functionality into an addon lib for now until we have a better sense where we're going with pshape / svg? (this is just a first reaction suggestion thinking about filesize, so please feel free to tell me why this doesn't make sense, and don't feel I'm trying to relegate this to an addon if it should be core.)

@dhowe
Copy link
Contributor Author

dhowe commented Aug 30, 2015

Thanks @lmccart I'm a bit conflicted on this question... There's an argument to be made that typography itself (beyond basic browser fonts) could be a separate addon, as it does add nontrivially to file size (the opentype lib, etc.) and is not a necessary component. Probably the ideal option would be a modernizr or lodash-style interface (as suggested in #94) where typography is a separate module that one can select or ignore. In this case, I would argue that the path stuff be included for sure, as its sort of a natural progression, once you have high quality font-data, to want to use it to manipulate letter forms (as above), in which case you need paths...

Any further thoughts on a module selection interface? @kadamwhite ?

@kadamwhite
Copy link
Contributor

@dhowe I'm not sure what the roadmap would need to look like to get us to Modernizr-style builds, but I do see your argument about typography being its own add-on. OpenType itself is already 81kb minified, and combined with the existing code (12kb minified) that's close to 40% of the total p5.min.js file size. That's probably something we should eventually at least let p5 users opt out of (i.e. make a custom build without the functionality), even if it stays part of the "default" core lib.

@dhowe
Copy link
Contributor Author

dhowe commented Sep 8, 2015

So the options appear to be as follows (all compatible with the possibility of Modernizr-style builds at some point in the future):

  1. add a custom build that removes typography/paths for users to choose (UI?)
  2. remove typography/paths from core and create an external library (p5.type)
  3. leave things as they are and add path-handling stuff to an external library

Option 3 (what we have now) seems least appealing to me, as we still have the bloat of opentype, but not the full functionality

Other options, thoughts... @lmccart @kadamwhite ?

@lmccart
Copy link
Member

lmccart commented Sep 28, 2015

sorry for the silence... with option 2, how much of the core type stuff would we lose/move by doing this? I'm not totally sure what the best way to move forward is as I feel like the real solution here is to get the modernizr-style builds working, but I don't think I have the bandwidth for that in the near future.

@dhowe
Copy link
Contributor Author

dhowe commented Sep 28, 2015

basically we could no longer use external fonts, only built-in browser fonts

@dhowe
Copy link
Contributor Author

dhowe commented Dec 10, 2015

For lack of any further discussion on this, I've created a PR for a smaller version of this functionality. I'm proposing this as an interim solution until we can do custom-builds or some other long-term solution (as discussed above)...

@lmccart
Copy link
Member

lmccart commented Dec 11, 2015

sounds good. sorry to take so long with this. i think we are waiting on the modular build thing which may not happen in the immediate future. this makes sense as a good interim solution.
does it make sense to close this issue then since we have one open for the modular build already?

@dhowe
Copy link
Contributor Author

dhowe commented Jan 23, 2016

agreed, ready to close @lmccart

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

No branches or pull requests

3 participants