It is currently April 24th, 2024, 11:34 pm

Font

Get help with creating, editing & fixing problems with skins
Dev
Posts: 4
Joined: August 6th, 2010, 2:06 am

Font

Post by Dev »

Hello Everyone,

I just recently got the simplesentence2 skin to tell my date and time. I also just downloaded a new font from online, but i cant seem to use that font for the skin. I've tried multiple things, but i can't seem to get it. Does anyone know how to use a downloaded font in a skin?
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Font

Post by jsmorley »

Dev wrote:Hello Everyone,

I just recently got the simplesentence2 skin to tell my date and time. I also just downloaded a new font from online, but i cant seem to use that font for the skin. I've tried multiple things, but i can't seem to get it. Does anyone know how to use a downloaded font in a skin?
Fonts are a bit tricky.

1) The font must be a .ttf (TrueType) font, and not a .otf (OpenType) font. If you have downloaded a .otf file, it is possible, but not certain, that you can convert this file using http://onlinefontconverter.com/ online. Once you have converted the file, try using it. I have found that about 70-80% of .otf fonts can successfully be converted and used.

Even better results can be had with a font conversion tool like http://www.high-logic.com/fontcreator.html, but almost none of these are free. There is http://fontforge.sourceforge.net/, but this must be run in a unix environment and while it can be done with the CygWin unix-in-windows utility, this is NOT for the faint of heart or new Windows user.

2) You must use the "Family Name" of the font. This can be found by double clicking the font .ttf file and at the very top in the Windows font viewer see the "Font Name:" at the top left. Now, this also has a "gotcha". Many fonts have subfamily names that are appended on the "Family Name" in Windows font viewer. The Font Name: may be MyFont-Bold or MyFont Bold or MyFont BoldItalic" You should not use these subfamily postfixes when identifying the font in Rainmeter with FontFace=xxx. This can involve a bit of trial and error, but in this example FontFace=MyFont is the mostly likely correct entry.

3) Most, but not ALL fonts can be modified at run time in Rainmeter with StringStyle, StringEffect, etc. If you have problems with a font using these settings, try removing them to see if that is the issue.

4) There are a couple of ways Rainmeter will react if it hates your font for some reason.
- It may give no error, but display the default Arial instead of your font. This will be what happens if you use a .otf font, or if you use the wrong "Family Name" for the font.
- It gives an error, like "Can't create font" and the meter fails entirely. This generally means you have used an attribute like StringStyle=Bold on a font that doesn't support it, or there is just a problem with the font itself that causes Rainmeter to fail in loading / using it.

5) It is possible (and to my mind desirable) to use fonts without installing them in Windows. Adding tons of fonts to Widows is just a resource hog and not needed for Rainmeter. Just use the LocalFont="Path\FileName.ttf" statement in the [Rainmeter] section of your skin. Then use the Family Name in FontFace=xxx as you normally would. This is particularly useful for testing a font to be sure it both works with Rainmeter and is what you really wanted. Why install fonts in Windows only to never use them...

Here is a sample skin showing some ways to use fonts in Rainmeter:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
LocalFont="#CURRENTPATH#ALBA____.TTF"

[Variables]
WinFontFace=Trebuchet MS
LocalFontFace=Alba
FontColor=255,255,255,255
FontSize=20
StringAlign=Left
StringStyle=Normal
StringEffect=None
AntiAlias=1

[MeterOne]
Meter=String
SolidColor=171,54,3,150
FontFace=#WinFontFace#
FontColor=#FontColor#
FontSize=#FontSize#
StringAlign=#StringAlign#
StringStyle=#StringStyle#
StringEffect=#StringEffect#
AntiAlias=#AntiAlias#
X=5
Y=5
Text=This is String Meter One#CRLF#FontFace: #WinFontFace##CRLF#FontSize: #FontSize##CRLF#StringStyle: #StringStyle##CRLF#StringEffect: #StringEffect#

[MeterTwo]
Meter=String
SolidColor=171,54,3,150
FontFace=#LocalFontFace#
FontColor=#FontColor#
FontSize=#FontSize#
StringAlign=#StringAlign#
StringStyle=#StringStyle#
StringEffect=#StringEffect#
AntiAlias=#AntiAlias#
X=5
Y=5R
Text=This is String Meter Two#CRLF#FontFace: #LocalFontFace##CRLF#FontSize: #FontSize##CRLF#StringStyle: #StringStyle##CRLF#StringEffect: #StringEffect#
AlbaFont.zip
8-6-2010 3-18-03 PM.jpg
You do not have the required permissions to view the files attached to this post.
Dev
Posts: 4
Joined: August 6th, 2010, 2:06 am

Re: Font

Post by Dev »

Thanks for your help Jsmorley. I tried the things you suggested but it stills seems i'm not doing it right. I'm still trying to figure this program out...

This is the Font i want to use.

And here is the code:

Code: Select all

[Rainmeter]
Simplesentence created by 

WhiteBaron
Update=1000
LocalFont="http://www.dafont.com/cold-night-for-alligators.font\coldnightforalligators.ttf
Author=Original by WhiteBaron 

[http://white-baron.deviantart.com/] Modified by w1th0utnam3 

[http://w1th0utnam3.deviantart.com/]

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

[Metadata]
Name=
Config=
Description=Slik clock with date in two nices sentences. 

Originally created by WhiteBaron and modified by w1th0utnam3.
Instructions=Loading via RainBrowser may not work, use tray icon instead.
Version=w1th0utnam3 Special 

Edition
Tags=
License=
Variant=
Preview=

;End of added Metadata

[Variables]
Colour=255, 255, 255

;----------MEASURES----------

[MeasureTime]
Measure=Time
Format=%I:%M %H
Substitute=" 00":" at night"," 01":" at night"," 02":" at night"," 03":" in the morning"," 04":" in the morning"," 05":" in the morning"," 06":" in the morning"," 07":" in the morning"," 08":" in the morning"," 09":" in the morning"," 10":" in the morning"," 11":" in the morning"," 12":" in the noon"," 13":" in the noon"," 14":" in the afternoon"," 15":" in the afternoon"," 16":" in the afternoon"," 17":" in the afternoon"," 18":" in the evening"," 19":" in the evening"," 20":" in the evening"," 21":" in the evening"," 22":" at night"," 23":" at night"

[MeasureDate]
Measure=Time
Format=on %A, the %d day of %B.
Substitute="01":"1st","02":"2nd","03":"3rd","04":"4th","05":"5th","06":"6th","07":"7th","08":"8th","09":"9th","10":"10th","11":"11th","12":"12th","13":"13th","14":"14th","15":"15th","16":"16th","17":"17th","18":"18th","19":"19th","20":"20th","21":"21st","22":"22nd","23":"23rd","24":"24th","25":"25th","26":"26th","27":"27th","28":"28th","29":"29th","30":"30th","31":"31st"

[MeasureYear]
Measure=Time
Format=The year is %Y, and I don't think I'll last much longer...

;----------METERS------------

[MeterTime]
MeasureName=MeasureTime
Meter=String
Prefix="I have currently survived to "
X=5
FontColor=#Colour#, 255
FontSize=22
FontFace=coldnightforalligators.ttf
StringAlign=Left
AntiAlias=1

[MeterDate]
MeasureName=MeasureDate
Meter=String
X=38
Y=50
FontColor=#Colour#, 210
FontSize=16
FontFace=coldnightforalligators.ttf
StringAlign=Left
AntiAlias=1

[MeterYear]
MeasureName=MeasureYear
Meter=String
X=0
Y=92
FontColor=#Colour#, 170
FontSize=12
FontFace=#Font#
StringAlign=Left
StringStyle=Normal
AntiAlias=1
Could you show me what i'm doing wrong? It will be a nice learning experience. Thanks in advance!

P.S. In case you're wondering why i chose that font, i'm going for a zombie theme. =]
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Font

Post by jsmorley »

Hehe.. You can't just put a URL to DaFont.com as "LocalFont". Wouldn't be very "local" would it?

Put coldnightforalligators.ttf in the same folder with your skin .ini file and then

[Rainmeter]
Update=1000
DynamicWindowSize=1
LocalFont="#CURRENTPATH#coldnightforalligators.ttf"

[Variables]
LocalFontFace=Cold Night for Alligators

[MeterOne]
Meter=String
FontFace=#LocalFontFace#
FontSize=50
FontColor=255,0,0,255
Text=SPOOKY FONT!

Works fine for me.
8-6-2010 4-54-40 PM.jpg
You do not have the required permissions to view the files attached to this post.
Dev
Posts: 4
Joined: August 6th, 2010, 2:06 am

Re: Font

Post by Dev »

Haha, I'm still new to this! I'm still trying to figure out what "LocalFont" and stuff like that means. I guess i was just cramming all your directions together. I was trying to do like you said, and not download the font, just take it from the internet.

Anyways, i got it now! Thanks a bunch for your help!
cdm6610
Posts: 9
Joined: August 2nd, 2010, 5:25 am

Re: Font

Post by cdm6610 »

Hey, dunno if this is still an issue but I just ran into the same trouble. One important step is to be sure to restart your computer after you convert the font to .ttf and reinstall it. Just refreshing Rainmeter didn't work for me, but after a restart it worked. Hope that helps. ^_^
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Font

Post by jsmorley »

cdm6610 wrote:Hey, dunno if this is still an issue but I just ran into the same trouble. One important step is to be sure to restart your computer after you convert the font to .ttf and reinstall it. Just refreshing Rainmeter didn't work for me, but after a restart it worked. Hope that helps. ^_^
That is very true and I should have mentioned that in my earlier post. If you install a new font in Windows you just need to restart Rainmeter, if you "alter" a font already installed in Windows it is best to reboot to be sure everything is reset. With "LocalFont" you only need to restart/refresh the skin.