Lazarus

Programming => General => Topic started by: William Marshall on December 27, 2019, 09:25:30 pm

Title: Subscript Decimal
Post by: William Marshall on December 27, 2019, 09:25:30 pm
Is there a Unicode character for a subscripted decimal point?  I didn't see any in the Superscript/Subscript section.  I've looked in other sections too, but there are so many characters I may have easily missed it.  Perhaps another character that looks sort of like a decimal?  Ideally the character should be a little larger than a regular decimal since it could be difficult to distinguish between a subscripted 15 and 1.5.  Using HTML would be easy of course, but I'm trying to display these strings in a TEdit (unless there is a way to use HTML in a TEdit?).
Title: Re: Subscript Decimal
Post by: wp on December 27, 2019, 09:35:33 pm
I don't know of any TEdit which can display html. But maybe rtf in a TRichMemo/TRichView reduced to the height of a single line?
Title: Re: Subscript Decimal
Post by: winni on December 27, 2019, 10:08:03 pm
Hi!

There is a SuperScript/SubScript Block in UTF8 - but they forgot the dot!!!

I had the same problem some time ago and here is my (strange) substitute list:

-----------------
U+05B9
ֹ
D6B9
54969
ֹ
HEBREW POINT HOLAM
---------------------------
U+02D9
˙
CB99
52121
˙
DOT ABOVE
--------------------------------
U+0307
̇
CC87
52359
̇
COMBINING DOT ABOVE
----------------------------
U+0971

E0A5B1
14722481
ॱ
DEVANAGARI SIGN HIGH SPACING DOT
----------------------------------------
U+2801

E2A081
14852225
⠁
BRAILLE PATTERN DOTS-1
---------------------------
U+30FB

E383BB
14910395
・
KATAKANA MIDDLE DOT
-----------------------------

Signs with names like "diacritical" or "combined" have a width = 0. They need an extra space to be seen.

Hope it helps out of the UTF8 mess.

Winni
Title: Re: Subscript Decimal
Post by: William Marshall on December 27, 2019, 10:39:21 pm
Thanks, wp.  I've used TRichMemos like that before in another project.  It would certainly work.  All the other text boxes on the form are regular TEdits though.  Probably wouldn't involve a lot of recoding for just one TRichMemo.  I just have to convince myself it's worth the effort, when all I would hopefully have to do is insert a single character in my current code.

winni - thank you too.  The names themselves don't sound too promising, but it's appearance that's important.  I'll take a look at them when I get the time - probably tomorrow.

Thanks again to both of you.
Title: Re: Subscript Decimal
Post by: William Marshall on December 28, 2019, 06:42:13 pm
OK.  Stupid question time.  I had found a code for a subscripted plus sign as #$E2#$82#$8A somewhere, and I've been using that as a stand-in for a subscripted decimal.  Now I've realized I don't know how to interconvert the various unicode formats.  For instance, what's the relationship between #$E2#$82#$8A and U+208A for subscript-plus?  How would I change "U+05B9" or "D6B9" or the others to the "#$" format?  Can I use "U+" directly in my code somehow?
Title: Re: Subscript Decimal
Post by: wp on December 28, 2019, 07:04:02 pm
OK.  Stupid question time.  I had found a code for a subscripted plus sign as #$E2#$82#$8A somewhere, and I've been using that as a stand-in for a subscripted decimal.  Now I've realized I don't know how to interconvert the various unicode formats.  For instance, what's the relationship between #$E2#$82#$8A and U+208A for subscript-plus?  How would I change "U+05B9" or "D6B9" or the others to the "#$" format?  Can I use "U+" directly in my code somehow?
If there's a rule, I don't know. But why don't you type "U+208A" into your favorite search engine. I did this, and the first link lead me to https://www.compart.com/en/unicode/U+208A, and scrolling down a bit, I find that the UTF8 code for this "character" is "0xE2 0x82 0x8A" which are the hex bytes - replace the C "0x" by the  Pascal "$", remove the spaces between these hex characters, put a # in front of each byte, and you've got the Pascal UTF8-representation of the subscripted plus:
Code: Pascal  [Select][+][-]
  1. const
  2.   SUBSCRIPT_PLUS = $#E2#$82#$8A;

The above-mentioned link also contains a link to the neighboring code points.
Title: Re: Subscript Decimal
Post by: William Marshall on December 28, 2019, 07:40:38 pm
Thank you, wp.  That helped tremendously.
Title: Re: Subscript Decimal
Post by: winni on December 28, 2019, 08:25:54 pm

Danger - Typo:

SUBSCRIPT_PLUS = #$E2#$82#$8A;     
Title: Re: Subscript Decimal
Post by: MarkMLl on December 28, 2019, 09:16:40 pm
Does "combining dot below (U+0323)" help? I've successfully used combining harpoons in button names etc. in the past so at least some variants of the LCL support that sort of thing.

Beware putting anything like that on the clipboard...

MarkMLl
Title: Re: Subscript Decimal
Post by: winni on December 28, 2019, 10:18:31 pm
No problems with dicritical and combing signs with Linux/gtk2.

Direct from the clipboad:

̇ ̋ ̐̑ ̏̒  ̐ ̎ ͫͬ ͥ ͦ

Winni
Title: Re: Subscript Decimal
Post by: William Marshall on December 28, 2019, 11:23:01 pm
"Combining dot below" works nicely!  I just have to remember to add a space after it.  Thank you!
Title: Re: Subscript Decimal
Post by: William Marshall on December 28, 2019, 11:25:34 pm
Oh, and I had no trouble with the clipboard.
Title: Re: Subscript Decimal
Post by: valdir.marcos on December 29, 2019, 12:08:27 am
Interesting discussion.
Title: Re: Subscript Decimal
Post by: MarkMLl on December 29, 2019, 10:17:29 am
Oh, and I had no trouble with the clipboard.

Oh you will :-)

MarkMLl
TinyPortal © 2005-2018