Page 1 of 1

ConvertSymbolFonts and bullets

Posted: Tue Jun 17, 2025 10:15 pm
by whisper1980
Using the evaluation trial (TRichViewEdit v23.1) under Delphi 12.3. Sorry for the long post.

The bullet I use is from the Symbol set, character B7.
Checkboxes and radio buttons use Wingdings:
CmtChkBox_Empty = 168; // 0xA8
CmtChkBox_Check = 254; // 0xFE
CmtRadioBtn_Empty = 161; // 0xA1
CmtRadioBtn_Check = 164; // 0xA4

RTFOption.rvrtfDuplicateUnicode is False.

See "SymbolSet.rtf" for sample RTF that I load using your Editor 1 demo, RVEditDemo_Skia, at:
C:\Components\TRichViewTrialDelphiFMX_D12\TRichView\Demos\Delphi.FMX\Editors\Editor 1

When RTFReadProperties.ConvertSymbolFonts is False, bullets, checkboxes, radio buttons show up fine on Windows. On Android, bullets show up fine, though tiny, but not checkboxes and radio buttons. See "SymbolSet Windows.jpg" and "SymbolSet Android.jpg".

When RTFReadProperties.ConvertSymbolFonts is True, checkboxes, radio buttons show up fine on Windows, but not bullets (double char kind of thing). On Android, bullets come out like they do on Windows (double char thing). Checkboxes and radio buttons are better but not good. Unchecked radio button looks good, but not the checked version. For checkboxes, checked and unchecked are both checked. See "SymbolSet Win Convert.jpg" and "SymbolSet Android Convert.jpg".

I even tried deploying Wingdings as both wingding.ttf and Wingdings.ttf to ".\assets\internal" for the Android build, but not sure if I even came close to doing that right.

My main concern is the bullets when ConvertSymbolFonts is True for Android and iOS (my app is only for mobile). For checkboxes and radio buttons I'm thinking/hoping maybe I can find alternative chars that convert better if I can't get my current Wingding chars to work.

Any help or insight is most welcome! Thanks!
Eric

Re: ConvertSymbolFonts and bullets

Posted: Wed Jun 18, 2025 10:59 pm
by whisper1980
I found an issue with the RTF, which is generated by WPTools for the most part. However, not sure why it is not a problem when ConvertSymbolFonts is false but is when true.

In the SymbolSet.rtf, there is this line:
{\list\listtemplateid2\listsimple{\listlevel\leveljc0\levelfollow0\levelstartat1\levelindent360\levelnfc23\levelstartat1{\leveltext\'02·\'00;}{\levelnumbers \'02;}\f4}\listid2}

If I change the two '02 to '01 (or even just the first one), the bullets come out fine when using ConvertSymbolFonts:
{\list\listtemplateid2\listsimple{\listlevel\leveljc0\levelfollow0\levelstartat1\levelindent360\levelnfc23\levelstartat1{\leveltext\'01·\'00;}{\levelnumbers \'01;}\f4}\listid2}

It shouldn't be '02 since a bullet is one char. I'm no expert on RTF by a long shot, but am I wrong? If I'm not wrong, it seems like a bug in WPTools RTF export that I can probably fix, but again, why is it OK when not using ConvertSymbolFonts?

Eric

Re: ConvertSymbolFonts and bullets

Posted: Thu Jun 19, 2025 1:11 pm
by Sergey Tkachenko
\leveltext\'02·\'00 defines a two-character string. The first character is '·', the second character is a placeholder for the list counter.
However, for this list, \levelnfc23 is set, that means "Bullet" (no list counter).
While this is bug of this RTF, I'll change RTF reading code to remove list counter placeholders for bullers.