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

Ligatures not working in some situations after patching Iosevka #1000

Closed
3 tasks done
Bahnschrift opened this issue Nov 20, 2022 · 15 comments
Closed
3 tasks done

Ligatures not working in some situations after patching Iosevka #1000

Bahnschrift opened this issue Nov 20, 2022 · 15 comments

Comments

@Bahnschrift
Copy link

Bahnschrift commented Nov 20, 2022

🗹 Requirements

  • I have searched the issues for my issue and found nothing related and/or helpful
  • I have searched the FAQ for help
  • I have searched the Wiki for help

🎯 Subject of the issue

Experienced behavior:
Font ligatures are not working in some environments on a patched custom build of Iosevka. They seem to show up fine in Windows Terminal, but don't work at all in IntelliJ or VSCode, even with the appropriate settings to enable font ligatures. Ligatures work fine with the unpatched font.

🔧 Your Setup

I'm using the following Iosevka build plan:

[buildPlans.iosevka-custom]
family = "Iosevka Custom"
spacing = "normal"
serifs = "slab"
no-cv-ss = false
export-glyph-names = false

[buildPlans.iosevka-custom.ligations]
enables = [
    "centre-ops",
    "arrow",
    "arrow2",
    "trig",
    "eqeq",
    "exeq",
    "ineq",
    "eqeqeq",
    "exeqeq",
    "exeqeqeq",
    "eqexeq",
    "ltgt-diamond",
    "ltgt-slash-tag",
    "brst",
    "plusplus",
    "kern-dotty",
    "kern-bars",
    "logic",
    "llgg",
    "llggeq",
    # "dot-as-operator",
    "bar-triggers-op-centering",
    "html-comment",
    "brace-bar",
    "brack-bar",
    "connected-underscore",
    "connected-number-sign",
    "connected-tilde-as-wave",
    "connected-hyphen-as-semi-dashed-line"
]

[buildPlans.iosevka-custom.variants]
inherits = "ss20"

[buildPlans.iosevka-custom.variants.design]
zero = "dotted"
asterisk = "penta-low"
caret = "high"
paren = "flat-arc"
ampersand = "lower-open"
at = "fourfold-solid-inner"
lig-ltgteq = "slanted"
question = "corner"

[collectPlans.iosevka-custom]
from = ["iosevka-custom"]

I've also uploaded the .ttc here. I'm patching the font on WSL with ./font-patcher iosevka-custom-sans.ttc --complete --mono.

★ Screenshots

When opening the patched font in fontforge, I get this message:
image
I'm not sure whether it is related or not, but I'll include it here just in case.

@Bahnschrift
Copy link
Author

I'm unable to reproduce this anymore with the latest version of the font patcher. I'm not sure if it was previously caused by a problem with my setup or the patcher itself.

@Finii Finii mentioned this issue Dec 4, 2022
2 tasks
@realth000
Copy link

realth000 commented Dec 4, 2022

On August it worked well with the following versions:
nerd-font commit id: de9bb5b
Nerd Fonts: 2.2.1
font-patcher script version: 3.0.2
iosevka: 16.0.1

But ligations disappeared when I upgrade iosevka to 16.6.0, after also upgrade Nerd Fonts to v2.3.0-RC (3.2.1) on master branch.
nerd-font commit id: 498ebf3

I patch ttf fonts using

for f in `find iosevka0828 -type f`; do ./nerd-fonts/font-patcher $f --complete --quiet --windows --mono --outputdir ./iosevka0828nf 2>/dev/null 1>&2; done

and add flag --makegroups according to #1019.

for f in `find iosevka0828 -type f`; do ./nerd-fonts/font-patcher $f --complete --quiet --windows --mono --makegroups --outputdir ./iosevka0828nf 2>/dev/null 1>&2; done

I didn't remember how I patched Iosevka on August, I will try again with 16.0.1 version later.


Compile failed with Iosevka 16.0.1 so I tried 16.3.6 and ligations worked well!

@Finii
Copy link
Collaborator

Finii commented Dec 4, 2022

@realth000

Maybe you should raise a new Issue, or are the details the same?

If this is the same as Bahnschrift's:

(Usual questions, answer all that are relevant)

  • Which font are you using (e.g. Anonymice Powerline Nerd Font Complete.ttf)?
    • Please give the full filename
    • Where did you get the file from (download link, self patched, source downloaded from link...)
  • Which terminal emulator are you using (e.g. iterm2, urxvt, gnome, konsole)?
  • Are you using OS X, Linux or Windows? And which specific version or distribution?

When self-patching (except when using docker) which version of fontforge?

Please add description of concrete problem, best with screenshot.

Any links to your font files?

@Bahnschrift
Copy link
Author

When this worked for me 2 days ago, I was using Iosevka 16.5.0 and font patcher 2.3.0 (3.2.1? not sure how the versions work), which were both the latest releases at the time.

@Finii
Copy link
Collaborator

Finii commented Dec 5, 2022

@Bahnschrift thank you.

The first number is the "Nerd Font Release" number (at the moment 2.3.0-release_candidate), while the second number is independent from that the version of the patcher itself (because it is updated far more often then there are releases).

My questions above were for @realth000

16.5.0 is a good hint. Some ligatures can be destroyed in the patching process, when we want to place a new icon where a ligature glyph was before. This can be prevented by giving --careful. The message while patching is then Found essential glyph at ... (while it is existing glyph for ordinary glyphs).

@realth000
Copy link

Yes, I checked again, the same.
Only have ligatures in Windows Terminal, not in IntelliJ Idea, VS Code and Wezterm.
image

Font name 'Iosevka1204 Extended Nerd Font Complete Windows Compatible Bold Italic.ttf'
'Iosevka1204 Extended Nerd Font Complete Windows Compatible Bold.ttf'
'Iosevka1204 Extended Nerd Font Complete Windows Compatible ExtraBold Italic.ttf'
'Iosevka1204 Extended Nerd Font Complete Windows Compatible ExtraBold.ttf'
'Iosevka1204 Extended Nerd Font Complete Windows Compatible ExtraLight Italic.ttf'
'Iosevka1204 Extended Nerd Font Complete Windows Compatible ExtraLight.ttf'
'Iosevka1204 Extended Nerd Font Complete Windows Compatible Heavy Italic.ttf'
'Iosevka1204 Extended Nerd Font Complete Windows Compatible Heavy.ttf'
'Iosevka1204 Extended Nerd Font Complete Windows Compatible Italic.ttf'
'Iosevka1204 Extended Nerd Font Complete Windows Compatible Light Italic.ttf'
'Iosevka1204 Extended Nerd Font Complete Windows Compatible Light.ttf'
'Iosevka1204 Extended Nerd Font Complete Windows Compatible Medium Italic.ttf'
'Iosevka1204 Extended Nerd Font Complete Windows Compatible Medium.ttf'
'Iosevka1204 Extended Nerd Font Complete Windows Compatible SemiBold Italic.ttf'
'Iosevka1204 Extended Nerd Font Complete Windows Compatible SemiBold.ttf'
'Iosevka1204 Extended Nerd Font Complete Windows Compatible Thin Italic.ttf'
'Iosevka1204 Extended Nerd Font Complete Windows Compatible Thin.ttf'
'Iosevka1204 Extended Nerd Font Complete Windows Compatible.ttf'

Download not patched Iosevka fonts
Download patched fonts


I patched fonts with:

  • OS: Kubuntu2204
  • Iosevka: 16.6.0
  • Nerd Fonts: 498ebf3
  • Font patcher: v2.3.0-RC (3.2.1)
  • fontforge version: 1:20201107~dfsg-4build1

Patch command (already use --careful):

for f in `find iosevka1204-1205 -type f`; do ./nerd-fonts/font-patcher $f --complete --quiet --windows --makegroups --careful --outputdir ./iosevka1204-1205NF-2 1>log 2>&1; done

Patch command log:
iosevka_patch_command_log.txt


I use patched fonts in:

  • Windows 10 21H2 19044.2251
  • Windows Terminal: 1.15.2874.0 (have ligatures)
  • IntelliJ Idea: 2022.3
  • VS Code: 1.73.1
  • Wezterm: 20220905-102802-7d4b8249

@Finii
Copy link
Collaborator

Finii commented Dec 5, 2022

* fontforge version: 1:20201107~dfsg-4build1

There was a bug in fontforge that prevents correct ligature tables (sometimes; for example with Iosevka).
The PR has been pulled and is in effect with Fontforge March 2022 Release, so maybe try again with a more up to date fontforge?

Edit: Correct release name (swap month and year)

@Finii
Copy link
Collaborator

Finii commented Dec 6, 2022

@realth000 Thanks for the detailed report with all the files.

I downloaded one set as example...
and patched it with your settings, but with more recent fontforge

image

[...]

image

....

Lots of errors in the version you patched when opening in fontforge:

image

but none after patching with fontforge March 2022 Release:

image

Unfortunately we can not detect the errors from script side. That is purely a bug in fontforge while exporting the font file. Or has been.


Edit: Add this image where the command lines can be seen:

image

@Finii
Copy link
Collaborator

Finii commented Dec 6, 2022

That (the internal fontforge error message window) is the same error as @Bahnschrift described in the original Issue description. So maybe that is also a hint for Bahnschrift to use a more recent fontforge.

@Bahnschrift
Copy link
Author

Bahnschrift commented Dec 6, 2022

That (the internal fontforge error message window) is the same error as @Bahnschrift described in the original Issue description. So maybe that is also a hint for Bahnschrift to use a more recent fontforge.

Back when it wasn't working for me, I tried with both the March 2022 release of fontforge (at least, I'm fairly sure I did) and with fontforge built straight from the main branch of the source.

As far as I can tell, it was either updating my copy of iosevka or the patcher script that fixed it for me.

@Finii
Copy link
Collaborator

Finii commented Dec 6, 2022

Just for the protocol:

the March release of fontforge

It can be missleading to call it such, because they have

  • Fontforge 2020 March Release
  • Fontforge March 2022 Release

(Yes, with the order differnt 😬)

This looks like any pre March 2022 Release export. You can in principle not tell fontforge to generate a font with these broken tables, the only way to get them is with a broken fontforge.

image

@Bahnschrift
Copy link
Author

I should probably add that when I did get it to work, I was using fontforge built from this commit.

@realth000
Copy link

I built latest fontforge and it works well with latest Iosevka. Thanks!!! @Finii @Bahnschrift

@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 Jun 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants