cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
hogi
Level XIII

Emoji + TextBox()?

The Icons which are available in JPM are very limited.

The idea: “Use emojis as icons — there’s one for almost anything!”
just seahorse is missing ...

The problem: how can I use Emojis in JMP - e.g.  in TextBox()? 

With

New Window("Emoji Example",
    Text Box("🔴🟡🟢") 
);

I expect: 
hogi_3-1769006727084.png

 

... but JPM generates:

hogi_2-1769006712063.png

 

not helpful in this context: the creativity of Learnbot

hogi_1-1769006374085.png

 

New Window("Emoji Example",
    Text Box(Char(128512)) // Unicode for 😀
);

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Emoji + TextBox()?

From a synthesis of @hogi's questioning and internal dialog with JMP development, the bottom line is that Windows rendering engine that JMP currently uses for this implementation (as of the release of JMP 19.x) is not able to render color emoji.

We will consider making changes based on 360 customer feedback in future JMP releases. Please feel free to engage the JMP Wish List and @hogi's Wishlist Item.Expand the Built‑in Icon Library for Modern GUI Development 

For customer's interested in bypass workarounds (none of these directly address this limitation), you might be interested in the approaches shared below.   --JMP Technical Support (Re: Case 00275926)

//approach 1: Use Graph Box with Colored Circles, Instead of relying on emoji, draw actual colored circles using Graph Box:
New Window( "Stoplight Example",
    V List Box(
        Graph Box(
            FrameSize( 150, 50 ),
            Y Scale( 0, 1 ),
            X Scale( 0, 3 ),
            // Red circle
            Fill Color( "Red" );
            Oval( 0.25, 0.25, 0.75, 0.75, 1 );
            // Yellow circle
            Fill Color( "Yellow" );
            Oval( 1.25, 0.25, 1.75, 0.75, 1 );
            // Green circle
            Fill Color( "Green" );
            Oval( 2.25, 0.25, 2.75, 0.75, 1 );
        )
    )
);

//approach 2: Use HTML Markup in Text Box, JMP supports limited HTML markup in Text Box, including color formatting:
New Window( "Stoplight Example",
    V List Box(
        Text Box(
            "<font color='red'>●</font> <font color='#FFD700'>●</font> <font color='green'>●</font>",
            <<Set Font( "Segoe UI Emoji", 20 ),
            <<Markup
        )
    )
);


//approach 3: Use Text Color Message,  Set text color directly on Text Box elements:

New Window( "Stoplight Example",
    H List Box(
        tb1 = Text Box( "●", <<Set Font( "Segoe UI Emoji", 24 ) ),
        tb2 = Text Box( "●", <<Set Font( "Segoe UI Emoji", 24 ) ),
        tb3 = Text Box( "●", <<Set Font( "Segoe UI Emoji", 24 ) )
    )
);
tb1 << Text Color( "Red" );
tb2 << Text Color( "Yellow" );
tb3 << Text Color( "Green" );

View solution in original post

13 REPLIES 13

Re: Emoji + TextBox()?

The unicode character set requires some specialized syntax.  The examples here https://www.jmp.com/support/help/ko/18.2/index.shtml#page/jmp/unicode-characters.shtml show how to do it.  You then just need to look up the unicode for the different emoji.  You can find that information on Emojiedia under the technical information tab: https://emojipedia.org/upside-down-face#technical.  It's the code points value.  

 

Best,

 

M

hogi
Level XIII

Re: Emoji + TextBox()?

Hi Mike, what is the benefit of using the unicode notation compared to directly writing the Emoji?


Can you please share a code which generates a text with hogi_1-1769036986527.png instead of hogi_0-1769036964695.png?

 

 

Re: Emoji + TextBox()?

Benefit - it works... ;)

MikeD_Anderson_0-1769090842120.png

Here's the code:

New Window( "Stoplight Example",
	V List Box(
		Text Box( "\!UD83D\!UDD34 \!UD83D\!UDFE1 \!UD83D\!UDFE2", Set Font( "Segoe UI Emoji" ) )
	)
);

A note - I needed to use the UTF-16 versions of the codes. Note that each emoji can have a single code or a pair of codes (called a surrogate pair).  The stop lights you want are in the surrogate pair set of emoji.  Those can be a little hard to find... but this website does a better job than either emojipedia or the unicode site in showing them: http://xahlee.info/comp/unicode_index.html

 

Best,

 

M

Re: Emoji + TextBox()?

BTW - that text snippet the LLM provided is completely wrong on how to approach this problem.  

hogi
Level XIII

Re: Emoji + TextBox()?

Hm, how do I have to adjust the settings on my system to get this beautiful result?

When I run your code on my system: Win11, JMP 19.0.4,
I get:

hogi_0-1769093955551.png

 

 

Re: Emoji + TextBox()?

It's likely down to the font... I think Win11 got rid of the Segoe font... so it might be doing a bad substitution for it.  Maybe get rid of that font assignment in the JSL and let the system font take over?

M

hogi
Level XIII

Re: Emoji + TextBox()?

hogi_0-1769100386975.png

 

Re: Emoji + TextBox()?

I did some poking around on this while I was traveling today.  It looks like the grey coloration is a known issue with that font and some applications.  I'm guessing that JMP fits into that list.  
 
"Emojis from Microsoft are supported on PCs and tablets running Windows 11, Windows 10, as well as Xbox. They were also available on Windows phones prior to them being discontinued. These were provided by the Segoe UI Emoji font, although some applications continue to show black and white emojis from an earlier release.
 
 
I'm thinking then that the best path would be to try some of the other fonts installed with windows to see if they behave better.  
 
Best,
 
M
hogi
Level XIII

Re: Emoji + TextBox()?

Hi Mike,

thanks for the update.
So, is there a good chance this issue will be fixed in one of the next JMP releases?

How do the Column Tags work? Which font is used there?

Recommended Articles