Skip to content

Commit

Permalink
font-patcher: Remove option --use-single-width-glyphs
Browse files Browse the repository at this point in the history
[why]
There are three possible options to specify the Nerd Font Mono generation:
    -s
    --mono
    --use-single-width-glyphs

All the three are handled the same.

In order to add a new long option that also handles glyph width in a "single"
cell manner the fear is that two too similar options will confuse users.

[how]
Just remove the longest form (which can be considered a breaking change, at
least for people who like to type long option names). But from the version
number we keep it as feature 😬

Also removed already from the readme files.

Need to adapt the install.sh script.

Signed-off-by: Fini Jastrow <[email protected]>
  • Loading branch information
Finii committed Jan 8, 2025
1 parent de2fed4 commit dacf6e4
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 47 deletions.
8 changes: 4 additions & 4 deletions font-patcher
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from __future__ import absolute_import, print_function, unicode_literals

# Change the script version when you edit this script:
script_version = "4.16.3"
script_version = "4.17.0"

version = "3.3.0"
projectName = "Nerd Fonts"
Expand Down Expand Up @@ -837,7 +837,7 @@ class font_patcher:
"results might be useless%s",
" - offending char: {:X}".format(offending_char) if offending_char is not None else "")
if self.args.single <= 1:
logger.critical("Font will not be patched! Give --mono (or -s, or --use-single-width-glyphs) twice to force patching")
logger.critical("Font will not be patched! Give --mono (or -s) twice to force patching")
sys.exit(1)
if width_mono:
force_panose_monospaced(self.sourceFont)
Expand Down Expand Up @@ -1974,7 +1974,7 @@ def setup_arguments():
# optional arguments
parser.add_argument('font', help='The path to the font to patch (e.g., Inconsolata.otf)')
parser.add_argument('-v', '--version', action='version', version=projectName + ": %(prog)s (" + version + ")")
parser.add_argument('-s', '--mono', '--use-single-width-glyphs', dest='single', default=False, action='count', help='Whether to generate the glyphs as single-width not double-width (default is double-width) (Nerd Font Mono)')
parser.add_argument('-s', '--mono', dest='single', default=False, action='count', help='Whether to generate the glyphs as single-width not double-width (default is double-width) (Nerd Font Mono)')
parser.add_argument('--variable-width-glyphs', dest='nonmono', default=False, action='store_true', help='Do not adjust advance width (no "overhang") (Nerd Font Propo)')
parser.add_argument('--debug', dest='debugmode', default=0, type=int, nargs='?', help='Verbose mode (optional: 1=just to file; 2*=just to terminal; 3=display and file)', const=2, choices=range(0, 3 + 1))
parser.add_argument('-q', '--quiet', dest='quiet', default=False, action='store_true', help='Do not generate verbose output')
Expand Down Expand Up @@ -2089,7 +2089,7 @@ def setup_arguments():
args.complete = font_complete

if args.nonmono and args.single:
logger.warning("Specified contradicting --variable-width-glyphs and --use-single-width-glyph. Ignoring --variable-width-glyphs.")
logger.warning("Specified contradicting --variable-width-glyphs and --mono. Ignoring --variable-width-glyphs.")
args.nonmono = False

make_sure_path_exists(args.outputdir)
Expand Down
8 changes: 4 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Install Nerd Fonts
__ScriptVersion="0.7"
__ScriptVersion="0.8"

# Default values for option variables:
quiet=false
Expand All @@ -15,7 +15,7 @@ installpath="user"
usage() {
cat << EOF
Usage: ./install.sh [-q -v -h] [[--copy | --link] --clean | --list | --remove]
[--use-single-width-glyphs] [--windows] [--otf | --ttf]
[--mono] [--windows] [--otf | --ttf]
[--install-to-user-path | --install-to-system-path ]
[FONT...]
Expand All @@ -36,7 +36,7 @@ General options:
with this script).
Can be combined with -L for a dry run.
-s, --use-single-width-glyphs Install single-width glyphs variants.
-s, --mono Install single-width glyphs variants.
-p, --use-proportional-glyphs Install proportional glyphs variants.
-U, --install-to-user-path Install fonts to users home font path [default].
Expand Down Expand Up @@ -87,7 +87,7 @@ while getopts "$optspec" optchar; do
[ "$mode" != "remove" ] && mode="list";;
remove) mode="remove";;
clean) clean=true;;
use-single-width-glyphs) variant="M";;
mono) variant="M";;
use-proportional-glyphs) variant="P";;
otf) extension="otf";;
ttf) extension="ttf";;
Expand Down
5 changes: 2 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,7 @@ positional arguments:
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-s, --mono, --use-single-width-glyphs
Whether to generate the glyphs as single-width not double-width (default is double-width) (Nerd Font Mono)
-s, --mono Whether to generate the glyphs as single-width not double-width (default is double-width) (Nerd Font Mono)
--variable-width-glyphs
Do not adjust advance width (no "overhang") (Nerd Font Propo)
--debug [{0,1,2,3}] Verbose mode (optional: 1=just to file; 2*=just to terminal; 3=display and file)
Expand Down Expand Up @@ -538,7 +537,7 @@ Expert Options:
```
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -s -q
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --use-single-width-glyphs --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --mono --quiet
./font-patcher Inconsolata.otf --fontawesome
./font-patcher Inconsolata.otf --fontawesome --octicons --pomicons
Expand Down
5 changes: 2 additions & 3 deletions readme_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,7 @@ positional arguments:
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-s, --mono, --use-single-width-glyphs
Whether to generate the glyphs as single-width not double-width (default is double-width)
-s, --mono Whether to generate the glyphs as single-width not double-width (default is double-width)
-l, --adjust-line-height
Whether to adjust line heights (attempt to center powerline separators more evenly)
-q, --quiet, --shutup
Expand Down Expand Up @@ -404,7 +403,7 @@ Symbol Fonts:

./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -s -q
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --use-single-width-glyphs --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --mono --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -w
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --pomicons --quiet
Expand Down
5 changes: 2 additions & 3 deletions readme_es.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,7 @@ argumentos posicionales:
argumentos opcionales:
-h, --help muestra este mensaje de ayuda y sale
-v, --version muestra la versión del programa y sale
-s, --mono, --use-single-width-glyphs
Indica si genera los glifos como ancho simple, no doble (por defecto es ancho doble)
-s, --mono Indica si genera los glifos como ancho simple, no doble (por defecto es ancho doble)
-l, --adjust-line-height
Indica si se ajustan las alturas de línea (para intentar centrar los separadores de powerline más parejo)
-q, --quiet, --shutup
Expand Down Expand Up @@ -434,7 +433,7 @@ Symbol Fonts:
```
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -s -q
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --use-single-width-glyphs --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --mono --quiet
./font-patcher Inconsolata.otf --fontawesome
./font-patcher Inconsolata.otf --fontawesome --octicons --pomicons
Expand Down
5 changes: 2 additions & 3 deletions readme_fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,7 @@ positional arguments:
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-s, --mono, --use-single-width-glyphs
Whether to generate the glyphs as single-width not double-width (default is double-width)
-s, --mono Whether to generate the glyphs as single-width not double-width (default is double-width)
-l, --adjust-line-height
Whether to adjust line heights (attempt to center powerline separators more evenly)
-q, --quiet, --shutup
Expand Down Expand Up @@ -465,7 +464,7 @@ Symbol Fonts:

./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -s -q
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --use-single-width-glyphs --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --mono --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -w
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --pomicons --quiet
Expand Down
5 changes: 2 additions & 3 deletions readme_hi.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,7 @@ positional arguments:
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-s, --mono, --use-single-width-glyphs
Whether to generate the glyphs as single-width not double-width (default is double-width)
-s, --mono Whether to generate the glyphs as single-width not double-width (default is double-width)
-l, --adjust-line-height
Whether to adjust line heights (attempt to center powerline separators more evenly)
-q, --quiet, --shutup
Expand Down Expand Up @@ -442,7 +441,7 @@ Symbol Fonts:

./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -s -q
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --use-single-width-glyphs --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --mono --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -w
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --pomicons --quiet
Expand Down
5 changes: 2 additions & 3 deletions readme_it.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,7 @@ positional arguments:
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-s, --mono, --use-single-width-glyphs
Whether to generate the glyphs as single-width not double-width (default is double-width)
-s, --mono Whether to generate the glyphs as single-width not double-width (default is double-width)
-l, --adjust-line-height
Whether to adjust line heights (attempt to center powerline separators more evenly)
-q, --quiet, --shutup
Expand Down Expand Up @@ -386,7 +385,7 @@ Symbol Fonts:

./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -s -q
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --use-single-width-glyphs --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --mono --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -w
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --pomicons --quiet
Expand Down
5 changes: 2 additions & 3 deletions readme_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,7 @@ positional arguments:
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-s, --mono, --use-single-width-glyphs
Whether to generate the glyphs as single-width not double-width (default is double-width)
-s, --mono Whether to generate the glyphs as single-width not double-width (default is double-width)
-l, --adjust-line-height
Whether to adjust line heights (attempt to center powerline separators more evenly)
-q, --quiet, --shutup
Expand Down Expand Up @@ -381,7 +380,7 @@ Symbol Fonts:

./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -s -q
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --use-single-width-glyphs --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --mono --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -w
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --pomicons --quiet
Expand Down
5 changes: 2 additions & 3 deletions readme_ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,7 @@ positional arguments:
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-s, --mono, --use-single-width-glyphs
Whether to generate the glyphs as single-width not double-width (default is double-width)
-s, --mono Whether to generate the glyphs as single-width not double-width (default is double-width)
-l, --adjust-line-height
Whether to adjust line heights (attempt to center powerline separators more evenly)
-q, --quiet, --shutup
Expand Down Expand Up @@ -382,7 +381,7 @@ Symbol Fonts:

./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -s -q
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --use-single-width-glyphs --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --mono --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -w
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --pomicons --quiet
Expand Down
5 changes: 2 additions & 3 deletions readme_pl.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,7 @@ positional arguments:
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-s, --mono, --use-single-width-glyphs
Whether to generate the glyphs as single-width not double-width (default is double-width)
-s, --mono Whether to generate the glyphs as single-width not double-width (default is double-width)
-l, --adjust-line-height
Whether to adjust line heights (attempt to center powerline separators more evenly)
-q, --quiet, --shutup
Expand Down Expand Up @@ -458,7 +457,7 @@ Symbol Fonts:

./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -s -q
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --use-single-width-glyphs --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --mono --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -w
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --pomicons --quiet
Expand Down
5 changes: 2 additions & 3 deletions readme_pt-pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,7 @@ positional arguments:
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-s, --mono, --use-single-width-glyphs
Whether to generate the glyphs as single-width not double-width (default is double-width)
-s, --mono Whether to generate the glyphs as single-width not double-width (default is double-width)
-l, --adjust-line-height
Whether to adjust line heights (attempt to center powerline separators more evenly)
-q, --quiet, --shutup
Expand Down Expand Up @@ -382,7 +381,7 @@ Symbol Fonts:

./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -s -q
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --use-single-width-glyphs --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --mono --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -w
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --pomicons --quiet
Expand Down
5 changes: 2 additions & 3 deletions readme_ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,7 @@ positional arguments:
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-s, --mono, --use-single-width-glyphs
Whether to generate the glyphs as single-width not double-width (default is double-width)
-s, --mono Whether to generate the glyphs as single-width not double-width (default is double-width)
-l, --adjust-line-height
Whether to adjust line heights (attempt to center powerline separators more evenly)
-q, --quiet, --shutup
Expand Down Expand Up @@ -432,7 +431,7 @@ Symbol Fonts:
```
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -s -q
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --use-single-width-glyphs --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --mono --quiet
./font-patcher Inconsolata.otf --fontawesome
./font-patcher Inconsolata.otf --fontawesome --octicons --pomicons
Expand Down
5 changes: 2 additions & 3 deletions readme_tw.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,7 @@ positional arguments:
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-s, --mono, --use-single-width-glyphs
Whether to generate the glyphs as single-width not double-width (default is double-width)
-s, --mono Whether to generate the glyphs as single-width not double-width (default is double-width)
-l, --adjust-line-height
Whether to adjust line heights (attempt to center powerline separators more evenly)
-q, --quiet, --shutup
Expand Down Expand Up @@ -432,7 +431,7 @@ Symbol Fonts:
```
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -s -q
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --use-single-width-glyphs --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --mono --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -w
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --pomicons --quiet
Expand Down
5 changes: 2 additions & 3 deletions readme_uk.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,7 @@ positional arguments:
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-s, --mono, --use-single-width-glyphs
Whether to generate the glyphs as single-width not double-width (default is double-width)
-s, --mono Whether to generate the glyphs as single-width not double-width (default is double-width)
-l, --adjust-line-height
Whether to adjust line heights (attempt to center powerline separators more evenly)
-q, --quiet, --shutup
Expand Down Expand Up @@ -378,7 +377,7 @@ Symbol Fonts:

./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -s -q
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --use-single-width-glyphs --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --mono --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -w
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --pomicons --quiet
Expand Down

0 comments on commit dacf6e4

Please sign in to comment.