Page 1 of 2
using icons in Livecode
Posted: Thu Apr 16, 2020 9:22 pm
by glenn9
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
Re: using icons in Livecode
Posted: Thu Apr 16, 2020 9:28 pm
by richmond62
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.
Re: using icons in Livecode
Posted: Thu Apr 16, 2020 10:01 pm
by glenn9
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
Re: using icons in Livecode
Posted: Thu Apr 16, 2020 10:06 pm
by bogs
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.

- Me-segoe you-segoe...
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
Posted: Thu Apr 16, 2020 10:36 pm
by glenn9
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
Re: using icons in Livecode
Posted: Thu Apr 16, 2020 10:54 pm
by bogs
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

Re: using icons in Livecode
Posted: Fri Apr 17, 2020 8:51 am
by richmond62
bogs wrote: ↑Thu Apr 16, 2020 10:54 pm
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
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:
-

- Screenshot 2020-04-17 at 10.49.45.png (9 KiB) Viewed 8261 times
Re: using icons in Livecode
Posted: Fri Apr 17, 2020 10:01 am
by jmburnod
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
Re: using icons in Livecode
Posted: Fri Apr 17, 2020 10:23 am
by bogs
richmond62 wrote: ↑Fri Apr 17, 2020 8:51 am
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),
Glenn, please forgive my ignorance hee hee

Re: using icons in Livecode
Posted: Sat Apr 18, 2020 3:41 pm
by glenn9
richmond62 wrote: ↑Fri Apr 17, 2020 8:51 am
bogs wrote: ↑Thu Apr 16, 2020 10:54 pm
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
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:
-
Screenshot 2020-04-17 at 10.49.45.png
Thank you, that's really helpful to know.
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
Posted: Sat Apr 18, 2020 3:42 pm
by glenn9
bogs wrote: ↑Fri Apr 17, 2020 10:23 am
richmond62 wrote: ↑Fri Apr 17, 2020 8:51 am
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),
Glenn, please forgive my ignorance hee hee
My ignorance is much greater though - as I'm finding out!!
Re: using icons in Livecode
Posted: Sun Apr 19, 2020 11:12 am
by richmond62
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.
Re: using icons in Livecode
Posted: Sun Apr 19, 2020 12:06 pm
by richmond62
-
Stack removed as better version uploaded.
Re: using icons in Livecode
Posted: Mon Apr 20, 2020 7:47 am
by glenn9
richmond62 wrote: ↑Sun Apr 19, 2020 12:06 pm
Screenshot 2020-04-19 at 14.05.03.png
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
Re: using icons in Livecode
Posted: Mon Apr 20, 2020 8:17 am
by richmond62
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.