Forum > Editor

I can't change the code editor font in Linux... Anyone?...

<< < (4/5) > >>

Martin_fr:

--- Quote from: winni on April 27, 2021, 04:41:37 pm ---AFAIK synedit only acceps monospaced fonts.

--- End quote ---
Well yes... and a yet, not.

See the unit SynTextDrawer. And {$IFDEF SYNFONTDEBUG} sections.

SynEdit measures the font that it is given. It measure certain individual chars MWXi':m@ and some sequences.
If they do not return monospaced sizes (can also happen for sub-pixel sizes), the SynEdit will place each char into a forced pos. That is what happens to the OT.

So in that sense, SynEdit will "work" with none monospaced fonts, but the result is usually real bad.

-------
In the QT example, SynEdit got good measurements, but the real output is actually wider. No idea why.

winni:

--- Quote from: Martin_fr on April 27, 2021, 05:28:13 pm ---

So in that sense, SynEdit will "work" with none monospaced fonts, but the result is usually real bad.

-------
In the QT example, SynEdit got good measurements, but the real output is actually wider. No idea why.

--- End quote ---


Hi!

Looking at proportional fonts with a monospaced distance is unreadable, makes headache and should be prohibited by the IDE

The wider output might come from the option "extra character spacing".

Winni

Martin_fr:

--- Quote from: winni on April 27, 2021, 06:26:44 pm ---Looking at proportional fonts with a monospaced distance is unreadable, makes headache and should be prohibited by the IDE

--- End quote ---


--- Quote ---The bug is, that the IDE allows also proportional fonts.
--- End quote ---

Both valid points. Except the latter should be "A bug is".
It is not (or not necessarily) the bug causing the issues described here.

My understanding is that the original bug is, that the selected font is not used. And that includes, if the selected font is monospaced. So there is a bug that even affects monospaced fonts.

As for the 2nd issue, that may be caused by a none monospaced font.
But SynEdit should have measured it. So the measuring must be broken in QT.

C#R#:
Hi Martin,

I think isn't a font problem, look this images, one is gtk2 and other is qt5(with fail).

Thanks !

Martin_fr:

--- Quote from: C#R# on February 18, 1975, 12:33:29 pm ---I think isn't a font problem, look this images, one is gtk2 and other is qt5(with fail).

--- End quote ---
Well, what I can see is that while you chosen the same font (font of the same name) under gtk2 and qt, the font that is used is different.
Look at line 16 of the preview, the lowercase "i" in "inc" is very different.

What I can also see is that on QT the "n" in the same "inc" is partly below the "X" in the line above. But that "X" should line up with the "i".
So it is not a monospaced font.

But SynEdit should have noted that using GetTextExtentPoint. And then using LCLIntf.ExtUTF8Out to specify the draw-width of each char.
So I can think of several scenarios.
Either GetTextExtentPoint or LCLIntf.ExtUTF8Out do not work.
Or the code gets a different font for measuring than it gets for actual drawing.

LCLIntf.ExtUTF8Out  can be tested by setting "Extra char spacing" to 1 (or any value other than 0)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version