Skip to content

Font paths to points #844

Closed
Closed

Description

@dhowe

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/

Activity

  1. lmccart commented on Aug 11, 2015

    @lmccart
    Member

    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.)

  2. dhowe commented on Aug 30, 2015

    @dhowe
    ContributorAuthor

    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 ?

  3. kadamwhite commented on Aug 31, 2015

    @kadamwhite
    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.

  4. dhowe commented on Sep 8, 2015

    @dhowe
    ContributorAuthor

    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 ?

  5. lmccart commented on Sep 28, 2015

    @lmccart
    Member

    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.

  6. dhowe commented on Sep 28, 2015

    @dhowe
    ContributorAuthor

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

  7. dhowe commented on Dec 10, 2015

    @dhowe
    ContributorAuthor

    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)...

  8. lmccart commented on Dec 11, 2015

    @lmccart
    Member

    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?

  9. dhowe commented on Jan 23, 2016

    @dhowe
    ContributorAuthor

    agreed, ready to close @lmccart

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions