Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
font-patcher: Handle TTCs gracefully
[why] When a True Type Collection file (.ttc) is used as font source this is not 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 and save the first font (patched) when specifying a different extension via `-ext`. Or open a normal font and specify `ttc` as extension i.e. target file 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 at all. 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 with ttc 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. Signed-off-by: Fini Jastrow <[email protected]>
- Loading branch information