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 in regex #290

Open
cskujbus opened this issue Mar 30, 2024 · 5 comments
Open

Ligatures in regex #290

cskujbus opened this issue Mar 30, 2024 · 5 comments

Comments

@cskujbus
Copy link

Regular expressions look a bit awkward with ligatures. Somehow the Iosevka font handles them correctly like on the picture (left: PP8.30, right: Iosevka29.04). Is it possible to do something in case of regular expressions?

Screenshot_20240330_093703

@fabrizioschiavi
Copy link
Owner

Probably you need to use the PragmataPro versions without Liga to fix this. Please let me know if your request is more complex.

@svipas
Copy link

svipas commented Jul 1, 2024

@fabrizioschiavi I checked other fonts like Iosevka and they detect and disable ligatures in certain patterns. I believe they do that for cases like this so you could read regex properly. Current workaround would be to disable ligatures if you need to read regex which contains ligatures, but I would love to see something like with Iosevka, Fira Code, etc. in the future.

You can install these fonts and try yourself you will see what they do, also, they are open source maybe you can take parts they are using to disable ligatures in such scenarios.

Also, depends on how complex is this to achieve, maybe it isn't worth it from your side.

@fabrizioschiavi
Copy link
Owner

@svipas thanks for this precious suggestion!
Could you or someone else let me know a list of regex patterns to disable, please?
Are you sure Iosevka and Fira Code included all this patterns?

@svipas
Copy link

svipas commented Jul 1, 2024

I found out commit in Iosevka: be5invis/Iosevka@a52d8e7

If you go into otl/gsub-ligation.ptl you will see Disable regular expression lookaheads


In Fira Code I also found:

  • Disabled ligatures after regexp lookahead/lookbehinds (?<=< (?<=> (?<==> (?<=| (?<== (?=:= (?=!= (?== (?=== (?==> (?=> (?=>> (?=<< (?=/= (?!! (?!!. (?!= (?!== (?<!! (?<!!. (?<!= (?<!== (?<!--

This commit: tonsky/FiraCode@2ca064a

@fabrizioschiavi
Copy link
Owner

@svipas you are always a great supporter of this project!
Thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To Do
Development

No branches or pull requests

3 participants