msstyleEditor
msstyleEditor copied to clipboard
Can't change fontface
Hi again, thanks for the application, one more limitation: I want to change font for some system stuff like Start Menu, but wherever I see fonts in an msstyles file, I only have a limited list of other fonts to select from, they're all Segoe of various sizes and styles. But I can't change font face to Tahoma or smth else. I opened the msstyle file in ResHack and found a string table with all the Segoe fonts, then I replaced one of the items to Arial, just for test, and complied it and saved it. But this had no effect on the msstyle file.
Hello and thanks for your extensive Feedback!
Let me start with a bit of trivia: In the .msstyles file, fonts are just numbers (typically 501 - 50X). They reference fonts defined in a stringtable resource. The stringtable can either reside in multiple files:
{ThemeName}/{ThemeName}.msstyles
{ThemeName}/{LangCode-CountryCode}/{ThemeName}.msstyles.mui
{ThemeName}/Shell/{Variant}/shellstyle.dll
{ThemeName}/Shell/{Variant}/{LangCode-CountryCode}/shellstyle.dll.mui
This makes it possible for the themes author the have a different font for different countries and/or different variants (e.g. "NormalColor") of the style.
Problem: The msstyleEditor is just opening the .msstyles file, nothing else. I did not want to scan the accompanying directory for files that may contain the stringtable with the font definitions, so i hardcoded the most common ID<->Font pairs:
{ 501, "Segoe UI, 9, Quality:ClearType" },
{ 502, "Segoe UI, 12, Quality:ClearType" },
{ 503, "Segoe UI, 9, Bold, Quality:ClearType" },
{ 504, "Segoe UI, 9, Underline, Quality:ClearType" },
{ 505, "Segoe UI, 12, Underline, Quality:ClearType" },
{ 506, "Segoe UI, 10, Quality:ClearType" },
{ 507, "Segoe UI, 9, Italic, Quality:ClearType" }
This is the limited list you are seeing. Problem with this is, that it limits the user to the font 501-507 and that I might show the wrong name in the UI (because i just assume 501 is Segoe UI, 9, Quality:ClearType 95% of the time and didn't bother searching for the stringtable with the real font, which might be different). So even if you change something to Arial via ResHack, i'll still show Segoe in the msstyleEditor. When windows is loading the theme, it will show Arial as expected however!
To work around the current limitations, you could change one of the font entries in the stringtable (you did that already) and then set the FONT property via the msstyleEditor to the correct number.
Example: You change 501 to "Arial, 9, Quality:ClearType" via ResHack and in the msstyleEditor set the font property to 501 by selecting "Segoe UI, 9, Quality:ClearType".
I hope all this information helps you to proceed until i have found the time to properly implement font selection.
Thank you, it worked. I could only change the font of the taskbar, control panel and the date/time area (string 502). Maybe some other things were affected too but I didn't notice yet. Alas, Start menu and many other applications do not depend on the styles, they use Calibri, not Segoe at all.
I checked the dlls with ResHack, they don't have any fonts, by the way.
I saw the .msstyles and msstyles.mui to have one at least, so i suspected the shellstyle.dll can have them too, but maybe you are right.
You're right, what I checked was the dlls of the theme I use (AeroByDesign) and they don't have strings, while the standard msstyles do have the same list of fonts.
One more note; ResHack and your application have different string ids, they differ by 1. For example, in ResHack "Segoe UI, 12, Quality:ClearType" has id 503 and your app has it as (Segoe UI, 12, Quality:ClearType (502)) Not sure whose fault it is. The ids of images do match.
ResHack is correct. As stated above i hardcoded the fontname <> ID translation, and in this case my table is simply wrong. I'll definitely have to fix this.
Since version 1.4.0.0 i am loading the string table and show the correct font name in the dropdown list. That fixes the "bug" part of this issue.
There is still no way to edit the table yet because it might be located in a .mui file which i can indirectly read by opening the .msstyles file, but not write. Loading the .mui manually creates conceptional challenges which I don't want to tackle right now. So to add or change font entries, the use of a PE resource editor is still necessary
Thanks, great. I have completed my big work of elaborating Windows styles, yet the fix is good anyway for the future.