-
Notifications
You must be signed in to change notification settings - Fork 21
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
Produce standalone fonts when subsetting #27
Comments
Some PDF readers also won't work without a valid |
Looking forward to this feature. |
I've just released 0.9, which implements building of a proper |
@wezm Can you upgrade the dependency version in allsorts-tools? Looks like it can be solved: yeslogic/allsorts-tools#16 |
Yes I'm working on that next. I have a draft PR open for it yeslogic/allsorts-tools#18 |
Reopening as we strip the |
Happy New Year! Any progress here? |
No, sorry it's a pretty big piece of work that has not been scheduled yet. |
Hey! I am also trying to use subsetting for embedded fonts in PDF documents. Since I want to avoid getting too deep into the low level PDF structure, I am just using the I got it to work on all tested PDF readers and printers with the current implementation of Would it be a sensible thing to allow forcing the default mode to be Unicode or are there any problems with this? One workaround that I think I'll be using for now is to manually add a |
I don't think that would make sense as a default as it would unnecessarily inflate the font. There is already an internal CmapStrategy enum used to drive some of the |
Yeah I agree that it shouldn't be default, since this is kind of an edge case. What I meant was a way to externally change the encoding mode, for example as a parameter to the |
2022 Update:
cmap
generation when subsetting, which the original text of this issue focussed around landed in Allsorts 0.9. However, this does not get us all the way to generating standalone fonts. This issue will act as a tracking issue for things that are required to achieve that.Original text:
The subsetting feature is currently tailored for the needs of subsetting fonts for embedding in PDFs, since that was our primary use case when developing Allsorts. The issue is that we don't include a cmap table in the subset font, which makes it invalid for use outside PDF. When a subset font is embedded in a PDF the cmap info is contained in the PDF directly, so we don't need to include it in the font.
In order to support more general subsetting it would be convenient to have an entry point that takes a list of chars and produces a font with glyphs for just those chars. This would be an incremental improvement on what we have so far and would still have some limitations: with chars as input there wouldn't be a way to include ligature glyphs. Doing so would require subsetting
gpos
, andgsub
tables as well, which is a problem for another day.The subsetting code lives in subset.rs. The new function signature could be along these lines:
The implementation would need to map
chars
to glyph ids using a technique similar to this. The subset font would need to include a new cmap table (probably using the Unicode platformID). There's a bunch of formats to chose from to encode the data. An initial implementation might just choose one of the simpler ones at the cost of size of the resulting font. A more sophisticated implementation could examine the data to determine the best option.The text was updated successfully, but these errors were encountered: