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


Gender: 
Posts: 46
|
 |
Re: Limitations of Syntax Coloring
« Reply #5 on: Sep 18th, 2016, 11:10am » |
|
Let me add a few more comments.
If you turn off Syntax Colouring and Select FixedSys LBB editor never renders the fonts with FixedSys.
With syntax colouring this problem happened with US/UK ASCII characters and therefore is nothing to do with Turkish.
As I told you before it was never a font substitution problem or Unicode problem. Turkish fonts really doesn't need Unicode. At worst, we will see Icelandic Thorns and when that appears we know how to fix it by finding the correct font file or modifying a a Western fonts with a font editor.
Most probably, this is a Rich Edit bug.
But the question is why LBB Editor is not starting by using the choosen Editor font FixedSys?
I agree RichEdit is bombing when you ask it do find and replace font changes but a source code editor is not a Word Processor and will work with only one font. Only need for RichEdit is for syntax colouring. The font and character size should remain the same all through the text.
And, I have seen this odd behaviour even in the earlier versions of LBB without any syntax colouring with font's are changing to strange fonts and sometimes italic. I think the RichEdit control is loosing track of atribute information of characters due to reasons which I don't know.
I haven't studied the internal logic of RichEdit. Most probably, there is a linked list of pointers indicating position of font atribute changes and as the text gets bigger and bigger; and with insertions and deletions in the text memory map probably corresponding updates on the atributes list looses it at certain points and the mess starts.
If you remember the original IBM PC screen memory map at 0xB000 for monochrome and 0xB800 for colour displays each character was represented as two byte, first byte the character and second by the character atribute: color,underline,bold,etc. That's probably a wasteful strategy for large documents but really does Microsoft care about any efficiency these days?
The other strategy could be the ANSI.SYS or VT100/VT220 method with Esc[nnn for causing atribute change. These were working just fine in those days.
Anyway, this issue is wasting too much of your time and my time. Let's switch to Courier New and hope Rich Edit behaves better with one of those proper fonts.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Limitations of Syntax Coloring
« Reply #6 on: Sep 18th, 2016, 11:14am » |
|
on Sep 18th, 2016, 11:10am, CryptoMan wrote:| But the question is why LBB Editor is not starting by using the choosen Editor font FixedSys? |
|
It is, for me. Let's await the reports of other users.
Quote:| Turkish fonts really doesn't need Unicode. At worst, we will see Icelandic Thorns and when that appears we know how to fix it |
|
That statement is wrong, or at least highly misleading, as I have explained so many times.
Richard.
|
|
|
|
CryptoMan
New Member
member is offline


Gender: 
Posts: 46
|
 |
Re: Limitations of Syntax Coloring
« Reply #7 on: Sep 18th, 2016, 11:20am » |
|
Just to eliminate any doubts on Keyboard settings, I changed it to English (US) Keyboard and it is the same. It does not start with FixedSys.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Limitations of Syntax Coloring
« Reply #8 on: Sep 18th, 2016, 11:24am » |
|
on Sep 18th, 2016, 11:20am, CryptoMan wrote:| Just to eliminate any doubts on Keyboard settings, I changed it to English (US) Keyboard and it is the same. It does not start with FixedSys. |
|
You said this was wasting too much time. I agree, so please let us wait for reports from other users so we can determine whether this is something peculiar to your setup or a more general issue. I hope not to see any more posts from you until then, thanks.
Richard.
|
|
Logged
|
|
|
|
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
|
|
|
|
|