Author |
Topic: Limitations of Syntax Coloring (Read 3171 times) |
|
CryptoMan
New Member
member is offline


Gender: 
Posts: 46
|
 |
Re: Limitations of Syntax Coloring
« Reply #9 on: Sep 18th, 2016, 11:31am » |
|
I went to my old Lenovo and choose FixedSys and it does start with FixedSys.
On that machine FixedSys have only Turkish Script but the new machine has both Western and Turkish.
I will now erase one of them and see if this is the cause.
|
|
Logged
|
|
|
|
CryptoMan
New Member
member is offline


Gender: 
Posts: 46
|
 |
Re: Limitations of Syntax Coloring
« Reply #10 on: Sep 18th, 2016, 11:36am » |
|
Windows refuses to erase FixedSys so I couldn't try this.
But, I tried with a similar font Terminal which has only one script OEM/DOS and it does start rendering with terminal.
|
|
Logged
|
|
|
|
CryptoMan
New Member
member is offline


Gender: 
Posts: 46
|
 |
Re: Limitations of Syntax Coloring
« Reply #11 on: Sep 18th, 2016, 11:40am » |
|
In fact, when it works in the old Lenovo, as soon as type " syntax colouring starts.
In the new machine syntax colouring happens when I close the quote.
Why is these different behaviours happening?
|
|
Logged
|
|
|
|
CryptoMan
New Member
member is offline


Gender: 
Posts: 46
|
 |
Re: Limitations of Syntax Coloring
« Reply #12 on: Sep 18th, 2016, 11:48am » |
|
Old Lenovo is Windows 10 Home Edition New Acer is Windows 10 Home Single Language
Yes, this is really a time waster and let's see if anybody else have seen anything like this.
Thanks for your patience.
|
|
Logged
|
|
|
|
tsh73
Full Member
member is offline


Gender: 
Posts: 210
|
 |
Re: Limitations of Syntax Coloring
« Reply #13 on: Sep 19th, 2016, 06:37am » |
|
Her's what I got on Win XP prof SP3 (LBB version still 3.02 but I think it doesn't changed here) http://s21.postimg.io/3zvqvn7yf/Syntax_Coloring_Fixedsys.gif

If I switch to Lucida Console font stays consistent (looks Lucida Console )
But syntax coloring was turned off to me. I will put it on and see if I see anything wrong.
|
|
Logged
|
|
|
|
tsh73
Full Member
member is offline


Gender: 
Posts: 210
|
 |
Re: Limitations of Syntax Coloring
« Reply #14 on: Sep 19th, 2016, 07:03am » |
|
Aha. So I went on reading "pressing ESC aborts the program" thread
and pasted piece of code from reply #23, this one Code: htb = hwnd(#w.tb)
calldll #user32, "GetWindowLongA", htb as ulong, _
_GWL_STYLE as long, style as long
print dechex$(style)
Pasted from Internet Explorer 8 (it happens pasting from Google Chrome works normally with/without syntax coloring!)
Now that I've got: with syntax coloring on I got single line, syntax colored, of different font size, obviously garbled (some "(" not visible) first word is Russian for "Normal" - have no idea where it gets from (Last vertical line is text cursor)
If I turn off syntax coloring, this line gets same font size, but still as a single line it won't compile even after removing extra first word.
Now if I paste same thing with syntax coloring off it appears normal, compiles too
 Still somehow pasted text font looks smaller.
so I'll turn it off for a while.
EDIT: that was Internet Explorer 8 From Google Chrome it works as supposed too, everything is fine.
|
|
Logged
|
|
|
|
CryptoMan
New Member
member is offline


Gender: 
Posts: 46
|
 |
Re: Limitations of Syntax Coloring
« Reply #15 on: Sep 19th, 2016, 1:20pm » |
|
@tsh73: I can see you images. The linked web site is unreachable.
|
|
Logged
|
|
|
|
tsh73
Full Member
member is offline


Gender: 
Posts: 210
|
 |
Re: Limitations of Syntax Coloring
« Reply #16 on: Sep 19th, 2016, 1:45pm » |
|
Quote:| @tsh73: I can see you images. The linked web site is unreachable. |
|
It was postimage.org Now let's try with photobucket:


|
| « Last Edit: Sep 19th, 2016, 1:47pm by tsh73 » |
Logged
|
|
|
|
Rod
Full Member
member is offline


Gender: 
Posts: 110
|
 |
Re: Limitations of Syntax Coloring
« Reply #17 on: Sep 19th, 2016, 6:46pm » |
|
I am on Win10 in Europe and cannot see the problem. Every font change is instant and the font is consistent no matter what font I pick. The syntax colour always kicks in on pressing the second ".
|
|
Logged
|
|
|
|
Jack Kelly
Full Member
member is offline


Gender: 
Posts: 106
|
 |
Re: Limitations of Syntax Coloring
« Reply #18 on: Sep 20th, 2016, 11:17am » |
|
My observations agree with Rod's. There are no quirky problems with fonts on my PC. But I don't try to use any national character sets, or anything beyond plain vanilla. Courier_New bold 18 is just fine on my system.
|
|
Logged
|
|
|
|
CryptoMan
New Member
member is offline


Gender: 
Posts: 46
|
 |
Re: Limitations of Syntax Coloring
« Reply #19 on: Sep 21st, 2016, 4:34pm » |
|
tsh73 is replicating my problem exactly as I observe it.
The problem starts with FixedSys font. So, if others are trying with other fonts they may not see it.
When I start with FixedSys the problem starts immediately and eventually gets very bad and the source code becomes completely uneditable.
It is not really related to national fonts. Originally, I thought that was the reason but it is not. First of all, my FixedSys font has Script=Turkish and thus have all of the necessary additional fonts and thus RichEdit have no reason at all to substitute fonts on the assumption that additional fonts are not existing and thus it tries to find another font. It is already happening with just test$="ABCDE" very simple UK/US ASCII characters. In fact it starts with test$=" in Arial as TSH73 also observed and as soon as the quotes closed it turns into test$="ABCDE" whatever inside quotes turns to FixedSys but test$= remains Arial. After this point RichEdit thinks the font is Proportional Arial but some of it is FixedSys with different characters and thus cursor position is now incorrectly calculated and the source editing becomes impossible.
I have also see 0x20 space characters becoming 1 or 0 pixel size and thus white spaces dissappear.
And, on a Windows 2012 Server have seen it got even worse. I have seen this on many different machines but as I understand some maybe most people are not seeing this problem.
I changed to work with Courier New or Consolas now and so far I have not seen this problem with these fonts. So, I can do without FixedSys and live with Courier.
At least from TSH73 message, some other people also have seen what I have been seeing.
|
|
Logged
|
|
|
|
Rod
Full Member
member is offline


Gender: 
Posts: 110
|
 |
Re: Limitations of Syntax Coloring
« Reply #20 on: Sep 21st, 2016, 5:45pm » |
|
To be clear FixedSys font worked perfectly ok for me. Also the entire text adopts the selected font.
|
| « Last Edit: Sep 21st, 2016, 5:46pm by Rod » |
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Limitations of Syntax Coloring
« Reply #21 on: Sep 21st, 2016, 6:30pm » |
|
on Sep 21st, 2016, 4:34pm, CryptoMan wrote:| my FixedSys font has Script=Turkish and thus have all of the necessary additional fonts and thus RichEdit have no reason at all to substitute fonts |
|
I don't know how many times I must keep repeating this, but that is not correct. Your statement is based on a naïve assumption about the way font substitution works, which is not how it works in practice. I do not know exactly the rules that Rich Edit uses but they are quite obviously not what you describe.
I do not understand why you are so resistant to accepting that the most straightforward explanation is actually the right one. Both you and Anatoly have reported that when you select FixedSys the Rich Edit control is substituting a different font from the start. Yet somehow you want to believe that it is not a font-substitution issue!
Quote:| I changed to work with Courier New or Consolas now and so far I have not seen this problem with these fonts. |
|
Courier New and Consolas are Unicode fonts which have all the characters that are needed for Russian, Turkish and most other languages, therefore the Rich Edit control has no need to perform any substitutions. In contrast the FixedSys font is not a Unicode font and substitutions may be required.
It is certainly interesting that the Rich Edit control is using a substitute font from the start, even when it is not strictly necessary. I don't know the precise reason for that, but it may be to prevent mixing different fonts in the same paragraph which could be ugly. Irrespective, it doesn't alter the basic issue.
I am glad you have found a solution that you are happy with, but I feel I should point out that I told you about that solution (using a Unicode font rather than FixedSys) a long time ago!
Richard.
|
|
Logged
|
|
|
|
tsh73
Full Member
member is offline


Gender: 
Posts: 210
|
 |
Re: Limitations of Syntax Coloring
« Reply #22 on: Sep 21st, 2016, 6:39pm » |
|
I wonder if this depends on richtextbox control version, which might be depending on Windows version? Here on XP home SP3 sysinternals process explorer shows that LBB loaded windows\system32\riched20.dll version 5.30.0023.1230
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Limitations of Syntax Coloring
« Reply #23 on: Sep 23rd, 2016, 08:41am » |
|
on Sep 21st, 2016, 6:39pm, tsh73 wrote:| I wonder if this depends on richtextbox control version, which might be depending on Windows version? |
|
Although there are certainly several different versions of the Rich Edit control, I don't think that's a likely cause of the anomaly. I still believe that the underlying issue is the PC's language selection.
There are several different ways in which a PC can be configured for different locales, among which are the keyboard layout, the default display language, the default Code Page and the input method. My guess is that based on some or all of these settings the Rich Edit control tries to determine whether the selected font contains all the characters that are likely to be required, and if not performs a font substitution.
Richard.
|
|
Logged
|
|
|
|
|