Recent

Author Topic: [SOLVED] Synedit shows ⋅ as a quadrangle  (Read 1244 times)

CM630

  • Hero Member
  • *****
  • Posts: 1218
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
[SOLVED] Synedit shows ⋅ as a quadrangle
« on: February 19, 2024, 08:20:29 am »
When I execute the following code SynEdit displays the dot as a quadrangle.
TEdit, on the other hand, displays it as it should.
Both controls have the font CourierNew. Can I do something to have the ⋅ character displayed?

Code: Pascal  [Select][+][-]
  1.   Edit1.Text := '2⋅0,95 = 1,9';
  2.   SynEdit1.Text := '2⋅0,95 = 1,9';


That happens on Win 10 64 bit with Lazarus 3.0.
« Last Edit: February 19, 2024, 11:01:48 am by CM630 »
Лазар 4,0RC2 32 bit (sometimes 64 bit); FPC3,2,2

rvk

  • Hero Member
  • *****
  • Posts: 6640
Re: Synedit shows ⋅ as a quadrangle
« Reply #1 on: February 19, 2024, 08:32:48 am »
It's not the Font. It's probably the encoding.

What Unicode character is that?
Alt+250 dot seems to be fine.

CM630

  • Hero Member
  • *****
  • Posts: 1218
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: Synedit shows ⋅ as a quadrangle
« Reply #2 on: February 19, 2024, 08:48:14 am »
It's not the Font. It's probably the encoding.

What Unicode character is that?
Alt+250 dot seems to be fine.
I have no idea what is “Alt+250”.
Maybe the image will answer the question about the Unicode character.
Лазар 4,0RC2 32 bit (sometimes 64 bit); FPC3,2,2

rvk

  • Hero Member
  • *****
  • Posts: 6640
Re: Synedit shows ⋅ as a quadrangle
« Reply #3 on: February 19, 2024, 09:09:05 am »
Alt+250 is Unicode character "middle dot"/
https://www.fileformat.info/info/unicode/char/b7/index.htm

You can get it by holding the Alt key and pressing 2 5 0 on your numeric keyboard.
It looks the same as your "Dot operator" character (which seems to be char($22C5)).

I can't even copy and paste that character in my code editor of Lazarus (in the source).
Even copying it in Notepad++ (in UTF8 mode) doesn't work.

Does loading it from a file work?
(then it might be a conversion problem from source-code to program-code.)

Edit: O, it just occured to me.... That character might not even be in the Courier New font.
Did you try another font??

Note: TEdit/Windows substitutes fonts automatically when characters are not supported.
In this case Windows substitutes it for "Cambria Math".

Edit #2: Yes... this works fine:
Code: Pascal  [Select][+][-]
  1.   SynEdit1.Font.Name := 'Cambria Math';
  2.   Edit1.Text := '2' + #$E2#$8B#$85 + '0,95 = 1,9';
  3.   SynEdit1.Text := Edit1.Text;
(although Cambria Math doesn't look good in SynEdit but that's another matter...)
« Last Edit: February 19, 2024, 09:14:58 am by rvk »

CM630

  • Hero Member
  • *****
  • Posts: 1218
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
[SOLVED]Re: Synedit shows ⋅ as a quadrangle
« Reply #4 on: February 19, 2024, 09:33:44 am »

Alt+250 is Unicode character "middle dot"/
https://www.fileformat.info/info/unicode/char/b7/index.htm

You can get it by holding the Alt key and pressing 2 5 0 on your numeric keyboard.

Thanks, it shows fine.



It looks the same as your "Dot operator" character (which seems to be char($22C5)).

Indeed, I will use that char instead.



I can't even copy and paste that character in my code editor of Lazarus (in the source).

I can neither.


Does loading it from a file work?
No, I have it in the keyboard layout, so I just type it.


Edit: O, it just occured to me.... That character might not even be in the Courier New font.
Did you try another font??

Note: TEdit/Windows substitutes fonts automatically when characters are not supported.
In this case Windows substitutes it for "Cambria Math".
That sounds like a perfectly reasonable explanation. So I will use the other dot ·

Thanks!


Edit: The dot char seems to be #8901.
« Last Edit: February 19, 2024, 11:12:40 am by CM630 »
Лазар 4,0RC2 32 bit (sometimes 64 bit); FPC3,2,2

 

TinyPortal © 2005-2018