It is currently April 23rd, 2024, 7:53 pm

UniCode symbol

Get help with creating, editing & fixing problems with skins
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

UniCode symbol

Post by JamX »

Hi,

I want to use Unicode U+1F4C5 inside my skin.

When I insert this in the code I only see the "U+1F4C5" and not the calendar icon

Code: Select all

Text=[\x1f4c5]
Anybody knows how to do this?
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: UniCode symbol

Post by jsmorley »

JamX wrote: October 23rd, 2019, 11:19 am Hi,

I want to use Unicode U+1F4C5 inside my skin.

When I insert this in the code I only see the "U+1F4C5" and not the calendar icon

Code: Select all

Text=[\x1f4c5]
Anybody knows how to do this?
You can't. That symbol is outside the Basic Multilingual Plane in Unicode, which are the characters from hex x0-xFFFE or decimal 0-65536.

You will need to look at using one of the "icon fonts" as described in the documentation.

https://docs.rainmeter.net/manual/variables/character-variables/

Or use an image file, or convert a vector .svg to a Shape meter.

Code: Select all

[FontAwesome]40 calendar[/FontAwesome]
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: UniCode symbol

Post by JamX »

I need to put this code inside the text=[ ]? Or how to code?
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: UniCode symbol

Post by jsmorley »

What you have to do is:

1) Go to this site and download the FontAwesome font for the desktop

https://fontawesome.com/how-to-use/on-the-desktop/setup/getting-started

2) Extract the .zip archive you will get, and in it you will find a folder:

..fontawesome-free-5.11.2-desktop\otfs

And in that folder will be the following files:

Font Awesome 5 Brands-Regular-400.otf
Font Awesome 5 Free-Regular-400.otf
Font Awesome 5 Free-Solid-900.otf

I think for the most part you will just want the Font Awesome 5 Free-Regular-400.otf version.

3) Copy that file, or all of the .otf files, into the @Resources\Fonts folder of your skin. You will need to create @Resources and @Resources\Fonts in the root config folder of your skin if it doesn't already exist.

4) Go to the following site, and search for and find the icon you want to use:

https://fontawesome.com/icons?d=gallery

Note that icons marked "Pro" won't work. You only want to use the free ones.


1.jpg


5) Then in your skin:

Code: Select all

[MeterOne]
Meter=String
InlineSetting=Face | Font Awesome 5 Free
InlinePattern=[\xf073]
FontSize=40
FontWeight=400
FontColor=45,255,7,255
AntiAlias=1
Text=Calendar image: [\xf073]

2.jpg


Use InlineSetting=Face | Font Awesome 5 Free with InlinePattern=[\xf073] if you intend to mix regular text with the icon(s) in the Text option of the String meter. If you just need the icon(s), you can just use FontFace=Font Awesome 5 Free
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: UniCode symbol

Post by jsmorley »

Extra credit:

With FontAwesome, you can also use the "name" of the character instead of an inline variable with the hex "number" as well. But be a bit careful...

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]

[MeterOne]
Meter=String
InlineSetting=Face | Font Awesome 5 Free
InlinePattern=calendar-alt
FontSize=40
FontWeight=400
FontColor=45,255,7,255
AntiAlias=1
Text=Calendar image: calendar-alt

[MeterTwo]
Meter=String
Y=5R
FontFace=Font Awesome 5 Free
FontSize=40
FontWeight=400
FontColor=45,255,7,255
AntiAlias=1
Text=Calendar image: calendar-alt

2.jpg


Note that in the first String meter, I am constraining which character(s) use the FontAwesome face by using InlineSetting / InlinePattern. That gives me the top part of the image. In the second String meter, I'm just using FontAwesome as the FontFace for everything. The issue here is that both "Calendar" and "image" are valid "names" of characters in the FontAwesome set, so the images are used instead of the text.

Text=Calendar image: calendar-alt gives me the icon for "Calendar", the icon for "image", a ":" and the icon for "calendar-alt". Not what I was looking to do...
You do not have the required permissions to view the files attached to this post.
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: UniCode symbol

Post by JamX »

thx for the explanation
User avatar
balala
Rainmeter Sage
Posts: 16164
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: UniCode symbol

Post by balala »

jsmorley wrote: October 23rd, 2019, 3:36 pm What you have to do is:
Both descriptions are very good and interesting! An extraordinary useful feature. To be saved for later use! :thumbup: