Recent

Author Topic: I can't change the code editor font in Linux... Anyone?...  (Read 7610 times)

Hoch

  • New Member
  • *
  • Posts: 35
I can't change the code editor font in Linux... Anyone?...
« on: January 26, 2020, 12:54:52 pm »
Hi,

When I change the code editor font, the font picker displays the font correctly but Lazarus uses always the same one, no matter which font I choose. The only thing that changes is the size and spacing.

Check the appended screenshots. You can see that the font I choose is not displayed correctly in the preview of the prefs dialog and in the code editor.

And the font spacing is weird. It's very uncomfortable to work with this font spacing.

Things I've done:

. Tried all the monospace fonts
. Uninstalled Lazarus and installed again, renaming the /home/user_name/.lazarus folder to force a clean one.
. Downgraded linux kernel from 5.4 to 5.3
. Checked font permissions in /usr/share/fonts/
. Upgraded Lazarus 2.0.6 to the last one offered by pacman (25/12/2019)

Nothing works.

The font picker detects the fonts right. And other apps see and use the fonts correctly.

Clearly there is an issue with Lazarus.

System was Manjaro with 5.4 kernel, downgraded to 5.3.
Lazarus version is 2.0.6. (25/12/2019)

Any clues of where to look to fix this?...

Thank you in advance! :)
« Last Edit: January 27, 2020, 07:44:03 pm by Hoch »

nomorelogic

  • Full Member
  • ***
  • Posts: 165
Re: I can't change the code editor font in Linux... Anyone?...
« Reply #1 on: April 09, 2021, 11:44:41 am »
this topik is old but I've same problem

fonts are weird and there's no way to view a font like in other application
I'm on voidlinux, xfce4

any help is appreciated

thanks


Edit:
tried all monospaced fonts but none of them looks normal
« Last Edit: April 09, 2021, 11:46:47 am by nomorelogic »

nomorelogic

  • Full Member
  • ***
  • Posts: 165
Re: I can't change the code editor font in Linux... Anyone?...
« Reply #2 on: April 12, 2021, 08:54:14 am »
just to show what "weird" means, I attach a screenshot

This malfunction appeared recently, not with a fresh Lazarus install.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: I can't change the code editor font in Linux... Anyone?...
« Reply #3 on: April 12, 2021, 11:48:23 am »
Seems to be a problem with the font itself.  Maybe the font file isn't fully compatible or it is old or something.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

nomorelogic

  • Full Member
  • ***
  • Posts: 165
Re: I can't change the code editor font in Linux... Anyone?...
« Reply #4 on: April 12, 2021, 12:02:54 pm »
when installed Lazarus 1st time, display editor was really perfect
after some days, changing font in display option, this probelm appear


nomorelogic

  • Full Member
  • ***
  • Posts: 165
Re: I can't change the code editor font in Linux... Anyone?...
« Reply #5 on: April 12, 2021, 12:52:31 pm »
I tried removing Lazarus and reinstalling it: nothing changhes :(

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: I can't change the code editor font in Linux... Anyone?...
« Reply #6 on: April 12, 2021, 04:45:09 pm »
Does it happens only with this font or with any monospaced font you select?

I'd tend to agree with Ñuño that it looks like a problem with the font itself: either it's not correctly formed or it isn't marked as "monospace".

SynEdit wants a monospaced font and when you apply a non-monospaced one the result resembles your image: the space after the shorter characters (i, l, ...) is excesive while the wider ones (m, w, ...) might even be cut-out, all as your image seems to indicate.
« Last Edit: April 12, 2021, 04:47:18 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: I can't change the code editor font in Linux... Anyone?...
« Reply #7 on: April 12, 2021, 05:16:48 pm »
The "weird look" is a 2ndary issue.
Forget the spacing for a moment.

You say the font does not change, no matter what you select.
That means, if you change between fonts, that draw a line in the "0" (zero), or do just an oval (like the letter O) for a zero, you would always get the same "0".

Same you do a serif vs a none serif. The form, thickness, details of each char on it own do never change?

Now, if that is true, then there is an issue with font selection.

And apparently you end up with a none monospaced font. And that gets the spacing weirdness.



None monospaced fonts

The Editor displays all text according to mono spaced rules. That is like in a grid. An "i" and a "W" must have the same widths. If not the editor adjusts the widths, by padding or squeezing. => Weird look.

nomorelogic

  • Full Member
  • ***
  • Posts: 165
Re: I can't change the code editor font in Linux... Anyone?...
« Reply #8 on: April 12, 2021, 07:31:04 pm »
just to be more precise I can attach 3 monospace fonts

I included a line of "O" letter and 0 (zero)


winni

  • Hero Member
  • *****
  • Posts: 3197
Re: I can't change the code editor font in Linux... Anyone?...
« Reply #9 on: April 12, 2021, 08:16:38 pm »
Hi!

Looking at the 3 Font examples:

* Theses Fonts are not monospaced fonts
* In all 3 screenshots it is always the same font


To check this confusion let's take first step:

look in your lazarus directory in the editoroptions.xml

In the 4th line there should be something  like

Code: Text  [Select][+][-]
  1. <Display DoNotWarnForFont="Liberation Mono" EditorFont="Liberation Mono" EditorFontSize="12" ExtraCharSpacing="1"/>

Do you find a correct fontname in this line?

Winni

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: I can't change the code editor font in Linux... Anyone?...
« Reply #10 on: April 12, 2021, 08:47:11 pm »
Just noted, the OP Hoch, has not posted/replied further to the topic. Maybe they solved it.

nomorelogic

  • Full Member
  • ***
  • Posts: 165
Re: I can't change the code editor font in Linux... Anyone?...
« Reply #11 on: April 13, 2021, 08:37:22 am »
this is the 4th line of $HOME/.lazarus/editoroptions.xml

Code: Pascal  [Select][+][-]
  1. <Display DoNotWarnForFont="DejaVu Sans Mono"/>
  2.  


Using fpcupdeluxe I installed on the same system another lazarus (laz stable / fpc stable).
Using the new install, fonts are perfect (see attachment).
In this case the 4th line of .../lazstable/config_lazarus/editoroptions.xml is the same of previous "weird" installation:

Code: Pascal  [Select][+][-]
  1. <Display DoNotWarnForFont="DejaVu Sans Mono"/>
  2.  

Thus I have 2 lazarus (same version) on my system, so it's not a font issue.


Edit:
@winni
it seems that it doesn’t matter the font I select, at the end the editor is used almost always the same
in editoroptions.xml is reported the one I selected
« Last Edit: April 13, 2021, 08:44:51 am by nomorelogic »

C#R#

  • New Member
  • *
  • Posts: 45
Re: I can't change the code editor font in Linux... Anyone?...
« Reply #12 on: April 26, 2021, 05:12:51 pm »
Hi,

I have the same problem, the characters overlaps the own space.
But, I have the problem only on qt5 interface
When the ide is compiled on gtk2, the problem disappear

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: I can't change the code editor font in Linux... Anyone?...
« Reply #13 on: April 27, 2021, 02:51:51 pm »
I have the same problem, the characters overlaps the own space.
But, I have the problem only on qt5 interface
When the ide is compiled on gtk2, the problem disappear

Same origin, but different effect.

If you look closely for the OT every char is squashed to the next.

In your image chars are cut off at certain intervals (whenever the highlight color changes).
If you select chars in a line, and extend the selection char by char, you will see the other chars moving.

The problem is still the font. It does not stick to the width it should. Though in your case SynEdit believes that it is monospaced.

Therefore SynEdit outputs the text without correcting the width. It prints the text in the current highlight. When the hl changes SynEdit calculates where the previous text should have ended, and continues there. But in your case the previous text did not end at the correct location.


I have no idea why the fort info on gtk/qt on your platforms goes wrong.

I suggest to report this as bug. (against the LCL widgetset for qt/gtk)




winni

  • Hero Member
  • *****
  • Posts: 3197
Re: I can't change the code editor font in Linux... Anyone?...
« Reply #14 on: April 27, 2021, 04:41:37 pm »
Hi!

AFAIK synedit only acceps monospaced fonts.

The bug is, that the IDE allows also proportional fonts.

Winni


PS.: Wikipedia has a (small) list of monospaced  fonts.
Liberation mono and many others missing

https://en.wikipedia.org/wiki/List_of_monospaced_typefaces
« Last Edit: April 27, 2021, 04:44:30 pm by winni »

 

TinyPortal © 2005-2018