Emojis work in StringGadget + List but not in EditorGadget
- marcoagpinto
- Addict
- Posts: 940
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Emojis work in StringGadget + List but not in EditorGadget
Emojis > 65535 work in StringGadget and ListIconGadget but not in EditorGadget.
I know that PB had a limitation of Emoji up to ASCII 65535.
But, if I paste one of them into a StringGadget or ListIconGadget, it shows okay.
But in an EditorGadget, I get a corrupted character.
Is it fixable in the next beta?
Thank you!
I know that PB had a limitation of Emoji up to ASCII 65535.
But, if I paste one of them into a StringGadget or ListIconGadget, it shows okay.
But in an EditorGadget, I get a corrupted character.
Is it fixable in the next beta?
Thank you!
Re: Emojis work in StringGadget + List but not in EditorGadg
You are correct, but please add an example code.
For example, here the different h's:
Which font supports the emoji characters?
For example, here the different h's:
Code: Select all
Procedure.s UnicodeChr(Number.i)
Protected Buffer.l
If Number <= $FFFF
ProcedureReturn Chr(Number)
Else
Buffer = (Number&$3FF)<<16 | (Number-$10000)>>10 | $DC00D800
ProcedureReturn PeekS(@Buffer, 2, #PB_Unicode)
EndIf
EndProcedure
Enumeration
#Window
#StringGadget
#ListIconGadget
#EditorGadget
#ButtonGadget
#Font
EndEnumeration
LoadFont(#Font, "Cambria", 16)
Define Text.s = "H"+UnicodeChr($1D4D7)+"ℍ"+UnicodeChr($1D573)
OpenWindow(#Window, 0, 0, 330, 160, "WindowTitle", #PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
SetGadgetFont(#PB_Default, FontID(#Font))
StringGadget(#StringGadget, 10, 10, 150, 30, Text)
ListIconGadget(#ListIconGadget, 10, 50, 150, 100, "", 100)
AddGadgetItem(#ListIconGadget, -1, Text)
EditorGadget(#EditorGadget, 170, 10, 150, 100)
SetGadgetText(#EditorGadget, Text)
ButtonGadget(#ButtonGadget, 170, 120, 150, 30, Text)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
- marcoagpinto
- Addict
- Posts: 940
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: Emojis work in StringGadget + List but not in EditorGadg
@Stargate:
You can test it with the Emoji from LibreOffice:
using the GB speller.
Just copy it from the document and paste in a StringGadget or ListIconGadget and it appears correct.
If you paste it into an EditorGadget you get no character.
Code: Select all
t=LoadFont(1,"Arial",10,#PB_Font_HighQuality) ;Load Arial Font, Size 10 - 6/FEB/2014 + High Quality 8/FEB/2014
If t=#False : MessageRequester("Error", "Can't load Arial font.",#PB_MessageRequester_Error) : EndIf
SetGadgetFont(#PB_Default,FontID(1))
using the GB speller.
Just copy it from the document and paste in a StringGadget or ListIconGadget and it appears correct.
If you paste it into an EditorGadget you get no character.
- marcoagpinto
- Addict
- Posts: 940
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: Emojis work in StringGadget + List but not in EditorGadg
The warning sign is chr(9888).
I have just tested your code and it only gets corrupted in the EditorGadget.
EDIT: "in the EditorGadget"
I have just tested your code and it only gets corrupted in the EditorGadget.
EDIT: "in the EditorGadget"
Re: Emojis work in StringGadget + List but not in EditorGadg
Arial does not support these characters!
One font that supports the emoji is "Segoe UI Symbol".
Here the emojis work, but not the h's:
One font that supports the emoji is "Segoe UI Symbol".
Here the emojis work, but not the h's:
Code: Select all
Procedure.s UnicodeChr(Number.i)
Protected Buffer.l
If Number <= $FFFF
ProcedureReturn Chr(Number)
Else
Buffer = (Number&$3FF)<<16 | (Number-$10000)>>10 | $DC00D800
ProcedureReturn PeekS(@Buffer, 2, #PB_Unicode)
EndIf
EndProcedure
Enumeration
#Window
#StringGadget
#ListIconGadget
#EditorGadget
#ButtonGadget
#Font
EndEnumeration
LoadFont(#Font, "Segoe UI Symbol", 16)
Define Text.s = UnicodeChr($1F603)+UnicodeChr(9888)+UnicodeChr($1F61E)+"H"+UnicodeChr($1D4D7)+"ℍ"+UnicodeChr($1D573)
OpenWindow(#Window, 0, 0, 330, 160, "WindowTitle", #PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
SetGadgetFont(#PB_Default, FontID(#Font))
StringGadget(#StringGadget, 10, 10, 150, 30, Text)
ListIconGadget(#ListIconGadget, 10, 50, 150, 100, "", 150)
AddGadgetItem(#ListIconGadget, -1, Text)
EditorGadget(#EditorGadget, 170, 10, 150, 100)
SetGadgetText(#EditorGadget, Text)
ButtonGadget(#ButtonGadget, 170, 120, 150, 30, Text)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
- marcoagpinto
- Addict
- Posts: 940
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: Emojis work in StringGadget + List but not in EditorGadg
Arial DOES seem to work.STARGÅTE wrote:Arial does not support these characters!
One font that supports the emoji is "Segoe UI Symbol".
Try your first code with:
Code: Select all
LoadFont(#Font, "Arial", 16)
Define Text.s = Chr(9888)
Re: Emojis work in StringGadget + List but not in EditorGadg
Try. Work's on editor as well.
LoadFont(#Font, "Segoe UI Symbol", 16)
Define Text.s = Chr($26A0)
debug Chr($26A0
LoadFont(#Font, "Segoe UI Symbol", 16)
Define Text.s = Chr($26A0)
debug Chr($26A0
- marcoagpinto
- Addict
- Posts: 940
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: Emojis work in StringGadget + List but not in EditorGadg
Ahhhh... I forgot to mention this: the original idea was to have normal text with some emojis, so, using the font you suggested doesn't work in my case.dcr3 wrote:Try. Work's on editor as well.
LoadFont(#Font, "Segoe UI Symbol", 16)
Define Text.s = Chr($26A0)
debug Chr($26A0
For example: in the GB speller page of Mozilla I have the warning emoji twice and I works with a normal font, so I wanted to be able to use it also in PB.
Re: Emojis work in StringGadget + List but not in EditorGadg
PB Gadgets supports only one font for the whole text.
So you cant insert styled text (multiple fonts).
You have to decide for one font which supports the character you want.
So you cant insert styled text (multiple fonts).
You have to decide for one font which supports the character you want.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
- marcoagpinto
- Addict
- Posts: 940
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: Emojis work in StringGadget + List but not in EditorGadg
Hello!STARGÅTE wrote:PB Gadgets supports only one font for the whole text.
So you cant insert styled text (multiple fonts).
You have to decide for one font which supports the character you want.
See:
https://addons.mozilla.org/en-US/firefo ... ctionary-2
It is only one font in the description, right?
I copied and pasted into a .txt document and the warning signs appear well.
Scroll down in Mozilla to:
Code: Select all
To make sure the words I add are the correct ones, I have been looking for them in credible sources:
1) Oxford Dictionaries;
2) Collins Dictionary;
3) Macmillan Dictionary;
4) Wiktionary (used with caution ⚠);
5) Wikipedia (used with caution ⚠);
6) Physical dictionaries.
I don't know more what to say...
Re: Emojis work in StringGadget + List but not in EditorGadg
It seems that using a newer version of the rich edit is a solution.
On Windows 10, the emojis are displayed normally.
But it's not working on Windows 7. An appropriate font is needed.
In addition to the edit version, it seems to support the emojis very poorly on Windows 7.
On Windows 10, the emojis are displayed normally.
But it's not working on Windows 7. An appropriate font is needed.
In addition to the edit version, it seems to support the emojis very poorly on Windows 7.
Code: Select all
Procedure.s UnicodeChr(Number.i)
Protected Buffer.l
If Number <= $FFFF
ProcedureReturn Chr(Number)
Else
Buffer = (Number&$3FF)<<16 | (Number-$10000)>>10 | $DC00D800
ProcedureReturn PeekS(@Buffer, 2, #PB_Unicode)
EndIf
EndProcedure
Enumeration
#Window
#StringGadget
#ListIconGadget
#EditorGadget
#ButtonGadget
#Font
EndEnumeration
Procedure CreateRichEdit(ParentID, x, y, w, h)
OpenLibrary(0, "MSFTEDIT.dll")
;OpenLibrary(1,"riched32.dll")
ProcedureReturn CreateWindowEx_(#WS_EX_CLIENTEDGE, "RichEdit50W", 0, #WS_CHILD | #WS_VISIBLE | #ES_MULTILINE | #WS_VSCROLL | #ES_AUTOVSCROLL, x, y, w, h, ParentID, 0, 0, 0)
EndProcedure
Procedure DestroyRichEdit(hRichEdit)
DestroyWindow_(hRichEdit)
CloseLibrary(0)
;CloseLibrary(1)
EndProcedure
LoadFont(#Font, "Arial", 16)
Define Text.s = "H"+UnicodeChr($1D4D7)+"ℍ"+UnicodeChr($1D573) + Chr($26A0)
OpenWindow(#Window, 0, 0, 330, 160, "WindowTitle", #PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
SetGadgetFont(#PB_Default, FontID(#Font))
StringGadget(#StringGadget, 10, 10, 150, 30, Text)
ListIconGadget(#ListIconGadget, 10, 50, 150, 100, "", 100)
AddGadgetItem(#ListIconGadget, -1, Text)
hRichEdit = CreateRichEdit(WindowID(#Window), 170, 10, 150, 100)
SendMessage_(hRichEdit, #WM_SETFONT, FontID(#font), 1)
SetWindowText_(hRichEdit, Text)
ButtonGadget(#ButtonGadget, 170, 120, 150, 30, Text)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
DestroyRichEdit(hRichEdit)
Re: Emojis work in StringGadget + List but not in EditorGadg
No it isn't!marcoagpinto wrote: It is only one font in the description, right?
When you analyze the page (the description part) you can read:
So the two ⚠ are loaded from the Segoe UI Symbol font.Rendered Fonts wrote: Fira Sans—Network resource(5005 glyphs)
Segoe UI Symbol—Local file(2 glyphs)
It is the same here in the forum:
You can see the ⚠ in your posted code section, but the fonts are:
Rendered Fonts wrote: Trebuchet MS—Local file(429 glyphs)
Courier New—Local file(225 glyphs)
Segoe UI Symbol—Local file(2 glyphs)
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module