Prepatched fonts: Revive some ligature removal

[why]
Some sourcefonts, even that are monospaced, have a `fi` and/or `fl`
ligature that maps into one cell. That looks very strange.

[how]
Partially revert commit
  148b0c445  Sunset ligature removal

for the cases that have a one-cell `fi`, `fl`, etc ligature, or a `ldot`
related ligature - that is active by default. Discretionary ligatures or
Stylistic Sets are not changed.

Do the removal on all patched fonts for consistency, not just `Nerd Font Mono`.

[note]
On Noto different subtables are needed for Sans, Serif and Sans-Mono. We
can not set up different configs for each, so all are tried in all fonts
and might fail (this is normal).
Same holds for OpenDyslexic Alta, Regular, Mono, Bold...

Fixes: #1187

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2023-05-02 13:23:54 +02:00 committed by Fini
parent c4c024e17b
commit d9f7dbe238
13 changed files with 45 additions and 8 deletions

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Nerd Fonts Version: 3.0.0
# Script Version: 1.4.3
# Script Version: 1.4.4
#
# You can supply options to the font-patcher via environment variable NERDFONTS
# That option will override the defaults (also defaults of THIS script).
@ -228,7 +228,6 @@ function patch_font {
if [ -f "$config_parent_dir/config.json" ]
then
# load font configuration file and remove ligatures (for mono fonts):
# (tables have been removed from the repo with >this< commit)
font_config="--removeligatures --configfile $config_parent_dir/config.json"
else
font_config=""
@ -252,9 +251,9 @@ function patch_font {
# Create "Nerd Font"
if [ -n "${verbose}" ]
then
echo "fontforge -quiet -script ${PWD}/font-patcher "$f" -q $powerline $post_process -c --no-progressbars --outputdir "${patched_font_dir}" $config_patch_flags ${NERDFONTS}"
echo "fontforge -quiet -script ${PWD}/font-patcher "$f" -q ${font_config} $powerline $post_process -c --no-progressbars --outputdir "${patched_font_dir}" $config_patch_flags ${NERDFONTS}"
fi
{ OUT=$(fontforge -quiet -script ${PWD}/font-patcher "$f" -q $powerline $post_process -c --no-progressbars \
{ OUT=$(fontforge -quiet -script ${PWD}/font-patcher "$f" -q ${font_config} $powerline $post_process -c --no-progressbars \
--outputdir "${patched_font_dir}" $config_patch_flags ${NERDFONTS} 2>&1 1>&3 3>&- ); } 3>&1
if [ $? -ne 0 ]; then printf "$OUT\nPatcher run aborted!\n\n"; fi
# Create "Nerd Font Mono"
@ -268,9 +267,9 @@ function patch_font {
# Create "Nerd Font Propo"
if [ -n "${verbose}" ]
then
echo "fontforge -quiet -script ${PWD}/font-patcher "$f" -q --variable $powerline $post_process -c --no-progressbars --outputdir "${patched_font_dir}" $config_patch_flags ${NERDFONTS}"
echo "fontforge -quiet -script ${PWD}/font-patcher "$f" -q --variable ${font_config} $powerline $post_process -c --no-progressbars --outputdir "${patched_font_dir}" $config_patch_flags ${NERDFONTS}"
fi
{ OUT=$(fontforge -quiet -script ${PWD}/font-patcher "$f" -q --variable $powerline $post_process -c --no-progressbars \
{ OUT=$(fontforge -quiet -script ${PWD}/font-patcher "$f" -q --variable ${font_config} $powerline $post_process -c --no-progressbars \
--outputdir "${patched_font_dir}" $config_patch_flags ${NERDFONTS} 2>&1 1>&3 3>&- ); } 3>&1
if [ $? -ne 0 ]; then printf "$OUT\nPatcher run aborted!\n\n"; fi

View file

@ -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.1.1"
script_version = "4.1.2"
version = "3.0.0"
projectName = "Nerd Fonts"
@ -741,7 +741,7 @@ class font_patcher:
def remove_ligatures(self):
# let's deal with ligatures (mostly for monospaced fonts)
# the tables have been removed from the repo with >this< commit
# Usually removes 'fi' ligs that end up being only one cell wide, and 'ldot'
if self.args.configfile and self.config.read(self.args.configfile):
if self.args.removeligatures:
logger.info("Removing ligatures from configfile `Subtables` section")

View file

@ -4,4 +4,6 @@ Lekton has been designed at ISIA Urbino, Italy, and is inspired by some of the t
https://fonts.google.com/specimen/Lekton
The `fi` and `fl` ligatures are removed because the map to only one advance width.
Version: 34

View file

@ -0,0 +1,4 @@
[Subtables]
ligatures: [
"'liga' Standard Ligatures in Latin lookup 6 subtable",
"'liga' Standard Ligatures in Latin lookup 5 subtable" ]

View file

@ -6,5 +6,7 @@ https://fonts.google.com/noto
The **Noto Mono** is an ancient font, nowadays the equivalent is Noto Sans Mono.
The `ldot` ligatures are removed because the map to only one advance width.
Version: 2.000 (20170915)
Version: 1.0 (2007) for Noto Mono

View file

@ -0,0 +1,7 @@
[Subtables]
ligatures: [
"Ligature Substitution lookup 18 subtable",
"Ligature Substitution lookup 17 subtable",
"Ligature Substitution lookup 16 subtable",
"Ligature Substitution lookup 15 subtable",
"Ligature Substitution lookup 14 subtable" ]

View file

@ -6,4 +6,6 @@ https://opendyslexic.org/
For more information have a look at the upstream website: https://github.com/antijingoist/opendyslexic
The `ldot` ligatures are removed because the map to only one advance width.
Version: 2.001

View file

@ -0,0 +1,6 @@
[Subtables]
ligatures: [
"Ligature Substitution lookup 8 subtable",
"Ligature Substitution lookup 7 subtable",
"'liga' Standard Ligature lookup 7 subtable",
"'liga' Standard Ligature lookup 4 subtable" ]

View file

@ -0,0 +1,3 @@
[Subtables]
ligatures: [
"Ligature Substitution lookup 23 subtable" ]

View file

@ -0,0 +1,4 @@
[Subtables]
ligatures: [
"Ligature Substitution lookup 20 subtable",
"'liga' Standard Ligatures in Latin lookup 18 subtable" ]

View file

@ -4,4 +4,6 @@
For more information have a look at the upstream website: https://github.com/RedHatOfficial/Overpass
The `fi`, `fl`, and `ldot` ligatures are removed because the map to only one advance width.
Version: 3.0.5

View file

@ -4,4 +4,6 @@ Space Mono is an original fixed-width type family designed by Colophon Foundry f
https://fonts.google.com/specimen/Space+Mono
The `fi` and `fl` ligatures are removed because the map to only one advance width.
Version: 1.001

View file

@ -0,0 +1,4 @@
[Subtables]
ligatures: [
"'liga' Standard Ligatures in Latin lookup 9 subtable",
"'liga' Standard Ligatures in Latin lookup 8 subtable" ]