Recent

Author Topic: Subscript Decimal  (Read 620 times)

William Marshall

  • New Member
  • *
  • Posts: 48
Subscript Decimal
« 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?).
Lazarus 1.8.0; fpc 3.0.4; Windows 10

wp

  • Hero Member
  • *****
  • Posts: 6620
Re: Subscript Decimal
« Reply #1 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?
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

winni

  • Hero Member
  • *****
  • Posts: 709
Re: Subscript Decimal
« Reply #2 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

William Marshall

  • New Member
  • *
  • Posts: 48
Re: Subscript Decimal
« Reply #3 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.
Lazarus 1.8.0; fpc 3.0.4; Windows 10

William Marshall

  • New Member
  • *
  • Posts: 48
Re: Subscript Decimal
« Reply #4 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?
Lazarus 1.8.0; fpc 3.0.4; Windows 10

wp

  • Hero Member
  • *****
  • Posts: 6620
Re: Subscript Decimal
« Reply #5 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.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

William Marshall

  • New Member
  • *
  • Posts: 48
Re: Subscript Decimal
« Reply #6 on: December 28, 2019, 07:40:38 pm »
Thank you, wp.  That helped tremendously.
Lazarus 1.8.0; fpc 3.0.4; Windows 10

winni

  • Hero Member
  • *****
  • Posts: 709
Re: Subscript Decimal
« Reply #7 on: December 28, 2019, 08:25:54 pm »

Danger - Typo:

SUBSCRIPT_PLUS = #$E2#$82#$8A;     

MarkMLl

  • Hero Member
  • *****
  • Posts: 590
Re: Subscript Decimal
« Reply #8 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
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

winni

  • Hero Member
  • *****
  • Posts: 709
Re: Subscript Decimal
« Reply #9 on: December 28, 2019, 10:18:31 pm »
No problems with dicritical and combing signs with Linux/gtk2.

Direct from the clipboad:

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

Winni

William Marshall

  • New Member
  • *
  • Posts: 48
Re: Subscript Decimal
« Reply #10 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!
Lazarus 1.8.0; fpc 3.0.4; Windows 10

William Marshall

  • New Member
  • *
  • Posts: 48
Re: Subscript Decimal
« Reply #11 on: December 28, 2019, 11:25:34 pm »
Oh, and I had no trouble with the clipboard.
Lazarus 1.8.0; fpc 3.0.4; Windows 10

valdir.marcos

  • Hero Member
  • *****
  • Posts: 965
Re: Subscript Decimal
« Reply #12 on: December 29, 2019, 12:08:27 am »
Interesting discussion.

MarkMLl

  • Hero Member
  • *****
  • Posts: 590
Re: Subscript Decimal
« Reply #13 on: December 29, 2019, 10:17:29 am »
Oh, and I had no trouble with the clipboard.

Oh you will :-)

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.