It is currently April 25th, 2024, 1:15 pm

Fudging problems with inline character variables

Get help with creating, editing & fixing problems with skins
User avatar
raiguard
Posts: 660
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Fudging problems with inline character variables

Post by raiguard »

I am experimenting with character variables in the Rainmeter 4.1 beta, and have come across a problem with displaying different fonts in a single string. I am using Google's Material Icons and Google's Roboto in a test skin. As you can clearly see, using the different fonts in a single line will result in an unavoidable "fudging" of the Roboto text to be below the Material Icons.

I assume this either has to do with the Direct2D vs. GDI+ fudging that jsmorley talked about a while back when introducing the FontWeight option, or with the Material Icons font itself being wonky. But is there a way to work around this without creating two separate strings?
2017-09-24 22_43_48-.png
You do not have the required permissions to view the files attached to this post.
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
Brian
Developer
Posts: 2681
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Fudging problems with inline character variables

Post by Brian »

Unfortunately there is no vertical adjustment available within a string at this point, so your best option is to use separate string meters. This issue came up recently.

The only way this would work with 1 string meter is if you found 2 fonts (or 1 font with icons and text) that used matching baselines.

-Brian
User avatar
raiguard
Posts: 660
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: Fudging problems with inline character variables

Post by raiguard »

Brian wrote:Unfortunately there is no vertical adjustment available within a string at this point, so your best option is to use separate string meters. This issue came up recently.

The only way this would work with 1 string meter is if you found 2 fonts (or 1 font with icons and text) that used matching baselines.

-Brian
That’s unfortunate. It won’t matter much for checkboxes, but I was really hoping to use it for the up/down arrows in ModernGadgets. Disks Meter has 104 separate meters for the up/down arrows and the text to go with them. If this had worked, I could have reduced that number to 52. :(
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fudging problems with inline character variables

Post by jsmorley »

raiguard wrote:That’s unfortunate. It won’t matter much for checkboxes, but I was really hoping to use it for the up/down arrows in ModernGadgets. Disks Meter has 104 separate meters for the up/down arrows and the text to go with them. If this had worked, I could have reduced that number to 52. :(
You might want to look at FontAwesome instead of Google Material Icons. I think there is a better match on the baselines with Roboto.

Download site: http://fontawesome.io
Reference site: http://fontawesome.io/cheatsheet/

Code: Select all

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

[Variables]

[MeterString]
Meter=String
FontFace=Roboto
FontSize=13
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1
InlineSetting=Face | FontAwesome
InlinePattern=[\xf046]
Text=Hello World  [\xf046]
1.png
You do not have the required permissions to view the files attached to this post.
User avatar
raiguard
Posts: 660
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: Fudging problems with inline character variables

Post by raiguard »

jsmorley wrote:You might want to look at FontAwesome instead of Google Material Icons. I think there is a better match on the baselines with Roboto.

Download site: http://fontawesome.io
Reference site: http://fontawesome.io/cheatsheet/

Code: Select all

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

[Variables]

[MeterString]
Meter=String
FontFace=Roboto
FontSize=13
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1
InlineSetting=Face | FontAwesome
InlinePattern=[\xf046]
Text=Hello World  [\xf046]
1.png
I think it’s ironic that Google’s in-house font and in-house character font don’t have matching baselines. That seems like a huge oversight.

I’ll give FontAwesome a try and see if it works out better.
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
raiguard
Posts: 660
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: Fudging problems with inline character variables

Post by raiguard »

So I tried fontawesome, and although the chevrons were still pretty wonky, I found a neat alternative for the up/down arrows. I think I'm gonna stick with Material's checkboxes, but I'll definitely be using FA for the arrows. Thanks! :thumbup:
2017-09-25 21_08_06-.png
EDIT: Here's the new arrows in Disks Meter against the old ones. With this I can eliminate 78 meters from the skin, 52 of which were images! :o
2017-09-25 21_11_56-.png
You do not have the required permissions to view the files attached to this post.
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fudging problems with inline character variables

Post by jsmorley »

Great.