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

Support font ligatures #361

Closed
RaiKoHoff opened this issue Feb 15, 2018 · 8 comments
Closed

Support font ligatures #361

RaiKoHoff opened this issue Feb 15, 2018 · 8 comments

Comments

@RaiKoHoff
Copy link
Collaborator

Copied from XhmikosR/notepad2-mod#211
@andresclari 👍

Would be nice to support font ligatures when using say the Fira Code font

@RaiKoHoff
Copy link
Collaborator Author

RaiKoHoff commented Feb 15, 2018

Notepad3 supports font ligatures by enabling Scintilla's SC_TECHNOLOGY_DIRECTWRITE
( .ini-Settings: section [Settings2] : SciDirectWriteTech=1 and SciFontQuality=3 )
See Notepad++ workaround at: notepad-plus-plus/notepad-plus-plus#2287 (comment)

See also Notepad3 discussion about blurred font display at #191.

image

image

@ArturSprinter
Copy link

ArturSprinter commented Feb 17, 2020

I was try to enable font ligatures in my Notepad3 (64-bit, v5.19.815.2595, currently newest version) and editor continuously removes SciDirectWriteTech=1 setting from Notepad3.ini file 😕

Would you plan to check this bug or add an option to enable ligatures from UI (probably better option)? 😁

EDIT: I'm using Microsoft Cascadia Code font.

@RaiKoHoff
Copy link
Collaborator Author

RaiKoHoff commented Feb 17, 2020

@ArturSprinter : Yes there has been a bug regarding reset settings.

Feel free to test the RC1 version "Notepad3Portable_5.20.216.2_RC1.paf.exe.7z" or higher.
See "Notepad3 BETA-channel access issue #1129" or here Notepad3Portable_5.20.216.2_RC1.paf.exe.7z.
or
Notepad3Portable_5.20.217.1_BETA.paf.exe.7z.

Note: "Notepad3Portable RC1" can be used in "2 flavors" (with or without the extension ".7z").

@lucknaumann
Copy link

@RaiKoHoff commented on Feb 17, 2020, 4:22 AM MST:

@ArturSprinter : Yes there has been a bug regarding reset settings.

Feel free to test the RC1 version "Notepad3Portable_5.20.216.2_RC1.paf.exe.7z" or higher.
See "Notepad3 BETA-channel access issue #1129" or here Notepad3Portable_5.20.216.2_RC1.paf.exe.7z.
or
Notepad3Portable_5.20.217.1_BETA.paf.exe.7z.

Note: "Notepad3Portable RC1" can be used in "2 flavors" (with or without the extension ".7z").

Thanks for the info. I tried both the BETA and RC1 and they still don't save the settings. Only the one that's available in the settings SciFontQuality=3 remains active (and present) but not the one that needs to be added SciDirectWriteTech=1. Ligatures will work upon first adding the SciDirectWriteTech=1 setting and restarting (even though it no longer appears in the settings) but after exiting Notepad3 and relaunching the setting is no longer active and needs to be readded.

@RaiKoHoff
Copy link
Collaborator Author

@ArturSprinter , @lucknaumann,
sorry for the confusion, SciDirectWriteTech= is a deprecated parameter, which has been replaced by a new parameter called [Settings] RenderingTechnology=.
(If an old parameter SciDirectWriteTech= is found, it is used as a default value for [Settings] RenderingTechnology= if this new parameter is not defined in the .ini-file.
The old parameter is deleted (if Save Settings on Exit is enabled) in the .ini-file.
The setting [Settings] RenderingTechnology= can be overridden by an screen geometry dependent (manual edit) parameter (e.g. [Window] 1920x1080 RenderingTechnology=1).

The "bug" now is: meanwhile .ini-file handling changed to : "remove settings from .ini if they equal the default". Unfortunately the old setting SciDirectWriteTech= overrides the default (even it is not the real default (0)) and it is removed from .ini. When it comes to saving the .ini-file, the RenderingTechnology is compared to its (wrong) default (cause it is taken from old SciDirectWriteTech) and is removed from .ini-file too 👎. Now, on next restart neither SciDirectWriteTech nor RenderingTechnology is found in the .ini-file, so the default (0 - GDI) is used 👎.

As a workaround, don't set deprecated SciDirectWriteTech parameter, use [Settings] RenderingTechnology= (e.g. by Menu -> Settings -> Technology -> Rendering -> DirectWrite (Direct2D)).

@RaiKoHoff RaiKoHoff reopened this Feb 18, 2020
@ArturSprinter
Copy link

ArturSprinter commented Feb 18, 2020

Maybe it's good to mention this GDI unsupported functionality Notepad3 in UI, like so?:
image

This will solve a plenty of problems, which user may experience trying to enable ligatures (user probably will see this during searching through Notepad's settings)

@RaiKoHoff
Copy link
Collaborator Author

@ArturSprinter : Thank you, this is a good idea. This will have impact on language support, I will leave that to our language expert (@hpwamr).
The first idea of enabling DirectWrite by default has been reverted, cause a lot of people complain about "other (worse)" rendering impression ...

One remark: If DirectWrite is enabled, you will get another font selection dialog, where you can select fractional font sizes to get the "sweet spot" for visual impression. (Not every fractional change will change the impression, but +/- 0.5 points will do - needs some experiments ..).

@lucknaumann
Copy link

@RaiKoHoff @ArturSprinter Thanks so much! I figured there was something I was missing... =)

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

No branches or pull requests

4 participants