Giter Club home page Giter Club logo

Comments (8)

davelab6 avatar davelab6 commented on July 26, 2024

You can do the subsetting serverside with pyftsubset from https://github.com/behdad/fonttools/

The unicode/glyph lookup is being discussed in #49

from opentype.js.

zoomclub avatar zoomclub commented on July 26, 2024

Not interested in such serverside tools at all. I noticed Glyphr is losing their TTX dependancy in the next version too. I simply want to access specific ranges of glyphs, that is all. A JSON filter/map is the way to do it in this new age of clientside apps.

from opentype.js.

davelab6 avatar davelab6 commented on July 26, 2024

In glyphr-studio/Glyphr-Studio-1#25 I suggested using fontTools python converted to js with emscripten, which means pyftsubset would be available in js too, but, I'm not sure who is going to actively work on that....

from opentype.js.

mattlag avatar mattlag commented on July 26, 2024

Thread crashing - @davelab6 I commented in the thread you mentioned above, but i'll give a shortened version here. If something like fontTools.js is made to work, then great (I don't think I can help here). I think TTX is cool, but I agree certainly JSON is a better format than XML for javascripty stuff. The uber scenario is just client-side font file reading / writing.

from opentype.js.

fdb avatar fdb commented on July 26, 2024

@zoomclub Is sounds like an interesting use case. Any idea/example how that JSON format could look? Is there a reason why you wouldn't want to parse the whole font? (performance? memory?)

from opentype.js.

zoomclub avatar zoomclub commented on July 26, 2024

@fdb I'm working on a possible schema, give me a bit and I'll post it. Yes, I do have concerns about in memory size after parsing, also lookup performance. Most likely because I'm not sure how Opentype manages this for 2000+ glyphs in the font? Although, it did look like it parsed and rendered super fast on the site!

from opentype.js.

zoomclub avatar zoomclub commented on July 26, 2024

@fdb Bravura represents a collection of nearly 3000 glyphs and uses metadata to provide developers with more information about each glyph. This metadata is nice to have but extremely verbose and redundant, being spread out across four JSON files. The metadata is available here: http://www.smufl.org/download

The first thing I did when I saw the Bravura metadata is completely revamp it all into much more logical data models, which extend the basic classes of glyphs found in the Bravura ranges.json file and work better with score data structures. This is a data modeling task which is required for my use of the Bravura font as a whole.

This data modeling aspect is done and thinking it through from there it seems that Opentype should only require a small addition in its Glyph Inspector to make it easier to work with fonts like Bravura. The default way for Opentype to display a large font is in blocks of 100 glyphs, which can be toggled between.

Bravura is laid out by classes of glyphs with each class assigned to a given unicode range. The following generic JSON format could be processed by the Glyph Inspector to show specific glyph ranges with a title per range:

{ xyz-filter : {

{
start-unicode-codepoint : xyz,
end-unicode-codepoint : xyz,
display-picker-title : xyz
}
...
}}

The Glyph Inspector could use this file as an arg and optionally the font loader could as well. The display-picker-title could be used to list the defined ranges so they could be easily picked. It could then also be used to show a title for the picked range in Glyph Inspector. The unicode start and end codepoints could be appended to the title too.

These filters can then be defined by Opentype users but the default display option could still be the generic numbered lots of 100. There can just be an extra button in the Glyph Inspector allowing a defined filter to be loaded. If this seems like a reasonable option to you I can prepare a version of such a filter for the Bravura font, to test with.

from opentype.js.

Connum avatar Connum commented on July 26, 2024

Closing this old issue. I don't think we need to implement some higher-level functionality for this. You can already filter the glyphset in order to create a subset.

from opentype.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.