Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

CodeBlocks and Fira Code issues

(1/7) > >>

sodev:
I am using the latest CodeBlocks revision 11703 together with wxWidgets f668f5b36f to play around with Fira Code and it doesn't work correctly, neither on Windows (Windows 10 1809) nor Linux (CentOS 7.6.1810 with MATE Desktop). The effects are slightly different though.

The good news: ligatures are working (when using Direct2D), the bad news: only the regular variant of Fira Code is working. All other variants (light, medium, bold, italic and its combinations) are not working in the editor. But they are working in the preview of the editor settings page (im not talking about the font selection dialog but the text left to the button to open it) and get applied to the line numbers.

In the editor however, something else happens, and for me this is different on Windows and Linux. If i select another variant on Linux it seems it is still using the regular variant, on Windows however for most variants it seems like a replacement font is used instead, only a few seem to use the regular variant.

For reference, on Linux in Eclipse all variants do work for me.

oBFusCATed:
Check if it works in scite or some other scintilla based editor. If it works there then it is a problem of C::B else it is in wx/scintilla/direct2d.

What wx version are you using?

sodev:
Did some tests with quite some surprising effects.

First some interesting aspect about how you select a font, each application (CodeBlocks, Notepad++, SciTE) does it different:

* In CodeBlocks you select the font face name and select weight and italics from a combined list of selections (e.g. light, bold italics)
* In Notepad++ you have multiple font entries with the font face name and the weight attached except bold (e.g. Fira Code, Fira Code Light) and a boolean for bold and italics
* In SciTE you select the font face name and have to specify italics as boolean and the weight as integer
In SciTE everything works as excepted on Windows and Linux, using the proper weight values selects the proper variant, applying italics works as well.

Now Notepad++, this is really strange, every combination works (yes, you can apply bold to everything) in plain text mode. If you turn on the c++ lexer (didn't try others) it breaks. The regular text is shown in the selected variant, BUT the bold and italics property gets only applied to the invisible characters (you need to turn them on). And ligatures don't work at all.


--- Quote from: oBFusCATed on May 22, 2019, 10:55:32 pm ---What wx version are you using?

--- End quote ---

--- Quote from: sodev on May 22, 2019, 09:13:39 pm ---wxWidgets f668f5b36f

--- End quote ---
That git revision, in 32 bit if that matters, with all compatibility options disabled.

sodev:
Ok, this happens if you are lazy and do the tests in a hurry, the strange things with enabled c++ lexer in Notepad++ stop to happen if you actually do not set the Default Style but the Global Override.

I took some more time and applied the workaround to enable SC_TECHNOLOGY_DIRECTWRITE in Notepad++ and discovered something interesting. In contrast to my previous test now certain fonts do also fail, but i get ligatures instead :). I get a replacement font for every selection except plain Fira Code and Fira Code Retina, so all font names with attached weight in the name do not work. This sounds quite similar to my CodeBlocks experience. So apparently only the SciTE way to select font weight and italics works in Direct2D mode correctly.

BlueHazzard:
I tested this today with latest codebocks on windows and wx3.1.2 and codeblocks crashes after typing
--- Code: ---...
--- End code ---

Have to recompile all with debug symbols to get a backtrace...

Navigation

[0] Message Index

[#] Next page

Go to full version