Is it possible to change wine fonts by bash script?
Is it possible to change wine fonts by bash script?
Hi, I am aware that the wine fonts can be changed manually via the winecfg dialog. My question is, can the fonts used in a prefix be changed via a command line? If not, is it possible to write a script (bash, perl, etc.) that will do this? Thanks for any answers.
Re: Is it possible to change wine fonts by bash script?
Such settings are usually stored in registry. Change some font settings in winecfg and compare registry before and after. Then write a *.reg file for your needs and feed it to wine regedit or wine reg in your script.
For example,
changes the setting "ToolTip Text" Font to Arial Black.
This font will be used in the status bar of regedit.
Code: Select all
REGEDIT4
[HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics]
"StatusFont"=hex:f8,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,\
00,00,00,00,00,00,00,22,41,00,72,00,69,00,61,00,6c,00,20,00,42,00,6c,00,61,\
00,63,00,6b,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
This font will be used in the status bar of regedit.
Thanks leniviy!
I've been searching the registry for this in vain. Thanks to you I finally found the key. What I did in the past was to set the font to some strangely named font and then search it in the registry, but the search always gave no results. Now I now why - it's encoded in ASCII!
I also like your tip about comparing the registry before and after. Why didn't I think of that? It's so simple. Haha!
Thanks again. Solved.
I've been searching the registry for this in vain. Thanks to you I finally found the key. What I did in the past was to set the font to some strangely named font and then search it in the registry, but the search always gave no results. Now I now why - it's encoded in ASCII!
I also like your tip about comparing the registry before and after. Why didn't I think of that? It's so simple. Haha!

Thanks again. Solved.
As vitamin said, this registry entry represents the LOGFONTW structure.
You can hardcode the beginning part:
in your script. It contains font properties like size and charset. They will probably be the same for different fonts.
Font name is in the end of the structure and has the length 64 bytes (32 characters). You should pad it with zeros using -n option of hexdump:
P.S. In my previous post I forgot the important '-v' option for hexdump
You can hardcode the beginning part:
Code: Select all
"f8,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,00,00,00,00,00,00,00,22,"
Font name is in the end of the structure and has the length 64 bytes (32 characters). You should pad it with zeros using -n option of hexdump:
Code: Select all
printf '%s\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0' "Arial Black" | hexdump -v -n 32 -e '1/1 "%02x,00,"' ; echo
-
- Newbie
- Posts: 1
- Joined: Thu Apr 12, 2012 10:11 pm