Emoji in Html

94 views
Skip to first unread message

Serhei Scrabin

unread,
Jul 2, 2022, 7:28:37 AM7/2/22
to DroidScript
Hello.
I have android 9 and old version of emoji.
When I enter some characters in html project, the old emoji characters appear even though the characters are new in app.CreateList.
How can I set the emoji font file that is preinstalled in DroidScript?
Thank you.

Alan Hendry

unread,
Jul 2, 2022, 10:13:30 AM7/2/22
to DroidScript
HI,
Sorry, I don't really understand what you are trying to do, or what isn't right.
Could you post some code (or at least snippets of code), what you expect to see, and what it actually shows?
Regards, ah

Serhei Scrabin

unread,
Jul 3, 2022, 2:16:46 AM7/3/22
to DroidScript
in HTML - emoji are alone, in app.CreateList - others (but not all)

суббота, 2 июля 2022 г. в 17:13:30 UTC+3, hendr...@gmail.com:

Right2TheV0id

unread,
Jul 3, 2022, 9:07:38 AM7/3/22
to DroidScript
I'm not certain, but I guess Serhei means that displaying an html entity emoji in a webview and the same entity in a DroidScript control produces different emojis.
I've run this code on BlueStacks 5 (android 7.1.2) and on my OnePlus Nord 2 (android 11):
  1. function OnStart() {
  2.     lay = app.CreateLayout( "Linear", "FillXY,VCenter,Left" );
  3.     txt = app.AddText( lay, "DS v" + app.GetDSVersion() + " - API v" + app.GetOSVersion() );
  4.     lst = app.AddList( lay, "DS.List^c^ 😜", -1, -1, "HTML" );
  5.     web = app.AddWebView( lay );
  6.     web.LoadHtml( "Webview: 😜" );
  7.     app.AddLayout( lay );
  8. }
And it produced different results.
Serhei is this your issue?

emoji25.png                       emoji30.png

Alan Hendry

unread,
Jul 3, 2022, 12:31:49 PM7/3/22
to DroidScript
HI,
API 25 seems to be Nougat, and API 30 Android 11, so I presume bluestacks is on the left.
User reported problem with Android 9 (Pie) API 28.
My Chromebook shows DS 2.5 API 28, DS List and Webview both show winking smiley faces.
Nokia 1.3 - DS 2.5 API 27 - two winking smileys 
In DS you could try lst.SetFontFile("/Sys/fonts/fontawesome-webfont.ttf") 
If you have Premium then there are fonts on /Sys/fonts/mui for Bold.ttf, Icon.ttf, Light.ttf, Medium.ttf, Regular.ttf, Thin.ttf
Beyond that you could download an emoji font 
Regards, ah

Serhei Scrabin

unread,
Jul 3, 2022, 3:06:13 PM7/3/22
to DroidScript
Yes, that's my problem.
 I think the new emoji app.CreateList is coming from a font that is already pre-installed in DroidScript.  Where is he located?  The Internet is, but it is very large - 10mb.

воскресенье, 3 июля 2022 г. в 16:07:38 UTC+3, Right2TheV0id:

Right2TheV0id

unread,
Jul 3, 2022, 6:33:54 PM7/3/22
to DroidScript
ah you guessed well, BlueStacks is on the left and the OnePlus Nord 2 is on the right.
Serhei DroidScript don't seem to "pre-install" any font for this specific case.
It certainly uses android default fonts, explaining why the results differs on different devices.
I found this image that illustrates the evolution of a specific smiley depending on the year and the device family:

Using fontawesome or material design fonts doesn't chage anything.
What worked on BlueStacks was to download NotoColorEmoji.ttf from this source:

Put it in your project's Misc folder then use it like this:
  • lst.SetFontFile( "Misc/NotoColorEmoji.ttf" );
It works, but it will add 9MB to the size of your app...

Serhei Scrabin

unread,
Jul 5, 2022, 2:18:42 AM7/5/22
to DroidScript
Thanks

понедельник, 4 июля 2022 г. в 01:33:54 UTC+3, Right2TheV0id:

Serhei Scrabin

unread,
Jul 5, 2022, 2:43:42 AM7/5/22
to DroidScript
Where does DroidScript get the emoji font from (new in app.CreateList)?

вторник, 5 июля 2022 г. в 09:18:42 UTC+3, Serhei Scrabin:
Reply all
Reply to author
Forward
0 new messages