Recent

Author Topic: A bug in TRichMemo!  (Read 3073 times)

rvk

  • Hero Member
  • *****
  • Posts: 7042
Re: A bug in TRichMemo!
« Reply #15 on: August 01, 2025, 07:32:30 am »
So, the characters that are in SMP(10000–​1FFFF), SIP(20000–​2FFFF), TIP(30000–​3FFFF) and SSP(E0000–​EFFFF) may not work correctly in the Windows RichText component and should be avoided!!
Do you have an official source for that??

If you use the 𝒿 only in Cambria Math and keep the others in another font, it works. Only that character might not switch to bold.

Other question... did you try all this with the normal standard font?
For example Segoe UI. Then it works fine.

Ed78z

  • Jr. Member
  • **
  • Posts: 82
Re: A bug in TRichMemo!
« Reply #16 on: August 01, 2025, 05:25:29 pm »
So, the characters that are in SMP(10000–​1FFFF), SIP(20000–​2FFFF), TIP(30000–​3FFFF) and SSP(E0000–​EFFFF) may not work correctly in the Windows RichText component and should be avoided!!
Do you have an official source for that??

If you use the 𝒿 only in Cambria Math and keep the others in another font, it works. Only that character might not switch to bold.

Other question... did you try all this with the normal standard font?
For example Segoe UI. Then it works fine.


Code: Pascal  [Select][+][-]
  1. | RichEdit Version  | Class Name    |   DLL        | Windows / Office Version   | Notes                                                                              |
  2. | ----------------- | ------------- | ------------ | -------------------------- | ---------------------------------------------------------------------------------- |
  3. | 1.0               | RichEdit      | riched32.dll | Windows 95 / NT 4.0        | Basic; obsolete                                                                    |
  4. | 1.0 (OLE support) | RichEdit      | riched32.dll | Office 95                  | Added OLE object embedding                                                         |
  5. | 2.0               | RichEdit20A/W | riched20.dll | Office 97                  | Not redistributable                                                                |
  6. | 3.0               | RichEdit20A/W | riched20.dll | Office 2000 / Windows 2000 | Enhanced formatting                                                                |
  7. | 4.0               | RichEdit20W   | riched20.dll | Windows XP                 | Better international, BiDi support                                                 |
  8. | 4.1               | RichEdit50W   | msftedit.dll | Windows XP SP1+            | WordPad default since XP                                                           |
  9. | 5.0               | RichEdit50W   | msftedit.dll | Windows Vista              | Partial surrogate pair support                                                     |
  10. | 6.0               | RichEdit50W   | msftedit.dll | Windows 7                  | Better layout, color emoji                                                         |
  11. | 7.0               | RichEdit50W   | msftedit.dll | Windows 8 / 8.1            | Touch support, spellcheck                                                          |
  12. | 8.0               | RichEdit50W   | msftedit.dll | Windows 10 / 11            | Latest in Windows 11, supports more modern layout but still limitations beyond BMP |

RichEdit 4.1 (C:\Windows\System32\msftedit.dll) is the last publicly available RichEdit version for general Windows apps.
Newer than 4.1,   internal only, Microsoft Office & UWP apps uses it, and they are NOT exposed via DLL for general use.
However, MS Word, uses different method than pure RichEdit which is written from scratch for the MS Office only.
To properly render and handle Unicode characters beyond the BMP (e.g. 𝒜, 𝔸, 🧠, 𐍈), we need to create a custom control that bypasses GDI (uses by Lazarus) and instead uses DirectWrite for text rendering.

Ed78z

  • Jr. Member
  • **
  • Posts: 82
Re: A bug in TRichMemo!
« Reply #17 on: August 01, 2025, 07:26:04 pm »
So, the characters that are in SMP(10000–​1FFFF), SIP(20000–​2FFFF), TIP(30000–​3FFFF) and SSP(E0000–​EFFFF) may not work correctly in the Windows RichText component and should be avoided!!
Do you have an official source for that??

If you use the 𝒿 only in Cambria Math and keep the others in another font, it works. Only that character might not switch to bold.

Other question... did you try all this with the normal standard font?
For example Segoe UI. Then it works fine.

unfortunately, for the characters beyond BMP, it doesn't work reliable, and makes my program looks ugly!

So, I guess I need to stop and think about how to create a custom control with DirectWrite....
« Last Edit: August 04, 2025, 01:29:40 am by Ed78z »

 

TinyPortal © 2005-2018