InputSymbol / Emoji

<< Click to Display Table of Contents >>

Navigation:  Programming > Objects >

InputSymbol / Emoji

Using the InputSymbol function a SYMBOL text object can be inserted.

 

Parameters of InputSymbol are the character code which can be 32 bit and, optional, the font to use.

 

The result value is a reference to a TWPTextObj which can be used for further modifications.

 

To insert an emoticon you need to specify the unicode value

(as found here: https://www.unicode.org/emoji/charts/full-emoji-modifiers.html)  and the font to be used.

 

In the CParam property of the created TWPTextObj you can modfiy this bits:

Bits 1-3:skin tone modifier, value 1-5
Bit 8:sex modifier male (apparently currently not always recognized by Windows)
Bit 9:sex modifier female

 

Example:

 

WPRichText1.InputSymbol( $1F64B ,

        'Segoe UI Emoji' ).CParam :=  3;

 

 

waving_girl

 

 

Using the "Extra" property additional codes can be entered. The codes will be entered as decimal numbers.

The combination code $200D and the closing code $FEOF should not be added. The result will be one  symbol which is drwan from several individual or modifying codes.

 

   p := WPRichText1.InputSymbol( $1F469 , 'Segoe UI Emoji' );    

   p.MakeExtra(true);

   p.Extra.Add(IntToStr($1F3FE));

   p.Extra.Add(IntToStr($1F91D));

   p.Extra.Add(IntToStr($1F469));

   p.Extra.Add(IntToStr($1F3FC));

 

This code inserts this combined symbols clip0031(Display of HTML on OSX)

 

 

When such symbols are written to RTF, HTML and also DocX they are written as a group of unicodes. This makes sure other readers can understand the codes. But most editors we tried, would not display the emoji colored as WPTools 9.1 does. Also the unicode text writer writes the correct unicodes.

 

InputSymbol can also be called with a wide string with unicodes for one or more images.

 

In this case multiple objects may be created or unicode will be inserted into the text.

 

  clip0030

 

 

You can open the Windows Symbol Dialog by pressing the Windows Key and .

 

windows_emoji

 

 

Please note that very few Emoji are not painted as colored symbols in Windows.

They should however show up fine when exported to HTML.