Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[why]
When a True Type Collection file (
.ttc
) is used as font source this isnot handled and just the first file in the collection is processed and
saved. But the user is not informed.
When the target file format is True Type Collection, no file at all is
written.
These are two distinct cases, because you can in fact open a
.ttc
andsave the first font (patched) when specifying a different extension via
-ext
. Or open a normal font and specifyttc
as extension i.e. targetfile format.
[how]
Check if a collection is to be opened. As we currently have no code to
loop through all fonts (and just the first font is processed) a message
is issued and we exit. Typically a user would want all the fonts and
would have to 'explode' the collection into multiple single font files
beforehand.
Prevent the target to be
ttc
, as that is not handled in fontforge atall. To save TTCs a different API function is to be used. Unfortunately
fontforge does not care and just does nothing.
font.generateTtc()
would have to be used withttc
extensions...Anyhow. As the looping through all fonts is missing anyhow, and I feel
the usefulness is very slim, we just prevent silent failures with this
commit.
Requirements / Checklist
What does this Pull Request (PR) do?
How should this be manually tested?
fontforge --script font-patcher [...] -ext ttc
(shall fail with meaningful message)fontforge --script font-patcher somefont.tcc
(shall fail with meaningful message)fontforge --script font-patcher somefont.tcc -ext ttf
(WOULD work for the first embedded font, now prevented)Any background context you can provide?
#735
What are the relevant tickets (if any)?
#175
#664 (!!!?)
powerline/fontpatcher#6
We could also wield #6 ... in a next step ;) If you think its needed. The change today would be much smaller than back then I guess. But there are so many PRs waiting ;)
Screenshots (if appropriate or helpful)