Comments (8)
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.
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.
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.
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.
@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.
@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.
@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.
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)
- Bad performance of roundDecimal() in path.js
- Error parsing some cut font files using 'opentype. parse(...)' HOT 21
- How to Solve This Problem... 😭 Error: Unsupported OpenType signature <!DO HOT 3
- Regression: CFF-1 and CFF-2 tests in Unicode test suite passed at some point HOT 1
- Did we get rid of the non-umd & non-esm build? HOT 1
- Support searching or filtering by glyph name HOT 4
- Compilation error from opentype HOT 1
- hinting broken on the demo page HOT 6
- An unexpected situation occurred when using path. toSVG(), where NaN caused text rendering errors HOT 3
- how can I get font metadata by font file (.ttf,.otf,.woff2,.woff) by simple method? HOT 2
- Why did we depricate the load function? HOT 5
- Bold/Italic Emulation implementation needed. HOT 5
- Invalid font result with opentype.js HOT 1
- font lose glyph name HOT 1
- Writing slow (30+ seconds) for certain fonts (CJK, Noto Chinese) HOT 2
- TypeError: Cannot read properties of undefined (reading 'featureIndexes')
- fvar.instances returns empty name entry if nameID is 17 (preferredSubfamily) HOT 13
- 'liga' should not support only latin words
- missing emoji substitutions HOT 9
- Character rendering issues occur when stroking text. HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opentype.js.