font-patcher
script
This explains the font-patcher
command line options for version v3.4.0-5 (4.20.3)
.
Nerd Fonts Patcher v3.4.0-5 (4.20.3) (ff 20230101)
usage: font-patcher [--careful] [--debug [{0,1,2,3}]] [--extension EXTENSION]
[--help] [--makegroups [{-1,0,1,2,3,4,5,6}]] [--mono]
[--outputdir OUTPUTDIR] [--quiet] [--single-width-glyphs]
[--variable-width-glyphs] [--version] [--complete]
[--codicons] [--fontawesome] [--fontawesomeext]
[--fontlogos] [--material] [--octicons] [--pomicons]
[--powerline] [--powerlineextra] [--powersymbols]
[--weather] [--adjust-line-height] [--boxdrawing]
[--cell CELLOPT] [--configfile CONFIGFILE]
[--custom CUSTOM] [--dry] [--glyphdir GLYPHDIR]
[--has-no-italic] [--metrics {HHEA,TYPO,WIN}]
[--name FORCE_NAME] [--postprocess POSTPROCESS]
[--removeligs] [--xavgcharwidth [XAVGWIDTH]]
[--progressbars | --no-progressbars]
font
Only the long form is listed here. Expand option to get full explanation.
font
The path to the font to patch (e.g., Inconsolata.otf) The to-be-patched font file, relative and absolute path is allowed. All font formats that fontforge
can open are allowed, but usually .ttf
or .otf
are best. Also .ttc
is possible, but the size savings that would be possible are not utilized. --help
show this help message and exit The message is obviously not good and long enough, or you would not be looking here. Hope you find something useful. --version
show program's version number and exit The detailed version is anyhow printed on every start of the font-patcher
with Release and script versions, so this is most useful for scripts that want to check the version rather than humans. --mono
Create monospaced font, existing and added glyphs are single-width (implies --single-width-glyphs) Create a truly monospaced font (Nerd Font Mono
) That means that the added icons are also one (1) 'cell' wide which some people find too small. On the other hand these fonts work with all terminals because there are no problematic glyph sizes, all fits into the cells.
Nerd Font
is created: Here the symbols are typically a bit wider than one cell (1.5 widths) to make them more readable. The 'advance width' is still one cell, so the next glyph will be printed on top of the right half of the symbol - you need to add a blank after any icon. A lot of executables and terminals can work with this.
variable-width-glyphs
, single-width-glyphs
--variable-width-glyphs
Do not adjust advance width (no "overhang") (Nerd Font Propo) Create a proportional font (Nerd Font Propo
That means that the added icons are wider than one (1) 'cell' and really occupy that space - their advance width is the same as the visual width. No need to add any blanks but still bigger icons than a Nerd Font Mono
font. This is most useful for GUI contexts instead terminal contexts.
Nerd Font
is created: Here the symbols are typically a bit wider than one cell (1.5 widths) to make them more readable. The 'advance width' is still one cell, so the next glyph will be printed on top of the right half of the symbol - you need to add a blank after any icon. A lot of executables and terminals can work with this.
mono
--single-width-glyphs
Whether to generate the glyphs as single-width not double-width (default is double-width) (Nerd Font Mono) This creates a font alike Nerd Font Mono
(the added icons are one (1) 'cell' wide, but it does not touch existing glyphs. The font is not forced to be monospaced throughout. This is useful when you want to keep some un-proportional features from to-be-patched upstream in the created font (like certain types of ligatures), but still want to have the Nerd Font icons just one 'cell' wide.
mono
--debug [N]
Verbose mode The patcher can output diagnostics and details of what is does and sometimes what it guesses. This can help in problematic cases or when you want to create an Issue report.
--debug
without number)font-patcher-log.txt
and be placed where the script itself is. The lines in that file get the source font file name (which the output to the console does not have). --quiet
Do not generate verbose output Some standard output is suppressed. Usually best when you also redirect stderr to discard it (... 2>/dev/null
). --careful
Do not overwrite existing glyphs if detected If a codepoint is already in use in the unpatched font it will not be replaced if you give this option. Useful if you find that glyphs you like have been replaced after patching. On the other hand the icons that we would have put there are then of course missing. --extension EXTENSION
Change font file type to create (e.g., ttf, otf) Specify the format of the generated patched font. Usually you should keep the original font's format. --outputdir OUTPUTDIR
The directory to output the patched font file to Normally the patched font ends up in the current working directory, but you can specify a different relative or absolute path here. Make sure you can write to that directory. --makegroups [N]
Use alternative method to name patched fonts Sometimes the name of the patched font is rather long. With this option you can select a strategy to shorten it. See the following table which component gets shorted:
Original font name: Hugo Sans Mono ExtraCondensed Light Italic
NF Family aggessive
-1 no renaming at all (keep old names and versions etc) --- --- ---
0 turned off, use old naming scheme [-] [-] [-]
1 HugoSansMono Nerd Font ExtraCondensed Light Italic [ ] [ ] [ ]
2 HugoSansMono Nerd Font ExtCn Light Italic [ ] [X] [ ]
3 HugoSansMono Nerd Font XCn Lt It [ ] [X] [X]
4 HugoSansMono NF ExtraCondensed Light Italic [X] [ ] [ ]
5 HugoSansMono NF ExtCn Light Italic [X] [X] [ ]
6 HugoSansMono NF XCn Lt It [X] [X] [X]
Note: The 'old naming scheme' often creates broken font sets --complete
Add all available Glyphs Patch in all sets... --codicons
Add Codicons Glyphs Patch in this set: https://github.com/microsoft/vscode-codicons
--fontawesome
Add Font Awesome Glyphs Patch in this set: http://fontawesome.io
--fontawesomeext
Add Font Awesome Extension Glyphs Patch in this set: https://andrelzgava.github.io/font-awesome-extension
--fontlogos
Add Font Logos Glyphs Patch in this set: https://github.com/Lukas-W/font-logos
--material
Add Material Design Icons Patch in this set: https://github.com/templarian/MaterialDesign
--octicons
Add Octicons Glyphs Patch in this set: https://octicons.github.com
--powersymbols
Add IEC Power Symbols Patch in this set: https://unicodepowersymbol.com
--pomicons
Add Pomicon Glyphs Patch in this set: https://github.com/gabrielelana/pomicons
--powerline
Add Powerline Glyphs See Glyph Sets and Code Points Overview for details. --powerlineextra
Add Powerline Extra Glyphs Patch in this set: https://github.com/ryanoasis/powerline-extra-symbols
--weather
Add Weather Icons Patch in this set: https://github.com/erikflowers/weather-icons
--adjust-line-height
Whether to adjust line heights (attempt to center powerline separators more evenly) If the determined cell height is odd in design units it will be coerced to a even number by adding 1. Well, one design unit is usually 1/500th to 1/2000th of the full height, so you will hardly ever see any difference. Probably this option in completely useless and is only kept for historic reasons. --boxdrawing
Force patching in (over existing) box drawing glyphs The box drawing glyphs (2500
- 259f
are not patched in if the original font already has all of these. If only a subset exists the exiting glyphs are replaced by the Nerd Fonts Box set to get the same style for all Box glyphs.
--cell CELLOPT
Adjust or query the cell size, e.g. use 0:1000:-200:800
or "?"
With this option you can specify/force the size of the 'cell' in case the automatic detection is not optimal. Give 4 numbers separated by colons like 0:1000:-200:800
where the values are X-min, X-max, Y-min, Y-max in EM-units.
CELLOPT
. If your shell tries to interpret the ?
you might need to quote or escape it. --configfile FILE
Specify a file path for JSON configuration file (see sample: src/config.sample.json) The patching process can be influenced by a configuration file. At the moment that is only used for --removeligs
. --custom CUSTOM
Specify a custom symbol font, all glyphs will be copied; absolute path suggested If you have a font with some few glyphs that you want to patch in, this is the option for that. Usually the custom symbol font needs to be specifically crafted for your purpose.
--dry
Do neither patch nor store the font, to check naming This generated most of the warning messages a real run would without producing any file. --glyphdir GLYPHDIR
Path to glyphs to be used for patching The icon set font files are expected to be in some specific directory relative to the script file. When the files reside somewhere else you can specify the path to them here. This is very seldom useful. --has-no-italic
Font family does not have Italic (but Oblique), to help create correct RIBBI set The font-patcher
tries to generate RIBBI sets of fonts. RIBBI means 'Regular Italic Bold Bold-Italic'. A lot applications use/expect fonts to be such a set-of-four. But some fonts have (only) Oblique instead of Italic - in that case you want a 'Regular Oblique Bold Bold-Oblique' set and need to specify this option. --metrics METRIC
Select vertical metrics source (for problematic cases) The baseline to baseline distance of a font can be specified in three different ways. Sometimes a source font contradicts itself because the three metrics do not agree. The script tries then to come up with a reasonable estimate. If that is wrong you can force another metric to be used. Use --debug
to see the three values. --name MODE-OR-NAME
Specify naming source ('full', 'postscript', 'filename', or concrete free name-string) The font-patcher
has to find out the name and the weight and style of the font. That can be challenging and the script tries to guess which is best.
FamilyName-StyleWeight
(e.g. MysticFont-Regular
). To get complete control over the naming the usual "Nerd Font" suffix is not added to the name in the free string case. --postprocess SCRIPT
Specify a Script for Post Processing Sometimes you want to call some helper after patching. The helper is called in a subshell with the generated patched font file's name as argument. That had been used in the past to automatically hint the patched font, but that should not be necessary anymore. --removeligs
Removes ligatures specificed in configuration file (needs --configfile) This does not automatically remove all ligatures! Instead it removes some tables from the font, which need to be specified in a config file. Removing tables can break the font in various ways, be careful.
--xavgcharwidth [N]
Adjust xAvgCharWidth (optional: concrete value) In some very rare cases the xAvgCharWidth
is important to keep. Patching in wider icons changes this value.
xAvgCharWidth
is copied over from the sourcexAvgCharWidth
xAvgCharWidth
, which ignores our added icons --progressbars
Show percentage completion progress bars per Glyph Set (default) Show one progress bar per glyph set, to shorten the wait time. --no-progressbars
Don't show percentage completion progress bars per Glyph Set Do not show the progress bar but instead details for each patched-in glyph like codepoint and name. That is a lot output.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4