It is currently May 2nd, 2024, 4:57 am

Minimum separation distance and String SolidColors.

Get help with creating, editing & fixing problems with skins
Mrwhitepantz
Posts: 7
Joined: October 26th, 2012, 4:59 am

Minimum separation distance and String SolidColors.

Post by Mrwhitepantz »

Just a couple of quick questions that I'm having a hard time finding answers to.

(Sorry if my vocab is a little off)

1) Is there a minimum distance between skins? I have two of them and want them to snap right next to each other, but there's always a few pixels between them. If there is, what is it? I can compensate for it because the edges of the skin is black, as is the background, but I want an exact distance between where the colors start.

2) Is there a way to set the borders of the SolidColor tag for a String meter? I want a black bar to appear that stretches 1 pixel above and below the text, and 5 pixels from each side. I'm trying to do this inside the String meter so that the bar will always fit those dimensions around the text.

Thanks again!
User avatar
Brian
Developer
Posts: 2689
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Minimum separation distance and String SolidColors.

Post by Brian »

Mrwhitepantz wrote:1) Is there a minimum distance between skins? I have two of them and want them to snap right next to each other, but there's always a few pixels between them. If there is, what is it? I can compensate for it because the edges of the skin is black, as is the background, but I want an exact distance between where the colors start.
The distance is always 0. The reason there may "appear" to be a gap is because of a position problem in your skin, or some transparent part of an image. You can see the difference if you add the following to your skin (in the [Rainmeter] section):

Code: Select all

[Rainmeter]
BackgroundMode=2
SolidColor=255,0,0
This make the background of your skin red. Then if you drag the skin by another skin, it should snap together with no gaps. If you want some help in fixing the positioning/transparent problem in your skin, please post the skin (inside

Code: Select all

 tags).


[quote="Mrwhitepantz"]2) Is there a way to set the borders of the SolidColor tag for a String meter? I want a black bar to appear that stretches 1 pixel above and below the text, and 5 pixels from each side. I'm trying to do this inside the String meter so that the bar will always fit those dimensions around the text.[/quote]
This is going to be next to impossible due to the nature of font metrics. For example, some fonts might be monospaced, meaning each character will use the same amount of pixels (especially the width of the character). However, most fonts are not monospaced, meaning each character might have a different width. There is really no way for Rainmeter to "know" which pixels will be "on" or "off" for each font.

-Brian
Mrwhitepantz
Posts: 7
Joined: October 26th, 2012, 4:59 am

Re: Minimum separation distance and String SolidColors.

Post by Mrwhitepantz »

The distance is always 0. The reason there may "appear" to be a gap is because of a position problem in your skin, or some transparent part of an image. You can see the difference if you add the following to your skin (in the [Rainmeter] section):
It would indeed appear that there is something extending past the edge of [MeterBG], which is my bounding box, by 3 pixels.

Code: Select all

[Rainmeter]
Author=Mrwhitepantz
BackgroundMode=2
SolidColor=255,0,0

[Variables]
TextColor=255,153,0

[MeasureYearMonth]
Measure=Time
Format=%y%m

[MeasureDay]
Measure=Time
Format=%d

[MeasureDayCalc]
Measure=Calc
Formula=MeasureDay / 10

[MeterBG]
Meter=Image
SolidColor=0,0,0
x=0
y=0
W=1366
H=191
;Defines edges, may be a better way.

[MeterBar]
Meter=Image
ImageName=UsernameBG.png
X=10
Y=10

[MeterNameBar]
Meter=Image
SolidColor=0,0,0
X=1111
Y=10
W=205
H=39

[MeterUsername]
Meter=String
X=1110
Y=3
FontColor=#TextColor#
FontFace=LCARS
FontSize=38
Text="ENSIGN REDAC"
AntiAlias=1

[MeterStardateText]
Meter=String
x=212
y=148
StringAlign=RIGHT
FontColor=0,0,0
FontFace=LCARS
FontSize=28
Text="STARDATE"
AntiAlias=1

[MeterDisplayYearMonth]
Meter=String
MeasureName=MeasureYearMonth
x=210
y=148
FontFace=LCARS
FontColor=#TextColor#
FontSize=28
AntiAlias=1

[MeterDisplayDay]
Meter=String
MeasureName=MeasureDayCalc
X=262
Y=148
FontSize=28
FontFace=LCARS
FontColor=#TextColor#
NumOfDecimals=1
AntiAlias=1

[MeterEdge]
Meter=Image
ImageName=Edge.png
x=R
y=-41R
This is going to be next to impossible due to the nature of font metrics. For example, some fonts might be monospaced, meaning each character will use the same amount of pixels (especially the width of the character). However, most fonts are not monospaced, meaning each character might have a different width. There is really no way for Rainmeter to "know" which pixels will be "on" or "off" for each font.
I was afraid of that. Thanks for confirming though!

Editted for clarification/format
Last edited by Mrwhitepantz on October 27th, 2012, 6:51 am, edited 2 times in total.
User avatar
Brian
Developer
Posts: 2689
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Minimum separation distance and String SolidColors.

Post by Brian »

Here is a simple example of monospaced font:
Font.png
The box represents the total size for each character in the font. The line under the "A" represents the baseline.

As you can see, an uppercase "A" takes up nearly the entire space (except below the baseline). However, the lowercase "g" has extra "padding" (called side-bearings) between the character and the edge of the box.

We could make Rainmeter check for any side-bearings on the first and last character in every String meter, however, that would take up a lot of CPU time trying to figure out which pixels are "off" vs which pixels are "on" for each String meter.

-Brian
You do not have the required permissions to view the files attached to this post.
User avatar
Brian
Developer
Posts: 2689
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Minimum separation distance and String SolidColors.

Post by Brian »

Mrwhitepantz wrote:1) It would indeed appear that there is something extending past the edge of [MeterBG], which is my bounding box, by 3 pixels.
Although I am not totally sure (since I don't have your images or fonts), but I think the problem is the Y=148 in your stardate meters. Change them all to Y=144.

-Brian
Mrwhitepantz
Posts: 7
Joined: October 26th, 2012, 4:59 am

Re: Minimum separation distance and String SolidColors.

Post by Mrwhitepantz »

Although I am not totally sure (since I don't have your images or fonts), but I think the problem is the Y=148 in your stardate meters. Change them all to Y=144.

-Brian
That seems to have solved the issue with the protrusion from the bottom, but why is that? Does the string meter have a box around it that is a set height?

When I tried making the SolidColor part of the string meter in the [MeterUsername] it extended a certain distance beyond my text, so I assume the same thing is going on here. What causes this? And can I remove it? My stardate meters are now 13 pixels above the edge of the bounding box I have set, and it would be preferable if they were only 10.
User avatar
Brian
Developer
Posts: 2689
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Minimum separation distance and String SolidColors.

Post by Brian »

Mrwhitepantz wrote:That seems to have solved the issue with the protrusion from the bottom, but why is that? Does the string meter have a box around it that is a set height?
This really goes back to what I have explained about Font Metrics. The larger the font size, the larger the "padding".
Mrwhitepantz wrote:When I tried making the SolidColor part of the string meter in the [MeterUsername] it extended a certain distance beyond my text, so I assume the same thing is going on here. What causes this? And can I remove it? My stardate meters are now 13 pixels above the edge of the bounding box I have set, and it would be preferable if they were only 10.
Try explicitly setting the W AND H of your stardate meters. You need both as Rainmeter ignores H without a W. You could also try using the StringAlign=LeftBottom option (you will also have to adjust your Y option as well). http://rainmeter.net/cms/Meters-String

-Brian
Mrwhitepantz
Posts: 7
Joined: October 26th, 2012, 4:59 am

Re: Minimum separation distance and String SolidColors.

Post by Mrwhitepantz »

Brian wrote: Try explicitly setting the W AND H of your stardate meters. You need both as Rainmeter ignores H without a W.


-Brian
This worked quite well. Thank you for your assistance.

As an aside, should I continue to make new threads when I have other questions, or merely add another post to this one? I am bound to have a few more before I finish this theme, and I don't want inadvertently flood the board, since it seems to move fairly slowly.
User avatar
Brian
Developer
Posts: 2689
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Minimum separation distance and String SolidColors.

Post by Brian »

Mrwhitepantz wrote:As an aside, should I continue to make new threads when I have other questions, or merely add another post to this one? I am bound to have a few more before I finish this theme, and I don't want inadvertently flood the board, since it seems to move fairly slowly.
If the problem is related to this, then post it here. If the problem(s) is a whole new one, then make a new thread.
Mrwhitepantz wrote:This worked quite well. Thank you for your assistance.
Glad it worked out!

-Brian