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

Bugfix Ubuntu ligatures #1597

Merged
merged 3 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 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.13.0"
script_version = "4.13.1"

version = "3.2.0"
projectName = "Nerd Fonts"
Expand Down Expand Up @@ -338,9 +338,9 @@ class font_patcher:
def patch(self, font):
self.sourceFont = font
self.setup_version()
self.get_essential_references()
self.assert_monospace()
self.remove_ligatures()
self.get_essential_references()
self.get_sourcefont_dimensions()
self.setup_patch_set()
self.improve_line_dimensions()
Expand Down Expand Up @@ -1135,14 +1135,14 @@ class font_patcher:
# glyphs intact.
# 0x0000-0x017f is the Latin Extended-A range
# 0xfb00-0xfb06 are 'fi' and other ligatures
basic_glyphs = set()
basic_glyphs = { c for c in range(0x21, 0x17f + 1) if c in self.sourceFont }
# Collect substitution destinations
for glyph in [*range(0x21, 0x17f + 1), *range(0xfb00, 0xfb06 + 1)]:
for glyph in list(basic_glyphs) + [*range(0xfb00, 0xfb06 + 1)]:
if not glyph in self.sourceFont:
continue
basic_glyphs.add(glyph)
for possub in self.sourceFont[glyph].getPosSub('*'):
if possub[1] == 'Substitution' or possub[1] == 'Ligature':
basic_glyphs.add(glyph)
basic_glyphs.add(self.sourceFont[possub[2]].unicode)
basic_glyphs.discard(-1) # the .notdef glyph
for glyph in basic_glyphs:
Expand Down
2 changes: 2 additions & 0 deletions src/unpatched-fonts/Ubuntu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ you are expressly encouraged to experiment, modify, share and improve.

http://font.ubuntu.com/

The `fi`, `fl`, and similar ligatures are removed because they would block some Font Awesome glyphs.

Version: 0.83

## Preprocessed Source Font
Expand Down
5 changes: 5 additions & 0 deletions src/unpatched-fonts/Ubuntu/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Subtables]
ligatures: [
"'liga' Standard Ligatures in Latin lookup 20 subtable",
"'liga' Standard Ligatures in Greek lookup 21 subtable",
"'liga' Standard Ligatures in Cyrillic lookup 22 subtable" ]