-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Feature: Process TTC files #783
Conversation
2e029c4
to
517d4ec
Compare
Thank god we have the tests! Had the indentation level wrong 😒 |
Does this depend on any other changes? I pulled down the version from the branch and got:
|
Ah, wasn't aware I had to have the glyphs locally. Pulled down via
And now it seems to work:
|
Yes, that comes sometimes unexpected. Will be fixed by #741, if it will be pulled.
Obviously you selected the branch afterwards?
🎉 Great! Nice to see someone finding the work useful :-) |
Nice!
Actually I didn't, the clone already used master, which seemed correct. Is it not?
The only slight weirdness is this, but I don't think that's due to this patch:
Thanks for doing these fixes! 👍🏻 |
#413 is the warning it seems |
517d4ec
to
8e62a57
Compare
Rebase on master. Hell, what a job. That diverged a lot... What I did not try to adapt is the PPEM stuff, that is not fixed in the resultant But the en passant
|
[why] Parsing the command line arguments has nothing to do with the actual patching. If we want to patch more than one font we need to separate the partching from unrelated work. [how] Just do the argument processing in main() and hand the information over to the patcher object. [note] No functional change. Lines copied over (almost *) 1:1. (*) Exceptions: self.sym_font_args is now only a local variable, as it is only used in this one function. The startup message is shown on ... startup (i.e. main()). Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] The extension handling is a bit out-of-place and could be handled by the arguments handling, which simplifies the code. Somes goes for other argument validity checks. [how] Put argument checks into setup_arguments(). Dropping self.extensions in favour of self.args.extensions. No functional change. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] These operations are also not strictly patching. When we want to handle more than one font we need to have this outside the patch() function. [how] Put opening and exporting (previously in __init__() and patch() into main() outside the patcher object. No functional change (except the sourceFont is now closed :->) Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] Someone might want to patch a whole lot of fonts that come in a ttc. [how] Just open all fonts that the input file contains (1 or more) and create a single font or collection font file. The automatic layer detection does not work in all cases for me, so we need to manually search for the foreground layer (usually '1'). Code inspiration taken from powerline/fontpatcher#6 [note] Changed output in the end to the filename (before it was the font name), so that one can easily copy&paste or open that file. Reported-by: Lily Ballard <lily@ballards.net> Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] With the new TTC feature we might increase the minor number ;-) This is not just a bugfix. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] The font flags and PPEM fix does not work with font collection files, because it does not know how to handle them. It assumes a ttf or otf font with the specified table structure. The fix (for single font files) has been introduced with commit 40138be font-patcher: Handle lowestRecPPEM [how] Check if the file is of type 'ttcf', and if so fast forward to the given single font index into the collection. This can be rather slow... Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
a5fc03f
to
7c5c838
Compare
Feature: Process TTC files
Description
[why]
Someone might want to patch a whole lot of fonts that come in a ttc.
[how]
Just open all fonts that the input file contains (1 or more) and create
a single font or collection font file.
The automatic layer detection does not work in all cases for me, so we
need to manually search for the foreground layer (usually '1').
Code inspiration taken from
powerline/fontpatcher#6
[note]
Changed output in the end to the filename (before it was the font name),
so that one can easily copy&paste or open that file.
Reported-by: Lily Ballard lily@ballards.net
Requirements / Checklist
What does this Pull Request (PR) do?
Add possibility to 'batch patch' True Type Collections and store the result again in a TTC.
The first 3 commits just juggle around the existing code without (*cough*) functional changes. These changes are anyhow good as they clean up a bit the what-does-what.
Only the 4th commit finally adds functionality.
It does not use
ttcflags=('merge',)
as I do not know if oldfontforge
s can do that (probably not), and it seems to do not much.How should this be manually tested?
Any background context you can provide?
What are the relevant tickets (if any)?
#175
#735
#752 (comment)
Screenshots (if appropriate or helpful)
Patching Iosevka TTC:
Needs of course a
fontforge
built from HEAD because of the now fixed 16 bit bug