It is currently April 25th, 2024, 3:40 am

Having trouble with text formatting

Get help with creating, editing & fixing problems with skins
Kakkun
Posts: 3
Joined: February 12th, 2010, 2:02 pm

Having trouble with text formatting

Post by Kakkun »

Code: Select all

[Rainmeter]
DynamicWindowSize=1
;10-Foot HUD (White) - Created by Stephen R Gibson, based on MoxaWeather.

;Metadata added by RainBrowser
;http://rainmeter.net/RainWiki/index.php?title=Rainmeter_101#.5BMetadata.5D

[Metadata]
Name=
Config=
Description=
Instructions=
Version=
Tags=
License=
Variant=
Preview=

;End of added Metadata

[Variables]
;Find your weather code at Weather.com (like UKXX0296 below) and replace the one in this URL.
;To have the temperature display in Farenheit, delete "&unit=m" from the URL.
URL=http://xml.weather.com/weather/local/JAXX0085?cc=&unit=m&dayf=6
Font=groteska

------------------------------------MEASURES-------------------------------------------

[MeasureWeatherRSS]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=3600
Url=#URL#
RegExp="(?siU)<weather ver="(.*)">(.*)<tmp>(.*)</tmp>(.*)<t>(.*)</t>(.*)<icon>(.*)</icon>(.*)<day d="1" t="(.*)" dt="(.*)">(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)<icon>(.*)</icon>(.*)<t>(.*)</t>(.*)<day d="2" t="(.*)" dt="(.*)">(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)<icon>(.*)</icon>(.*)<t>(.*)</t>(.*)<day d="3" t="(.*)" dt="(.*)">(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)<icon>(.*)</icon>(.*)<t>(.*)</t>(.*)"
StringIndex=1

[MeasureWeatherTemp]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWeatherRSS]
StringIndex=3

[MeasureWeatherDesc]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWeatherRSS]
StringIndex=5
Substitute="Fair":"FAIR","Cloudy":"CLOUDY","Showers in the Vicinity":"SHOWERS","Partly":"PARTLY","Mostly":"MOSTLY","Fog":"FOG","Clouds":"CLOUDS","Light":"LIGHT","Rain":"RAIN","Sunny":"SUNNY","Clear":"CLEAR"

[MeterDesc]
MeasureName=MeasureWeatherDesc
Meter=STRING
X=0
Y=0
FontColor=255,255,255
FontSize=100
FontFace=CONSOLAS
StringAlign=LEFT
StringStyle=NORMAL
Antialias=1
StringEffect=SHADOW
FontEffectColor=00000040
I'm trying to mod 10 foot hud to my likings. The code I posted above is working fine. However, I want it aligned to the right by changing StringAlign=RIGHT and X=1000, but the text is disappearing for some reason. The text also disappears when I try StringAlign=LEFT and X=1.
Am I doing something wrong, or is this a bug?
User avatar
kenz0
Developer
Posts: 263
Joined: July 31st, 2009, 2:23 pm
Location: Tokyo, JPN

Re: Having trouble with text formatting

Post by kenz0 »

It seems the bug of DynamicWindowSize or something.
This may be a problem that should be fixed.

If you cannot wait for the fix of the program, you can prevent this trouble by making fixed window width beforehand with other image meter.
For example, add this code to the config.

Code: Select all

[WindowWidth]
Meter=IMAGE
W=1000
H=1
SolidColor=00000000
.
Image
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Having trouble with text formatting

Post by jsmorley »

This feels like some kind of bug to me. I can't quite wrap my head around it.

With your code, I get the same thing. Nothing.

With this:

[MeterDesc]
MeasureName=MeasureWeatherDesc
Meter=STRING
X=1000
Y=0
FontColor=255,255,255
FontSize=100
FontFace=CONSOLAS
StringAlign=RIGHT
StringStyle=NORMAL
Antialias=1
StringEffect=SHADOW
FontEffectColor=00000040
Text=" %1"

It works fine, but for some reason seems to need that "Text=" statement putting some static char of any kind on the meter in addition to the WebParser result, or it won't work. It is also kind of hinky in general. Sometimes it seems to go away and will only work again after I restart Rainmeter.

I think spx or one of the other C++ / GDI+ gurus are going to have to look at this. You (and I) may be missing something here, but it feels like it is not working as expected.
Kakkun
Posts: 3
Joined: February 12th, 2010, 2:02 pm

Re: Having trouble with text formatting

Post by Kakkun »

Yeah, that worked. Thanks for helping out.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Having trouble with text formatting

Post by jsmorley »

kenz0 wrote:It seems the bug of DynamicWindowSize or something.
This may be a problem that should be fixed.

If you cannot wait for the fix of the program, you can prevent this trouble by making fixed window width beforehand with other image meter.
For example, add this code to the config.

Code: Select all

[WindowWidth]
Meter=IMAGE
W=1000
H=1
SolidColor=00000000
It feels like For some reason DynamicWindowSize is not working without the static text in my example or the background image in yours. Since WebParser is returning nothing on the first pass wihen the skin is refreshed, and only pushes the result on the 2nd (or later, depending on how fast the web site is) Update=, at first there is no result, and then when there is, the window size is already "0" and never grows.
User avatar
kenz0
Developer
Posts: 263
Joined: July 31st, 2009, 2:23 pm
Location: Tokyo, JPN

Re: Having trouble with text formatting

Post by kenz0 »

I get that feeling, too.
.
Image