Lazarus

Programming => LCL => Topic started by: mercurhyo on April 16, 2021, 01:04:13 pm

Title: memo and smileys
Post by: mercurhyo on April 16, 2021, 01:04:13 pm
hi all.
Does anyone know if exists a component (likewise a TCustomMemo descendant) able to display smileys inside text? prefer multiplatform if possible
Thank you.
Title: Re: memo and smileys
Post by: Gustavo 'Gus' Carreno on April 16, 2021, 01:59:06 pm
Hey mercurhyo,

hi all.
Does anyone know if exists a component (likewise a TCustomMemo descendant) able to display smileys inside text? prefer multiplatform if possible
Thank you.

I'm really sorry to be picky, but are you asking for smileys or emojis?

Why the difference, well, smileys are the textual ones: :-) and the emojis are the image ones: :)

But nonetheless, if the emojis are Unicode, then it's possible that the TMemo can cope with it, just like any other UTF8 character.
If it's not UTF8 and it's an image, I suspect maybe a TRichView? But I'm not completely sure about this.

So you must specify which of the non textual ones you're talking about.

Cheers,
Gus
Title: Re: memo and smileys
Post by: Martin_fr on April 16, 2021, 02:43:00 pm
On Windows, the normal TMemo does that, at least here an my Win10 PC.
However, display is black and white.

Also display may depend on the font chosen.
Meaning there is no guarantee that it will work on all PC, since they may not have the font needed. (Note that Window may substitute the chosen font for individual chars, and you would not know https://docs.microsoft.com/en-us/globalization/input/font-technology#font-fallback )
Title: Re: memo and smileys
Post by: Handoko on April 16, 2021, 02:57:43 pm
Default Ubuntu Mate installation has Noto fonts (no more tofu), which provide color and black-and-white emojis.

https://en.wikipedia.org/wiki/Noto_fonts#Emoji (https://en.wikipedia.org/wiki/Noto_fonts#Emoji)
Title: Re: memo and smileys
Post by: MarkMLl on April 16, 2021, 03:37:04 pm
Default Ubuntu Mate installation has Noto fonts (no more tofu), which provide color and black-and-white emojis.

I routinely deinstall those since they can vastly slow down some software I've got here (badly-written software, hacked together using Python on a foundation of kitchen sinks, which nobody knows how to debug).

Quite frankly I echo Gus. In fact I'd put it slightly more strongly than he does: nobody but an arrant fool would rely on something which might not display correctly to clarify their meaning >:-)

MarkMLl
Title: Re: memo and smileys
Post by: Gustavo 'Gus' Carreno on April 16, 2021, 03:50:30 pm
Hey Mark,

Quite frankly I echo Gus. In fact I'd put it slightly more strongly than he does: nobody but an arrant fool would rely on something which might not display correctly to clarify their meaning >:-)

I have to admit, and maybe show my very old age, that I never saw the advantage of the image emojis over the textual ones stemmed from the IRC era.

What did we have to gain? The poo emoji and the eggplant one? Really!??! >:-|

Cheers,
Gus
Title: Re: memo and smileys
Post by: Martin_fr on April 16, 2021, 03:52:57 pm
nobody but an arrant fool would rely on something which might not display correctly to clarify their meaning >:-)
Are you sure everyone uses a font that includes punctuation
Title: Re: memo and smileys
Post by: Bart on April 16, 2021, 04:01:04 pm
Are you sure everyone uses a font that includes punctuation

Martin colon At least you could give us the courtesy of ending your sentence with the word questionmark opening parenthesis at leat I assume it was a question closing parenthesis comma if your font opening paernthesis or your keyboard closing parentesis does not support punctiation comma as seems to be the case with you point LineEnding LineEnding With kind regards comma LineEnding LineEnding Bart
Title: Re: memo and smileys
Post by: Handoko on April 16, 2021, 04:03:48 pm
Default Ubuntu Mate installation has Noto fonts (no more tofu), which provide color and black-and-white emojis.

I routinely deinstall those since they can vastly slow down some software ...

Me too. I always uninstall them once I see them on my computer. Not only one, but maybe about 20 or more  :o of such fonts are installed, it makes hard when choosing a font when doing text editing on GIMP. All of them look very similar, a kind of Arial-style, nothing special and not very useful.
Title: Re: memo and smileys
Post by: MarkMLl on April 16, 2021, 04:04:22 pm
Martin, you are a G.K.Chesterton fan and I claim my £5 :-)

Quote
Tolstoy and the Humanitarians said that the world was growing more merciful, and therefore no one would ever desire to kill. And Mr. Mick not only became a vegetarian, but at length declared vegetarianism doomed (‘shedding,’ as he called it finely, ‘the green blood of the silent animals’), and predicted that men in a better age would live on nothing but salt. And then came the pamphlet from Oregon (where the thing was tried) the pamphlet called ‘Why should Salt suffer?’ and there was more trouble.

MarkMLl
Title: Re: memo and smileys
Post by: Martin_fr on April 16, 2021, 04:05:18 pm
At Bart
LOL
ROTFL
Title: Re: memo and smileys
Post by: Thaddy on April 16, 2021, 04:17:30 pm
Are you sure everyone uses a font that includes punctuation
Of course not:
E.g. the dingbat family, like wingdings 1/2/3, music fonts and the like.
You are right! Not every font includes punctuation.  :o O:-) :D

Many moons ago (really many) I loved wingdings to create nice looking Windows 1/2 user interfaces.
Title: Re: memo and smileys
Post by: mercurhyo on April 16, 2021, 06:42:15 pm
thank you all for the convo.

what I meant =

a TImagelist containing nXn uniform sized images and a memo with text containing tokens that are replaced by corresponding bitmaps at WMPaint time like it works inside moste messenger software I guess
Title: Re: memo and smileys
Post by: mercurhyo on April 16, 2021, 06:47:15 pm
I've searched delphi resources and seems to not exist at least in public  :(
Title: Re: memo and smileys
Post by: winni on April 16, 2021, 08:37:45 pm
Hi!

No problems with a simple TMemo and the default font (Sans) with Linux 64, gtk2, fpc 3.2, Laz 2.0.12

See attachement

Winni
Title: Re: memo and smileys
Post by: mercurhyo on April 17, 2021, 02:17:10 am
c'mon winni write a sentence don't play with ms paint  or the Gimp ;) please
Title: Re: memo and smileys
Post by: MarkMLl on April 17, 2021, 09:40:58 am
@mercurhyo YOU stop playing around, and experiment with some code. Recent Lazarus has no problems with such things.

MarkMLl

p.s. It's rare for winni and I to agree on something :-)
Title: Re: memo and smileys
Post by: winni on April 17, 2021, 10:49:49 am
c'mon winni write a sentence don't play with ms paint  or the Gimp ;) please

There is nothing to write.
But for the beginners:

Put a TMemo on your Form.
Compile that "project".

Search some UTF-8-Icons and copy them to the clipboard.

Place your cursor in the memo. Press Ctrl-V.
Make a screenshot.

There you are.

And stop offending me using ms paint. No one with a brain uses that.

Winni
Title: Re: memo and smileys
Post by: MarkMLl on April 17, 2021, 10:58:24 am
what I meant =

a TImagelist containing nXn uniform sized images and a memo with text containing tokens that are replaced by corresponding bitmaps at WMPaint time like it works inside moste messenger software I guess

You /do/ appreciate that these emojim are now standard Unicode characters, don't you? What Winni and I are trying to show you is that you can quite simply C&P them into standard controls, so if (extremely unwisely in my experienced opinion) you wanted to replace :-) by a pile of poo or whatever it becomes a simple character-replacement operation.

There's really absolutely nothing to it, at least with fairly recent versions of the development tools (and obviously suitable OS support).

MarkMLl
Title: Re: memo and smileys
Post by: mercurhyo on April 17, 2021, 05:07:28 pm
oh ok xcuz I do not use utf8 support for now. will try with more andro ram
Title: Re: memo and smileys
Post by: MarkMLl on April 17, 2021, 07:00:03 pm
Are you sure everyone uses a font that includes punctuation
Of course not:
E.g. the dingbat family, like wingdings 1/2/3, music fonts and the like.
You are right! Not every font includes punctuation.  :o O:-) :D

But that is only a subsection of the Unicode repertoire, and you've still got basic punctuation in the base page (i.e. the ASCII characters).

If we were talking about a single-byte character set codepage and a UI which could only display one codepage at a time then things might have been different.

Having said which: the various 5-bit teleprinter codes of which I'm aware (see e.g. table at bottom of http://www.quadibloc.com/crypto/tele03.htm) by and large had a reasonable punctuation repertoire. The various 6-bit dataprocessing codes of which I'm aware (see e.g. https://en.wikipedia.org/wiki/Six-bit_character_code and https://en.wikipedia.org/wiki/BCD_(character_encoding)) had variable degrees of support, but I'm not aware of any of these being used for terminal interaction: even Burroughs adopted ASCII in the early 60s for that purpose.

Both EBCDIC and (7-bit) ASCII have, of course, the combination of punctuations characters we expect. An early version of ASCII had a couple of variant codepoints, in particular _ was a left arrow. I'm aware of a small number of "unofficial" variants, e.g. IBM's VM/CMS operating system considered ^ to be a cent character.

When used as a standalone typewriter, the Selectric had interchangeable golfballs some of which had mathematical symbols rather than standard characters. It's hardly fair to consider those to represent computer character sets, and in any case the typist would have had a case of different golfballs so the situation is much closer to that of modern Unicode.

Finally, I'm aware of rotating-drum or train printers which for reasons of throughput only supported a limited character set so that they could print e.g. bank statements as fast as possible (i.e. greater than the standard 600 lines-per-minute). But that's not to say that the computer to which they were attached was similarly constrained.

So, I'd bet on basic punctuation marks being more predictably available than emojim any day :-)

MarkMLl
Title: Re: memo and smileys
Post by: MarkMLl on April 17, 2021, 07:01:12 pm
oh ok xcuz I do not use utf8 support for now. will try with more andro ram

What's Andrew got to do with it?

MarkMLl
Title: Re: memo and smileys
Post by: Thaddy on April 17, 2021, 07:07:14 pm
and you've still got basic punctuation in the base page (i.e. the ASCII characters).
MarkMLl
No.
(Dead giveaway: open the font in font viewer)
Title: Re: memo and smileys
Post by: winni on April 17, 2021, 07:19:30 pm
and you've still got basic punctuation in the base page (i.e. the ASCII characters).
MarkMLl
No.
(Dead giveaway: open the font in font viewer)

Hi!

I don't know any Unicode Font without then base page.
Aditional there are in the math code block an in some language blocks some additional punctuation signs.

Winni
Title: Re: memo and smileys
Post by: winni on April 17, 2021, 07:28:16 pm
Hi!

Punctuation in UTF-8, here: Semicolon as example

U+003B  |SEMICOLON
U+061B  |ARABIC SEMICOLON
U+1364  |ETHIOPIC SEMICOLON
U+204F  |REVERSED SEMICOLON
U+236E  |APL FUNCTIONAL SYMBOL SEMICOLON UNDERBAR
U+2E35  |TURNED SEMICOLON
U+A6F6  |BAMUM SEMICOLON
U+FE14  |PRESENTATION FORM FOR VERTICAL SEMICOLON
U+FE54  |SMALL SEMICOLON
U+FF1B  |FULLWIDTH SEMICOLON
U+1DA89 |SIGNWRITING SEMICOLON
U+E003B |TAG SEMICOLON

Whatever you just need.
Even for the APL users (if there are still some)

Winni
TinyPortal © 2005-2018