using icons in Livecode
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
using icons in Livecode
Hi Everyone,
I guess this is a long shot as its fairly niche, but I was wondering if anyone had any experience in making use of Segoe MDL2 icons in Livecode that they could share? https://docs.microsoft.com/en-us/window ... d-articles
I've been trying to figure out how to use them in livecode as icons but no success so far, even though Segoe MDL2 is listed as a font in Livecode.
i've tried pasting individual icons into the 'content' of a button but this doesn't work as expected or very well.
I can't see a way of entering the icons via the keyboard, even though they have been designed as a font.
Grateful for any hints or tips!
Kind regards,
Glenn
I guess this is a long shot as its fairly niche, but I was wondering if anyone had any experience in making use of Segoe MDL2 icons in Livecode that they could share? https://docs.microsoft.com/en-us/window ... d-articles
I've been trying to figure out how to use them in livecode as icons but no success so far, even though Segoe MDL2 is listed as a font in Livecode.
i've tried pasting individual icons into the 'content' of a button but this doesn't work as expected or very well.
I can't see a way of entering the icons via the keyboard, even though they have been designed as a font.
Grateful for any hints or tips!
Kind regards,
Glenn
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: using icons in Livecode
You could do this in a very simple way.
Use the font to make JPG or PNG images of individual glyphs and then put them through an icon-making app.
Use the font to make JPG or PNG images of individual glyphs and then put them through an icon-making app.
Re: using icons in Livecode
Thanks for the tip, I'll give this a try.
I'm assuming that its not going to be possible to use the font as an 'icon' but this may be a good workaround.
Kind regards,
Glenn
I'm assuming that its not going to be possible to use the font as an 'icon' but this may be a good workaround.
Kind regards,
Glenn
Re: using icons in Livecode
Heya Glenn,
I don't have that font installed on any of my machines, however hopefully this will match what you want to do closely enough. So, if you haven't already guessed how I did this
Open the windows Character Map utility (type Chara... into the search box)
Find the font you need the character from
Select / copy it in the char map util.
Go to the button (or whatevers) label property in the inspector
Use either the edit menu on the menubar, or ctrl + v to paste what you copied into the label
....?....
PROFIT!!
I don't have that font installed on any of my machines, however hopefully this will match what you want to do closely enough. So, if you haven't already guessed how I did this

Open the windows Character Map utility (type Chara... into the search box)
Find the font you need the character from
Select / copy it in the char map util.
Go to the button (or whatevers) label property in the inspector
Use either the edit menu on the menubar, or ctrl + v to paste what you copied into the label
....?....
PROFIT!!

Re: using icons in Livecode
Thank you so much, that worked brilliantly!
I hadn't appreciated that the character map worked outside of MS word or to use 'label' instead of 'content'!
Thank you again,
Kind regards,
Glenn
I hadn't appreciated that the character map worked outside of MS word or to use 'label' instead of 'content'!
Thank you again,
Kind regards,
Glenn
Re: using icons in Livecode
I'm glad it helped, I should add there are a few other ways to do this. For instance, set the buttons 'font' to (whatever), and (in code) set the label of button xyz to numToChar(number of the character).
All roads lead to Rome after all
All roads lead to Rome after all


-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: using icons in Livecode
A word of warning . . .
. . . if you set the label of your button to a glyph reference be careful to use numToCodePoint and NOT numToChar (deprecated some way back),
and, also, be aware that to get that effect if you run off a standalone you must make sure end-users have the font installed on their systems.
To get round this problem . . .
position your glyph from your font slap-bag-central in a field, import a snapshot of the field and use that as your button:
-
Re: using icons in Livecode
Hi,
You may import a snapshot from a group.
I use this to create/modify icons collection.
One group for icon, one group for iconhilte (or others) with relevant names (grOpen,grOpenHi etc...)
It is easy to modify whole collection with onlyone script
Best regards
Jean-Marc
You may import a snapshot from a group.
I use this to create/modify icons collection.
One group for icon, one group for iconhilte (or others) with relevant names (grOpen,grOpenHi etc...)
It is easy to modify whole collection with onlyone script
Best regards
Jean-Marc
https://alternatic.ch
Re: using icons in Livecode
Glenn, please forgive my ignorance hee heerichmond62 wrote: ↑Fri Apr 17, 2020 8:51 amA word of warning . . .
. . . if you set the label of your button to a glyph reference be careful to use numToCodePoint and NOT numToChar (deprecated some way back),


Re: using icons in Livecode
Thank you, that's really helpful to know.richmond62 wrote: ↑Fri Apr 17, 2020 8:51 amA word of warning . . .
. . . if you set the label of your button to a glyph reference be careful to use numToCodePoint and NOT numToChar (deprecated some way back),
and, also, be aware that to get that effect if you run off a standalone you must make sure end-users have the font installed on their systems.
To get round this problem . . .
position your glyph from your font slap-bag-central in a field, import a snapshot of the field and use that as your button:
-
Screenshot 2020-04-17 at 10.49.45.png
Indeed, before I'd read your post I tried the icons on mobile, where the font is not installed of course, and I got unexpected looking icons!!!
Kind regards,
Glenn
Re: using icons in Livecode
My ignorance is much greater though - as I'm finding out!!bogs wrote: ↑Fri Apr 17, 2020 10:23 amGlenn, please forgive my ignorance hee heerichmond62 wrote: ↑Fri Apr 17, 2020 8:51 amA word of warning . . .
. . . if you set the label of your button to a glyph reference be careful to use numToCodePoint and NOT numToChar (deprecated some way back),![]()
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: using icons in Livecode
By the way: having "had a poke" at Microsoft's "Segoe MDL2" font
I found that the glyphs are contained in the Unicode Private Use Area
so if you are planning to use it as a font inwith something you are intending to
distribute you are going to be seriously "in the sh*t" if you do not distribute the font
along with your work.
Glyphs in the Unicode Private Use Area can be any old thing anyone wants, so there
is no standardisation, nothing; and if you fail to provide the font along with a stack/standalone that
leverages a font that contains glyphs in the Unicode Private Use Area you cannot expect
anything like adequate substitution.
Also be aware of the weasel licence re the Segoe MDL2 font:
"You may use the Segoe MDL2 Assets and Segoe UI fonts or glyphs included in this file (“Software”) solely to design,
develop and test your programs that run on a Microsoft Platform"
emphasis mine.
Having said that, you can download the fonts onto any old computer running any old system . . . your morality may vary.
Personally I'd just use one of the vast number of Open Source and/or free symbol fonts available on the interweb: anything to avoid
crawling into bed with something involving restrictions.
I found that the glyphs are contained in the Unicode Private Use Area
so if you are planning to use it as a font inwith something you are intending to
distribute you are going to be seriously "in the sh*t" if you do not distribute the font
along with your work.
Glyphs in the Unicode Private Use Area can be any old thing anyone wants, so there
is no standardisation, nothing; and if you fail to provide the font along with a stack/standalone that
leverages a font that contains glyphs in the Unicode Private Use Area you cannot expect
anything like adequate substitution.
Also be aware of the weasel licence re the Segoe MDL2 font:
"You may use the Segoe MDL2 Assets and Segoe UI fonts or glyphs included in this file (“Software”) solely to design,
develop and test your programs that run on a Microsoft Platform"
emphasis mine.
Having said that, you can download the fonts onto any old computer running any old system . . . your morality may vary.

Personally I'd just use one of the vast number of Open Source and/or free symbol fonts available on the interweb: anything to avoid
crawling into bed with something involving restrictions.
Last edited by richmond62 on Sun Apr 19, 2020 12:31 pm, edited 1 time in total.
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: using icons in Livecode
Stack removed as better version uploaded.
Last edited by richmond62 on Mon Apr 20, 2020 9:54 am, edited 1 time in total.
Re: using icons in Livecode
Thanks for this advice Richmond62, have now abandoned the concept of using Segoe MDL2 fonts for icons!
Have just downloaded 'Pimp My Button' - not sure exactly what it does at the moment but I'll experiment...!
Thanks again,
Kind regards,
Glenn
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: using icons in Livecode
Enter the Unicode address of the glyph that you want via either the DECIMAL or the HEXADECIMAL button,
then set the colours of the border, the background and the character for your new button and click
EXPORT BUTTON and you will end up with an image you can use as a button that is NOT font dependent.
then set the colours of the border, the background and the character for your new button and click
EXPORT BUTTON and you will end up with an image you can use as a button that is NOT font dependent.