Recent

Author Topic: Automatic font change  (Read 28615 times)

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2267
    • havefunsoft.com
Re: Automatic font change
« Reply #30 on: October 24, 2016, 08:20:45 pm »
raised exception win32richmemo line 494
makes sense. r5290 fixes the issue.
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

rick2691

  • Sr. Member
  • ****
  • Posts: 375
Re: Automatic font change
« Reply #31 on: October 24, 2016, 09:41:58 pm »
Guess What? As best I can tell from loading existing files it does not switch fonts!

I'll have to type a new file in order to be certain.

However, it does not like my Syriac fonts at all! It won't post them as Right-to-Left, and with some files it displays garbage. I hope that the issues isn't that the Syriac is using formatting that has been developed after the RICHED20.dll, and it just can't do it.

English, Greek, and Hebrew are just fine. No swapping.

Rick

Windows 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit

rick2691

  • Sr. Member
  • ****
  • Posts: 375
Re: Automatic font change
« Reply #32 on: October 25, 2016, 04:41:30 pm »
On attempting to switch back to MSFTEDIT for a test it raised an exception...

error 1407
file win32wcontrols.pp
line 253

code used...

LoadLibrary('MSFTEDIT.DLL'); //  'RICHED32.DLL'  'RICHED20.DLL'  'MSFTEDIT.DLL'
RichEditClass:= 'RichEdit20W'; // specifying the class 

Rick
Windows 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2267
    • havefunsoft.com
Re: Automatic font change
« Reply #33 on: October 25, 2016, 05:50:21 pm »
On attempting to switch back to MSFTEDIT for a test it raised an exception...

code used...

LoadLibrary('MSFTEDIT.DLL'); //  'RICHED32.DLL'  'RICHED20.DLL'  'MSFTEDIT.DLL'
RichEditClass:= 'RichEdit20W'; // specifying the class 
The combination of .dll and the class name doesn't exist. The proper class name is RichEdit50W

But, if you want to go back to MSFTEdit.dll, then just remove these lines.
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

rick2691

  • Sr. Member
  • ****
  • Posts: 375
Re: Automatic font change
« Reply #34 on: October 25, 2016, 09:25:07 pm »
Using RichEdit50W is adequate for what I am doing. I am testing Syriac fonts. At present I have not found one that works with RICHED20.DLL

It looks like I have lost Syriac. Depressing. The MSFTEDIT behavior was unacceptable.

Rick
Windows 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit

rick2691

  • Sr. Member
  • ****
  • Posts: 375
Re: Automatic font change
« Reply #35 on: October 26, 2016, 06:50:30 pm »
I tracked down the problem. RICHED20.DLL was built prior to Syriac entering the Unicode system. Since its index values are higher than what existed at the time of RICHED20.DLL, it refuses to access them... another "better idea" by Microsoft.

I will either have to abandon Syriac (and any other recent additions to Unicode), or revert to an ASCII simulation of the language (where glyphs are assigned to the ASCII character set). If I do the latter I will have manage the right-to-left process (and the complexity of a scripting font) independently of the DLL.

Rick
Windows 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit

rvk

  • Hero Member
  • *****
  • Posts: 3836
Re: Automatic font change
« Reply #36 on: October 26, 2016, 07:16:39 pm »
I tracked down the problem. RICHED20.DLL was built prior to Syriac entering the Unicode system. Since its index values are higher than what existed at the time of RICHED20.DLL, it refuses to access them... another "better idea" by Microsoft.

What RICHED20.DLL are you taking about? There are a lot of versions (and sub-versions).

v5.30.23.1230 (included with Windows XP)
v5.31.23.1229 (included with Windows 7)
v5.40.11.2210 (installed with Office XP)
v5.50.99.2050 (installed with Office 2003)
v12.0.4518.1014 (installed with Office 2007)
v14.0.4750.1000 (installed with Office 2010)
v15.0.4420.1017 (installed with Office 2013)
v16.0.6925.1014 (installed with Office 2016)

And each main-version has sub-versions which have subtle differences. But RICHED20.DLL is still maintained.

There are a few more versions I didn't mention.
So just saying that RICHED20.DLL doesn't work, doesn't mean all versions don't work.

rick2691

  • Sr. Member
  • ****
  • Posts: 375
Re: Automatic font change
« Reply #37 on: October 26, 2016, 09:02:32 pm »
I assume it is what came with XP, because I never load it. How do you obtain the new versions?
Windows 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit

rick2691

  • Sr. Member
  • ****
  • Posts: 375
Re: Automatic font change
« Reply #38 on: October 26, 2016, 10:03:46 pm »
Mine is... version 5.30.23.1230
Rich Text Edit Control, v3.0
Copyright © Microsoft Corp. 1997-1999
Windows 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit

rvk

  • Hero Member
  • *****
  • Posts: 3836
Re: Automatic font change
« Reply #39 on: October 26, 2016, 10:26:34 pm »
I also have/had a lot of trouble finding a good RICHED20.DLL for my purposes. When I found one that works correctly with a certain feature it gave me trouble with another one. Ultimately I settled with a version 3.1 subversion 5.31.23.1230 (which came with a update in Windows 7 or 8 ).

To give you an indication of the versions I tried (for my needed feature-set, which might be different for you) here is my RICHED20 directory with different versions:

Code: [Select]
How to prevent crashes when pasting into the text editor - Kinook Software Forums.url
MSFTEDIT - (v7.5) 10.0.10240.16386.dll
Probleem-versies.txt
RICHED20 - (v3.0) 5.30.23.1230 (winXP).DLL
RICHED20 - (v3.1) 5.31.23.1229 (win7).DLL
RICHED20 - (v3.1) 5.31.23.1230.DLL
RICHED20 - (v3.1) 5.31.23.1231 (win10).DLL
RICHED20 - (v4.0) 5.40.11.2210 (OfficeXP).DLL
RICHED20 - (v5.0) 5.50.99.2050 (Office2003).DLL
RICHED20 - (v6.0) 12 MSPTLS.DLL
RICHED20 - (v6.0) 12.0.6606.1000.DLL
RICHED20 - (v6.0) 14 MSPTLS.DLL
RICHED20 - (v6.0) 14.0.4750.1000.DLL
RICHED20 - (v8.0) 15 MSPTLS.DLL
RICHED20 - (v8.0) 15.0.4420.1017 (b) msptls.dll
RICHED20 - (v8.0) 15.0.4420.1017 (b).DLL
RICHED20 - (v8.0) 15.0.4420.1017.DLL
RICHED20 - (v8.0) 15.0.4659.1000.DLL
So you could try the 5.4, 5.5 or even 12 through 15 versions.

You can take some of the versions from Office or later Windows-versions.
I think versions above 12 need MSPTLS.DLL too but below that only RICHED20.DLL is needed.
You can also download some of these here (the >12 have MSPTLS.DLL also included):
http://www.kinook.com/Forum/showthread.php?t=2853

You can see that the version you've got (5.30.23.1230) is a very old one (XP) and even 3.0 at that. I would certainly go for at least a 5.31.x version (which should still work on XP). Just copy the RICHED20.DLL to your .exe directory and it will be used. If the 5.31 doesn't have the feature you need you can go to the higher versions until you get the right one :)

Yeah... picking the right one was a real challenge because in some versions certain bugs where introduced which where solved in earlier versions... but if you don't use certain things you might nog even encounter these bugs.

Also the absolute last version might not work on XP anymore but you can test that yourself.

rick2691

  • Sr. Member
  • ****
  • Posts: 375
Re: Automatic font change
« Reply #40 on: October 27, 2016, 02:35:35 pm »
I have found that my system will not permit me to install different versions for MSFTEDIT and RICHED20. It lets me copy/paste and overwrite, but then it politely reinstalls the original version without giving any notice.

Rick
Windows 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit

rvk

  • Hero Member
  • *****
  • Posts: 3836
Re: Automatic font change
« Reply #41 on: October 27, 2016, 02:50:36 pm »
I have found that my system will not permit me to install different versions for MSFTEDIT and RICHED20. It lets me copy/paste and overwrite, but then it politely reinstalls the original version without giving any notice.
You don't have to install/reinstall RICHED20.DLL. You can just put it in the .exe directory (with your program) and it will be loaded. The program directory has priority over the C:\WINDOWS\SYSTEM32 or any other directory.

It's how I supply the RICHED20.DLL with my program because each Windows-version has another version with those subtle differences that you can't really count on the system-provided one.

rick2691

  • Sr. Member
  • ****
  • Posts: 375
Re: Automatic font change
« Reply #42 on: October 27, 2016, 02:54:06 pm »
I'll try it. Thank you for your advice.
Windows 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit

rick2691

  • Sr. Member
  • ****
  • Posts: 375
Re: Automatic font change
« Reply #43 on: October 27, 2016, 03:47:15 pm »
OK. I went through every combination and found the same results. The oldest RICHED20 is the only one that does not swap fonts, and it cannot work with the Syriac font. All of the MSFTEDIT's will swap fonts, and they cannot be turned off.

Rick
Windows 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit

rvk

  • Hero Member
  • *****
  • Posts: 3836
Re: Automatic font change
« Reply #44 on: October 28, 2016, 10:45:27 am »
Note that Segoe UI Historic does include Syriac (added in Windows 10).