Skip to content
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

otfcc-driven patching workflow #83

Closed
be5invis opened this issue May 14, 2016 · 22 comments
Closed

otfcc-driven patching workflow #83

be5invis opened this issue May 14, 2016 · 22 comments

Comments

@be5invis
Copy link
Collaborator

be5invis commented May 14, 2016

Given that some of the programming fonts (like Iosevka) may contain special metadata to achieve some special targets (like being used within Windows console window). Therefore the current patching script (using FontForge) may not be appropriate since FontForge cannot generate a font with such specialized data. A replacement used for patching may be involved with otfcc, which is a high-performance font manipulator dumps a font into JSON, and vice versa.

We can investigate an alternative patching script using otfcc, to create a “special-data-preserving” font patching workflow.


PROPOSAL

  1. Dump <target.ttf> into JSON <target.otd> using otfccdump.
  2. Build a <patch.ttf> containing Nerd symbols matching <target.otd>’s head.unitsPerEm.
  3. Dump <patch.ttf> into JSON <patch.otd> with glyph names prefixed.
  4. Merge <patch.otd> into <target.otd> (using some script. Python?), with the following tables merged:
    • cmap
    • glyf
  5. Build <product.ttf> from <target.otd> using otfccbuild with --keep-average-char-width and --ship options.
  6. (optional) Autohint <product.ttf> with ttfautohint.
@be5invis
Copy link
Collaborator Author

be5invis commented May 17, 2016

@ryanoasis I've made a sample code using Node.js and otfcc: nerdpatcher.7z

The nerd.ttf is a TrueType font matching the target font's upm. The current patching script simply drops the hints of the Nerd part. You can re-hint it using ttfautohint after the patched .ttf is created.

This script preserves all metadata from the original font, therefore it shares the compatibility of the original font.

In this script naming entries are not modified. If you want to change the font's name, set the nameString field of entries in orig.name in merge.js.

LIMITATIONS: ONLY TTFS ARE SUPPORTED (because otfcc's CFF OTF suppport is still under development)

@ryanoasis
Copy link
Owner

@be5invis I really appreciate all this thanks. Not sure when I will get around to trying it out but I want to! 👍

@be5invis
Copy link
Collaborator Author

be5invis commented Jun 8, 2016

ps. I suggest that the name of the patched font is “Imposevka” 👻
Means “Iosevka with imported glyphs”

@ryanoasis
Copy link
Owner

@be5invis Good idea and that is a pretty clever name 😄

I will update the name in the next release (the otfcc patching ... probably will not be soon though 😊).


Are you wanting or saying you are Reserving the Iosevka name ?

I did not see the typical 'Reserved Font Name' declaration in the Iosevka License even though the license is SIL OFL like I typically do on OFL licensed fonts (e.g. Hack License)

Maybe you want to add that to the license (unless I am behind or misunderstanding the license)?

source: http://scripts.sil.org/cms/scripts/page.php?item_id=OFL-FAQ_web#9d7a93f7

@be5invis
Copy link
Collaborator Author

be5invis commented Jun 8, 2016

@ryanoasis I thought that name reservation does not need to declare it explicitly in LICENSE. 😢
It is now added.

@ryanoasis
Copy link
Owner

Heh that is what I wasn't exactly sure about either but it sounds like it from what I was reading. Either way I would have done the name change as it is your font after all 😉

@be5invis
Copy link
Collaborator Author

be5invis commented Jun 8, 2016

My suggested patching workflow is to use the script in my previous comment, which preserves all “good” properties of Iosevka. Perhaps you can try to create a ttf with only NERD glyphs, and set upm to 1000, char width to 500.

@ryanoasis
Copy link
Owner

Ah here we go:

related: 5.6

per 5.7

Question: 5.7 Are any names (such as the main font name) reserved by default?

Answer: No. That is a change to the license as of version 1.1. If you want any names to be Reserved Font Names, they must be specified after the copyright statement(s).

@be5invis
Copy link
Collaborator Author

be5invis commented Jun 8, 2016

@ryanoasis I've added the declaration into LICENSE.md.

@ryanoasis
Copy link
Owner

Thanks for the info on the ttf i'll give that a try sometime

@be5invis
Copy link
Collaborator Author

@ryanoasis I’ve made a full script to build Imposevka, and sample fonts built from the latest 1.9.0 release. Link: http://7xpe0v.com1.z0.glb.clouddn.com/imposevka-patcher.7z

To build:

  1. Prepare nodejs and otfcc
  2. Put Iosevka files into src/
  3. Put Nerd’s additional characters into nerd.ttf
  4. make

@ryanoasis
Copy link
Owner

@be5invis Wow really great stuff thanks 👍

Apologies, I hope you don't take my slow response for lack of interest.

@vbauerster
Copy link

Any plans to update patched iosevka to the latest version 1.9.3?

fmthoma added a commit to fmthoma/config-files that referenced this issue Apr 15, 2017
@ryanoasis
Copy link
Owner

@vbauerster oh wow didn't see your comment. We can target it for v1.2.0 release. I'll make a ticket so it's not lost

@ryanoasis
Copy link
Owner

update patched iosevka to the latest version 1.9.3
We can target it for v1.2.0 release. I'll make a ticket so it's not lost

@vbauerster Looks like I dropped the ball on this 😢

@ryanoasis
Copy link
Owner

@vbauerster done: #229

@OJFord
Copy link

OJFord commented Sep 20, 2019

The linked script is no longer available, though it is fortunately preserved in fmthoma/config-files@6403f75, what I'm not clear on however is how to generate nerd.ttf? ./font-patcher from the repo requires an extant font to patch.

@ashb
Copy link

ashb commented Jan 30, 2020

@OJFord The way I did it was to create a new font in FontForge, draw one rubbish character (had to be non-empty to let FontForge create it) -- patch that, then remove the character I added from the patched font.

Oh, though I suspect https://github.com/ryanoasis/nerd-fonts/blob/master/src/glyphs/Symbols-1000-em%20Nerd%20Font%20Complete.ttf might be the same file.

If it would useful to anyone I can put my patched version somewhere -- just let me know which variant/style of Iosevka you would like patched.

@J3m5
Copy link

J3m5 commented Sep 30, 2020

Hi @ryanoasis , would it be possible to update Iosevka to the latest version 3.6.2 ?
Thanks

@ELLIOTTCABLE
Copy link

Does Iosevka still not patch properly with the FontForge patcher-script? It's in the middle of running (slowly!) on my machine, but the output looks sensible so far …

@be5invis
Copy link
Collaborator Author

be5invis commented Feb 2, 2021

It looks like that latest FontForge finally fixed exporting reverse chaining sub.
Using original patcher should work now.
Closing.

@be5invis be5invis closed this as completed Feb 2, 2021
@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a new issue, complete the issue template with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 13, 2023
@Finii Finii added this to the Parallel Universe milestone Apr 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants