Export to GitHub

rainmeter - issue #91

Fonts Folder


Posted on Aug 9, 2009 by Massive Monkey

Since a lot of people installing skins might not be the brightest when it comes to fonts (and the fact that deleting the wrong ones can be bad), would it be possible for Rainmeter to have its own font folder? For example, putting a font in %APPDATA%\Rainmeter\Fonts would make it accessible to any Rainmeter skins.

Note: I believe that PNotes (http://pnotes.sf.net/) is able to do this.

Comment #1

Posted on Aug 11, 2009 by Quick Elephant

Rainmeter would need to be modified to "install" fonts in memory which it finds in that folder. You don't have to actually install a font in \Windows\Fonts for a Windows app to use it, but if it is not there you have to run some API calls to have Windows recognize the font and make it available to applications. Then when your program ends it should clear those fonts from memory so it doesn't leave Windows in an unstable state when the app is run portable and the font is no longer physically available.

Comment #2

Posted on Aug 12, 2009 by Massive Monkey

Ah, true about the API calls. But they do not require Admin. privelages in order to work properly. I believe the procedure was to call AddFontResoureEx and broadcast WM_FONTCHANGE. Then at shutdown call RemoveFontResourceEx, which shouldn't leave anything in memory. References: http://msdn.microsoft.com/en-us/library/dd183327(VS.85).aspx http://msdn.microsoft.com/en-us/library/aa911393.aspx http://msdn.microsoft.com/en-us/library/dd162923(VS.85).aspx

Comment #3

Posted on Aug 12, 2009 by Quick Elephant

I do agree that this is a good idea if it isn't too big a deal putting it in the code. Many skins come with fonts and it would be great if you didn't have to actually "install" every one. Windows can use a lot of resources managing a ton of installed fonts, so it is unwise to just install every font you ever like for one particular purpose. The program NexusFont uses the above procedure, so you can keep a thousand fonts in a separate folder if you want, and when you run NexusFonts all those fonts are temporarily available for use in things like Photoshop. When you close NexusFont they go away.

So if Rainmeter could read a \Fonts folder at the same level as \Plugins and \Addons, automatically have windows broadcast those fonts to all Windows apps and remove them from memory when Rainmeter ends, that would actually be really cool and help skin authors a lot.

Comment #4

Posted on Sep 2, 2009 by Quick Elephant

Done. This change will be in the next full beta 1.1 build.

Note - It was decided not to have Rainmeter read and load all fonts in the \Fonts directory as this is inefficient and a waste of resources. It will load fonts found in the \Fonts directory "on demand" driven by a new entry in the [Rainmeter] section of the skin's .ini file.

http://rainmeter.net/forum/viewtopic.php?f=19&t=1208

Comment #5

Posted on Sep 8, 2009 by Quick Elephant

Functionality added to 1.1 beta

Status: Fixed

Labels:
Type-Enhancement Priority-Medium Milestone-Release1.1 Component-Logic