Fonts gotcha

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
NancyM
Pro Scripter
Posts: 66
Joined: Mon Jul 18, 2016 7:01 pm

Fonts gotcha

Post by NancyM » Mon Sep 19, 2016 4:25 pm

So, on my development machine I had installed Clear Type fonts. Then when we got a production machine, it wasn't matching images because the fonts were different. Eventually I remembered why!

Is there any way to find out what fonts Windows (7) is using on a given machine? When I distribute my compiled macro it might be useful to send the fonts with it. From what I've found I can find all the loaded fonts, but how do I know which ones are actually being used by the operating system?

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Fonts gotcha

Post by Marcus Tettmar » Tue Sep 27, 2016 8:59 am

I did some research for you. This code will tell you whether ClearType is enabled or not:

Code: Select all

Let>SPI_GETFONTSMOOTHINGTYPE=8202
LibFunc>user32.dll,SystemParametersInfoA,res,SPI_GETFONTSMOOTHINGTYPE,0,REF:0,0
If>res_3=2
  MessageModal>ClearType Enabled
Else
  MessageModal>ClearType Not Enabled
Endif
However, I think there may be many other factors at play. E.g. I think you can have some kind of font anti-aliasing enabled even when ClearType is NOT enabled. This can also be detected using similar to above. See:

SystemParametersInfo function

I haven't had much luck trying to work out how to get the fonts that are in use by the theme. A theme could be customised so there could be more than one font and size in use.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

NancyM
Pro Scripter
Posts: 66
Joined: Mon Jul 18, 2016 7:01 pm

Re: Fonts gotcha

Post by NancyM » Tue Oct 18, 2016 2:38 pm

Oh yeah, I didn't even think about themes. Yikes! Maybe I should create my own theme and simply move it to new computers.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts