After a couple of years I have to use a Windows machine again and noticed that geany does not support programming ligatures, which are supported by fonts like Fira Code or Cascadia Code.
Ligatures **do work** on Linux, though: ![image](https://user-images.githubusercontent.com/6584443/85752567-cf613900-b70b-11e...)
I first checked the Scintilla version, but it is new enough to support this, also in the Geany Windows-Version.
After a bit of research, I came across the same issue reported for Notepad++: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/2287#issuecomm...
The linked comment cites the [Scintilla docs](https://www.scintilla.org/ScintillaDoc.html#SCI_SETTECHNOLOGY), stating that `SCI_SETTECHNOLOGY(int technology)` can be set to `SC_TECHNOLOGY_DIRECTWRITE` for Windows Vista or later.
I strongly assume that this would also resolve the issue for Geany.
Is there any dev regularly running a Windows build? I would of course like to test this, but I'd have to set up a cross-compiling environment or something. So I would be very happy if someone here would be in a comfortable position to test this.
The difference with Geany is that it uses the GTK+ Scintilla backend even on Windows, rather than the "native" Win32 Scintilla backend like Notepad++ does, so I don't think it would be possible to use DirectWrite.
Without testing, I'd wager the difference between Linux and Windows is that on Linux you're using a GTK+3 build whereas the official Windows installer uses GTK+2. If you wanted to test that theory you could try building on Linux and passing `--disable-gtk3` when running the `configure` script to force a GTK+2 build.
Oh, right! And you think DirectWrite would not be available in GTK? (I am absolutely not familiar with GTK for Windows.)
Good hint, I compiled Geany with GTK+ v2 on Linux and ligatures work: ![image](https://user-images.githubusercontent.com/6584443/85866030-13fdda80-b7c7-11e...)
So it's not a GTK+ v2 vs. v3 problem per se.
Maybe it's one of the dependencies of GTK+ used for font handling/rendering that differs between the Windows release and your Linux, such as FreeType or Pango. If I remember correctly in Windows you can right click on a .dll and click Properties to see version information in one of the tabs. Maybe you could compare that to the versions of FT/Pango libraries on your Linux. If that's the case, the workaround may be as simple as updating the relevant .dll on the Windows machine by dropping in a new one.
Sorry for the late reply:
Both, FreeType and Pango versions, were not too outdated. I tried the latest FreeType dll with the same result. For pango, the download links ![here](https://pango.gnome.org/Download) do no longer work, so I could not test it =/
Just tested it on Windows (with GTK2 Geany): `SCI_SETTECHNOLOGY(SC_TECHNOLOGY_DIRECTWRITE) nor any of the other `SC_TECHNOLOGY_*` options has any effect. I agree with @codebrainz that it's probably the GTK backend of Scintilla which does not support that option, even on Windows.
You could request it at the Scintilla project.
You could request it at the Scintilla project.
@eht16 How would those options work with Scintilla GTK backend which calls GTK rather than calling the windows API directly?
I don't suppose there is any chance you can test with GTK3 Geany on Windows? It has to happen one day :).
You could request it at the Scintilla project.
@eht16 How would those options work with Scintilla GTK backend which calls GTK rather than calling the windows API directly?
Maybe Neil finds a way to implement the necessary bits in a different way for the GTK backend on Windows. Since I have no clue about what's necessary for this, I'm just optimistic that there is a possibility :).
I don't suppose there is any chance you can test with GTK3 Geany on Windows?
I won't test it with GTK3 on Windows as I'm convinced it won't make a difference and so I save me the efforts.
It has to happen one day :).
Ha, I missed that little voice in my head reminding me about this...:D. Actually, a few days ago I started playing with a Docker image to cross-compile Geany using MSYS2. Ideally we can get the full game into the container: git clone, compiling, bundling, creating the installer. The first half is already done. And while doing this, I'll switch to GTK3 finally (and x86_64 only).
I'm just optimistic that there is a possibility :).
Ok well, it always good to be optimistic, but ...
IIRC Scintilla on GTK uses Cairo/Pango, no "Windows technology".
My reading of GTK/GDK docs says only top level windows are native objects with Windows handles, anything else is just a memory buffer inside GTK thats written to by Pango/Cairo not by Windows. And since Scintilla is a widget within the UI, not the top level, it seems likely, to my inexpert evaluation, that its not going to be able to select Windows technologies for itself since its just a buffer without a Windows handle, and anyway it uses Pango/Cairo, not windows calls.
However its always good to be optimistic :)
And since Scintilla GTK uses Pango/Cairo its [GTK turtles all the way down](https://en.wikipedia.org/wiki/Turtles_all_the_way_down), and it works on GTK3 Linux, thats why I suspected it might work for GTK3 on Windows.
Anyhow we shall find out when your Docker image works, thanks for doing it, happy to remind you :)
I don't suppose there is any chance you can test with GTK3 Geany on Windows?
It does work with GTK+3 on Windows:
<img width="637" alt="geany_ligatures_gtk3_win32" src="https://user-images.githubusercontent.com/181177/91111750-2d3fcd80-e636-11ea-9ce4-f88807b2dab8.png">
Neat, thanks @codebrainz
It also works with self-built GTK+2 version:
<img width="635" alt="geany_ligatures_gtk2_win32" src="https://user-images.githubusercontent.com/181177/91119936-53bb3400-e649-11ea-8d3d-74d6b4945785.png">
So it appears it was fixed somewhere between GLib v2.60.6 and GLib v2.64.5 given that it doesn't work on the release version from Geany.org and does work with self-built as of today with msys2.
I guess it's probably more the Harfbuzz/Pango versions, but I can't be bothered to track those down.
It also works with self-built GTK+2 version:
Wow. So I was wrong with basically everything I said here. But in this case, it's fine :).
Don't know how to find the versions of Pango/Harfbuzz bundled with the official release installer.
They are listed in `ReadMe.Dependencies.Geany.txt` in the Geany installation directory: mingw-w64-i686-pango-1.43.0-3-any.pkg.tar.xz mingw-w64-i686-harfbuzz-2.6.5-1-any.pkg.tar.xz
@jolange here we go: https://download.geany.org/snapshots/geany-1.37git55e0998c3_setup.exe
This is the current GIT master with updated dependant libraries bundled (whole GTK, including the mentioned Pango and harfbuzz libraries). The ligatures seem to work properly. Note: if you have also installed the geany-plugins package, you can use the 1.36 release installer of geany-plugins. It will show warnings about version incompatibilities but it does work. Still, use at your risk :).
@eht16 I think new libraries need to be added; `libbrotlicommon.dll` and `libbrotlidec.dll` (some kind of compression format).
Your snapshot works for me if I copy those DLLs into Geany's installation path.
Oops, sorry. I uploaded http://download.geany.org/snapshots/geany-1.37git55e0998c3-2_setup.exe (and edited my post above) with brotli included. Since I tested yesterday with plugins installed, I didn't notice as the plugins already have brotli as dependency.
Works fine now out of the box.
Great, I can confirm that it works!
Thanks to all of you, who took the time to look into this :-)
1.37 is out now, which has all the bits.
Closed #2535.
github-comments@lists.geany.org