emojis in webgadget showing without colors
emojis in webgadget showing without colors
Hi,
Following this:
https://www.w3schools.com/charsets/ref_emoji.asp
If i put the code inside a string
HTML$ = "about:<span style='font-size:100px;'>🦁</span><p>i will display 🦁</p><p>i will display 🦁</p>"
and the load it in the webgadget, the emoji shows in black and white, no colors.
Anybody can help?
I need to load fro a string becuse im polanning to create the html with my code, im not trying to load the w3school.com pge
Thanks in advance
Following this:
https://www.w3schools.com/charsets/ref_emoji.asp
If i put the code inside a string
HTML$ = "about:<span style='font-size:100px;'>🦁</span><p>i will display 🦁</p><p>i will display 🦁</p>"
and the load it in the webgadget, the emoji shows in black and white, no colors.
Anybody can help?
I need to load fro a string becuse im polanning to create the html with my code, im not trying to load the w3school.com pge
Thanks in advance
ARGENTINA WORLD CHAMPION
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: emojis in webgadget showing without colors
Hi ricardo
...the emojis are displayed in black and white on the w3schools site too when viewed on my PC - they are font based and so they won't be shown in colour unless the host (your PC) already has a colour version of the font installed.
See: http://classic.getemoji.com
Edit: Different platforms, different results: https://emojipedia.org/smiling-face-with-smiling-eyes
...the emojis are displayed in black and white on the w3schools site too when viewed on my PC - they are font based and so they won't be shown in colour unless the host (your PC) already has a colour version of the font installed.
See: http://classic.getemoji.com
Edit: Different platforms, different results: https://emojipedia.org/smiling-face-with-smiling-eyes
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: emojis in webgadget showing without colors
Works here:
The key is using the "Segoe UI Emoji" font (part of a default Windows 10 installation - not sure about earlier versions).
Code: Select all
OpenWindow(1, 0, 0, 822, 450, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu )
coloremoji$ = "<body><center><font style='font-family:segoe ui emoji;font-size:188pt'>🦁</font></body>"
WebGadget (10, 0, 0, 822, 450, "about:" + coloremoji$)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: emojis in webgadget showing without colors
If consistency is required, you either have to deliver the coloured font with your program or use images instead.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: emojis in webgadget showing without colors
Anybody see this in black and white??IdeasVacuum wrote: See: http://classic.getemoji.com
ARGENTINA WORLD CHAMPION
Re: emojis in webgadget showing without colors
Great!! Thanks !!firace wrote:Works here:
The key is using the "Segoe UI Emoji" font (part of a default Windows 10 installation - not sure about earlier versions).Code: Select all
OpenWindow(1, 0, 0, 822, 450, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu ) coloremoji$ = "<body><center><font style='font-family:segoe ui emoji;font-size:188pt'>🦁</font></body>" WebGadget (10, 0, 0, 822, 450, "about:" + coloremoji$) Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
ARGENTINA WORLD CHAMPION
-
- Addict
- Posts: 4780
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: emojis in webgadget showing without colors
Hi, I stumbled across this old thread.
Very interesting, and thanks once more to firace for instructive code!
What I want to do is, showing the glyph of a red heart.
It works fine here with firace's above code (PB 6.20 on Windows 11):
However, I actually want to show the red heart as part of a string in a textgadget.
I believed the following code should do it, because the font “Segoe UI Emoji” does contain the colored glyph.
So why does this code show a black heart, rather than a red one?
Very interesting, and thanks once more to firace for instructive code!
What I want to do is, showing the glyph of a red heart.
It works fine here with firace's above code (PB 6.20 on Windows 11):
Code: Select all
OpenWindow(1, 0, 0, 822, 450, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu )
coloremoji$ = "<body><center><font style='font-family:segoe ui emoji;font-size:188pt'>❤️</font></body>"
WebGadget (10, 0, 0, 822, 450, "about:" + coloremoji$)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
However, I actually want to show the red heart as part of a string in a textgadget.
I believed the following code should do it, because the font “Segoe UI Emoji” does contain the colored glyph.
So why does this code show a black heart, rather than a red one?
Code: Select all
Define font$
If OpenWindow(0, 100, 100, 150, 100, "Heart") = 0
MessageRequester("Fatal error", "Can't open main window.", #PB_MessageRequester_Error)
End
EndIf
font$ = "Segoe UI Emoji"
If LoadFont(0, font$, 9)
SetGadgetFont(#PB_Default, FontID(0))
Else
Debug "Can't load font: " + font$
EndIf
TextGadget (0, 15, 10, 120, 20, "Made with " + Chr($2764) + Chr($FE0F))
StringGadget(1, 10, 40, 120, 20, "Made with " + Chr($2764) + Chr($FE0F))
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
Re: emojis in webgadget showing without colors
@Little John
The common controls in Windows don't support emoji colors, regardless of font, because the GDI string output functions don't support them. As far as I know, to output the colors of emoji characters, you have to draw a string using DirectWrite.
For example:
https://gist.github.com/nickav/ed3428fb ... 88956a7b22
The common controls in Windows don't support emoji colors, regardless of font, because the GDI string output functions don't support them. As far as I know, to output the colors of emoji characters, you have to draw a string using DirectWrite.
For example:
https://gist.github.com/nickav/ed3428fb ... 88956a7b22
-
- Addict
- Posts: 4780
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: emojis in webgadget showing without colors
@breeze4me:
I see. Many thanks for the information!
I see. Many thanks for the information!