Recent

Author Topic: Keys Not rendering properly in Editor  (Read 5049 times)

abtaylr

  • Full Member
  • ***
  • Posts: 107
Keys Not rendering properly in Editor
« on: October 10, 2021, 03:52:11 pm »
Since 2016 I have had a problem with certain keys not rendering properly on the editor. By way of background I am using Kubuntu 21.04, FPC 3.3.1 and Lazarus 2.2.0RC2. In 2015 the Unicode Consortium added the Uppercase German Sharp S character ẞ (which result you may see rendered properly herein). On the editor in Lazarus it has never rendered properly. I have attached a code snippet screenshot showing the rendering. Linux uses its own standard keyboard layouts instead of the DIN T2 German layout. If I opened Libre Office Writer, select German keyboard, I can use the Linux keyboard to get to the letter with ALT-GR + Shift + S to achieve the upper case Sharp S. (On a DIN T2 you would normally use ALT + '+' + H to achieve this, although I have never used this since I use Linux.) Changing the locale and coding with the German keyboard does not solve the problem. The key combination doesn't produce anything on the editor. The only way I can get the image in is to copy and paste.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Keys Not rendering properly in Editor
« Reply #1 on: October 10, 2021, 05:08:27 pm »
Ok, first of all:
This is not about typing/input via keyboard? Because the quote below refers to input schemes:
Quote
Changing the locale and coding with the German keyboard does not solve the problem.
You can input/type the key? If you press AltGr+Shift+S it does appear in the editor?


The attached image suggest you talk about the char (glyph) being "cut off"?

This is usually a font problem.
SynEdit only supports strict monospace fonts (off topic: including full-width Japanese chars).

If any char in your font does have a different width than the rest of the chars, then that char is not displayed correctly.

Mind that some OS use font substitution. That is, if a font does not support a "char" (glyph), then the OS uses another font, which the OS choses itself. If the OS does so badly, ignoring the mono-spacing, well then that goes wrong too. (No idea if that applies to you).

I have tested under Ubuntu 20, using "DejaVue Sans Mono".
And the upper-sharp-s displays correctly.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Keys Not rendering properly in Editor
« Reply #2 on: October 10, 2021, 05:21:56 pm »

abtaylr

  • Full Member
  • ***
  • Posts: 107
Re: Keys Not rendering properly in Editor
« Reply #3 on: October 10, 2021, 08:01:22 pm »
As mentioned in my initial comment, using the ALT-GR + Shift + S with Linux German Keyboard is not rendering anything to the screen. I will try to change the the font to the one mentioned.

abtaylr

  • Full Member
  • ***
  • Posts: 107
Re: Keys Not rendering properly in Editor
« Reply #4 on: October 10, 2021, 08:06:37 pm »
I tried the suggested font and nothing renders on the screen, although my cut and pasted images are now rendered correctly.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Keys Not rendering properly in Editor
« Reply #5 on: October 10, 2021, 08:40:02 pm »
As mentioned in my initial comment, using the ALT-GR + Shift + S with Linux German Keyboard is not rendering anything to the screen. I will try to change the the font to the one mentioned.
Ok, then I misunderstood you. I saw the image, and I saw that the letter is there, but only partly displayed. So I thought you had typed it.




As for the problem with the typing...
I don't have Kubuntu, it works for me on Ubuntu (though that is in a VM).

One thing to make sure is that the IDE keymap does not override the key combo.
AltGr is in some case handled as Alt+Ctrl.
An Alt+Ctrl+S opens (or focuses) the Stack-Window.
However An Alt+Ctrl+Shift+S has no IDE action.

Maybe the IDE stops the Key-Combo.
Go to Tools > Options > Editor > Keymap
and use the search to search for Alt+Ctrl+Shift+S
It should come up empty. If not, then that may be the problem...



Otherwise, someone with more understanding of Linux may be able to help.

Also, if you are in the IDE, and you type into a TEdit => does it work then?
This might be a sign that there is an issue in the GTK2 Interface of the LCL (I don't have any detailed knowledge there / just a guess / and also something someone with more experience would need to look at.)

A very long shot....
There is some disabled experimental code for the Key handling in the LCL. I can't really see how it could affect your issue.
But maybe enabling it will help somehow.

The cod is in the 2.2RC1 / It is NOT in any 2.0.x
You would need to recompile the IDE with -dWITH_GTK2_IM
But as I said very far fetched....

Even more far fetched: Compile with -dWITHOUT_GTK_DOUBLEKEYPRESS_CHECK
(and this last one may add issues with keystrokes producing duplicated chars)




 

TinyPortal © 2005-2018