It is currently April 19th, 2024, 7:21 am

Wrong with code or font?

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Wrong with code or font?

Post by jsmorley »

balala wrote: That's exactly what I wrote above! With my last sentence I just wanted to say that even if it would be, the path is wrong, because it has an extra backslash ("\")!
balala,

I'm just not happy with even seeing FontFace=#@#Fonts\WeatherIcons at all, as that is just an entirely invalid FontFace option and it might lead someone to think that FontFace will allow a path to a font file. It just won't.

Perhaps if you had written:

if you'd like to give a path in the @Resources folder, the way you wrote is wrong. Instead you should use something like: FontFace=#@#Fonts\WeatherIcons, because the #@# path includes the "\". However, since FontFace is NOT a path to a file, it doesn't matter, since this will never, ever work, no matter how you format the path.

:-)

P.S. To be technically correct, while the trailing "\" on all built-in path variables is already there, and isn't "needed" on them, it is allowed, and Rainmeter will understand what you mean. It throws away extra backslashes.

Meter=Image
ImageName=#@#Images\Grr.png
ImageName=#@#\Images\Grr.png

Both work fine. In fact, ImageName=#@#\\\\Images\\\\Grr.png will work fine.

You can also use unix-style forward slashes for paths, and Rainmeter will figure that out as well.

ImageName=#@#Images/Grr.png
ImageName=#@#/Images/Grr.png

Also both work fine.
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Wrong with code or font?

Post by balala »

jsmorley wrote:P.S. To be technically correct, while the trailing "\" on all built-in path variables is already there, and isn't "needed" on them, it is allowed, and Rainmeter will understand what you mean. It throws away extra backslashes.

Meter=Image
ImageName=#@#Images\Grr.png
ImageName=#@#\Images\Grr.png

Both work fine. In fact, ImageName=#@#\\\\Images\\\\Grr.png will work fine.
Yes, you're right. I never tried this, but indeed it works. Sorry, I had no idea about this!
jsmorley wrote:balala,

I'm just not happy with even seeing FontFace=#@#Fonts\WeatherIcons at all, as that is just an entirely invalid FontFace option and it might lead someone to think that FontFace will allow a path to a font file. It just won't.

Perhaps if you had written:

if you'd like to give a path in the @Resources folder, the way you wrote is wrong. Instead you should use something like: FontFace=#@#Fonts\WeatherIcons, because the #@# path includes the "\". However, since FontFace is NOT a path to a file, it doesn't matter, since this will never, ever work, no matter how you format the path.
For sure once again you're right, but sometimes my english gives me headache and not all times I can write what I want in the best way. Sorry, I'll keep trying to improve my english.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Wrong with code or font?

Post by jsmorley »

Your English is fine, and I'm not trying to nitpick you. I just always fear new users who skim through posts without really "reading" and seeing something like FontFace=#@#Fonts\WeatherIcons which isn't just wrong, but can lead to a real misunderstanding of how FontFace works and what it even means.

All is well...

This is all Niemil's fault anyway. :-)
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Wrong with code or font?

Post by balala »

jsmorley wrote:Your English is fine, and I'm not trying to nitpick you. I just always fear new users who skim through posts without really "reading" and seeing something like FontFace=#@#Fonts\WeatherIcons which isn't just wrong, but can lead to a real misunderstanding of how FontFace works and what it even means.

All is well...
Well, I'm glad if you think my English is acceptable (I think beeing fine is too much said).
User avatar
Niemil
Posts: 218
Joined: August 5th, 2014, 5:04 pm
Location: Luleå, Sweden

Re: Wrong with code or font?

Post by Niemil »

Not my fault how this language were created :D

Well well.
Problem, which I can't understand.

I been using Character map in windows for checking what weathers exists and which font they're.

So I used the other font instead due it was more weather and more nice.
http://fonts.artill.de/collection/artill-weather-icons that one.

[EDIT]
Here is the font I use:
http://emilniemi.com/rainmeter/artillcleanweathericons-Regular.ttf
To directly download it, I think I converted it to ttf as well.

Here's my code:

Code: Select all

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


;http://docs.rainmeter.net/tips/webparser-weather-skin-translations

[Variables]
Type=M
Location=SWXX0019
WeatherColor=255,255,255
WeatherSize=80



[Current]
Measure=Plugin
Plugin=WebParser
UpdateRate=600
Url=http://xml.weather.com/weather/local/#Location#?cc=*&unit=#Type#&dayf=0
RegExp="(?siU).*<locale>(.*)</locale>.*<ut>(.*)</ut>.*<ud>(.*)</ud>.*<us>(.*)</us>.*<up>(.*)</up>.*<ur>(.*)</ur>.*<loc id="(.*)">.*<dnam>(.*)</dnam>.*<tm>(.*)</tm>.*<lat>(.*)</lat>.*<lon>(.*)</lon>.*<sunr>(.*)</sunr>.*<suns>(.*)</suns>.*<zone>(.*)</zone>.*<cc>.*<lsup>(.*)</lsup>.*<obst>(.*)</obst>.*<tmp>(.*)</tmp>.*<flik>(.*)</flik>.*<t>(.*)</t>.*<icon>(.*)</icon>.*<bar>.*<r>(.*)</r>.*<d>(.*)</d>.*<wind>.*<s>(.*)</s>.*<gust>(.*)</gust>.*<d>(.*)</d>.*<t>(.*)</t>.*<hmid>(.*)</hmid>.*<vis>(.*)</vis>.*<uv>.*<i>(.*)</i>.*<t>(.*)</t>
[MeasureTemp]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Current]
StringIndex=17

[MeasureStatus]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Current]
StringIndex=19
Substitute=" And ":" and ","Lgt.":"Light ","Snow/":"Snow & "


[MeasureIcon]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[Current]
StringIndex=20
Substitute="3200":"{","47":"Q","46":"M","45":"Q","44":"/","43":"I","42":"I","41":"I","40":"O","39":"S","38":"S","37":"4","36":"1‘","35":"W","34":"2","33":"!","32":"1","31":"6","30":"A","29":"!","28":"3","27":"c","26":"/","25":"“","24":",","23":"E","22":"…","21":"…","20":"…","19":"…","18":"W","17":"v","16":"I","15":"M","14":"h","13":"H","12":"K","11":"K","10":"K“","9":"5","8":"5“","4":"Y","3":"4","2":":","1":":","0":":"

[MeterIcon]
MeasureName=MeasureIcon
Meter=String
AntiAlias=1
SolidColor=0,0,0,1
FontColor=#WeatherColor#
FontSize=#WeatherSize#
FontFace=artill clean weather icons
Text=


[MeterTemp]
MeasureName=MeasureTemp
Meter=String
FontColor=#WeatherColor#
FontSize=34
FontFace=Arial
StringStyle=Bold
AntiAlias=1
Text="%1°C"
SolidColor=0,0,0,1
X=R
Y=20



[MeterDesc]
MeasureName=MeasureStatus
Meter=String
FontColor=#WeatherColor#
FontSize=14
SolidColor=0,0,0,1
StringStyle=Bold
FontFace=Arial
AntiAlias=1
Y=R
X=r
As you can see, this is the parsing site:
http://wxdata.weather.com/wxdata/weather/local/SWXX0019?cc=*&unit=M&dayf=0

icon right now says to be 34, so here is the Substitute:

Code: Select all

"3200":"{","47":"Q","46":"M","45":"Q","44":"/","43":"I","42":"I","41":"I","40":"O","39":"S","38":"S","37":"4","36":"1‘","35":"W","34":"2","33":"!","32":"1","31":"6","30":"A","29":"!","28":"3","27":"c","26":"/","25":"“","24":",","23":"E","22":"…","21":"…","20":"…","19":"…","18":"W","17":"v","16":"I","15":"M","14":"h","13":"H","12":"K","11":"K","10":"K“","9":"5","8":"5“","4":"Y","3":"4","2":":","1":":","0":":"
34 is also 2
And 2 in it's character map and as well if I type it in rainmeter as text, is a sun and a small cloud.

WebParse Weather Translation says it's:
34 fair (day, but the "day" text is not included)

So far so good.
But what do I get out in the image instead? well, I get the tornado. The tornado is a colon (":").

So what do I get out if I change the fontface from FontFace=artill clean weather icons to FontFace=Arial (see, now I did it correct).
I also get a Colon (":") this time too. And I dont' understand why.

This mornign was same problem but with another number, I think it was number 28, and it turned out to be a number 4 instead.


So what do I get out of this parsing using RainRegExp? I get 34 as it should be.
So the Substitute must be some kind of fail?!
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Wrong with code or font?

Post by jsmorley »

You are changing "34" to "2"

"34":"2"

then later, changing "2" to ":"

"2":":"

So "34" ends up as ":"
User avatar
Niemil
Posts: 218
Joined: August 5th, 2014, 5:04 pm
Location: Luleå, Sweden

Re: Wrong with code or font?

Post by Niemil »

Well, F%#@
How is it possible to do with this font then? or it's not possible at all?

[Edit]
Currently trying to edit the font file using FontForge, attempted to change their values so it's only alphabetical for the fonts, but seems like I can't generate the ttf file correctly.. just errors I ain't understanding.