How Do I Get VW 7.2 System widget font back?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How Do I Get VW 7.2 System widget font back?

Stew MacLean

I think I’ve established that the System widget fonts are different between 7.2 (running on 7.3 engine) and 7.4.

 

I did this by opening virgin images in 7.2 and 7.4 and inspecting the resulting VariableSizeTextAttributes from

 

LookPreferences widgetPolicy lookPolicyClass systemWidgetTextStyle.

 

7.2 lineGrid = 18, baseline = 14

7.4 lineGrid = 17, baseline = 13

 

Then I drill down lastFontPolicy, defaultFont, name and get:

 

7.2  'System~16~700~0~0~0~ansi~1'

7.4 'tahoma~16~400~0~0~0~ansi~0'

 

Using NamedFontSelector open, these appear to be the fonts that are being used for the text widgets.

 

I’ve also opened up the UIPainter and notice that capital I has serifs under 7.4 and non within 7.2, which corresponds to what is happening in my development 7.2 and 7.4 images.

 

The  systemWidgetTextStyle is stored within the class variable systemWidgetAttributes within WinXPLookPolicy class.

 

I would like to assign the 7.2 VariableSizeTextAttributes to this but I am at a complete loss as to how to find and reference this object to use for assigning.

(assuming this is the correct way to get my font back!)

 

Any help greatly appreciated here!

 

Cheers,

 

Stewart

Reply | Threaded
Open this post in threaded view
|

RE: How Do I Get VW 7.2 System widget font back?

Stew MacLean

(Replying to my own post in case anyone might find it useful…)

 

Well, after a trip through the bowels of the Font classes etc (and reading the release notes and documentation!) I found the offending method:

 

MSWindowFont class>>defaultFontDescriptionIn: fontPolicy

           

This has been changed so that the Tahoma font gets used. So I reverted it back to so that the 7.2 font got used. However I just couldn’t get this to.

 

Then, inspired by the Aragon TextStyle class and studying the documentation I wrote:

 

            | fd ca ta |

 

            fd := FontDescription new

                        family: #('micros*' 'arial' 'helv*' '*');

                        pixelSize: 15;

                        encoding: 'ms_cp_1252'.

            ca := VariableCharacterAttributes newWithDefaultAttributes.

            ca setDefaultQuery: fd.

            ta := VariableSizeTextAttributes characterAttributes: ca.

            ta scalingFactor: 0.85; lineGrid: 19; baseline: 15.

            WinXPLookPolicy systemWidgetTextStyle: ta.

            GraphicsDevice allOpenDevices do: [:each | each updateWidgetPolicy].

 

Which worked like a charm!

 

As a consequence, I realise I’ve got some resizing to do to cater for different fonts when the platform look changes.

 

Panic over!

 

Stewart

 

-----Original Message-----
From: Stewart MacLean [mailto:[hidden email]]
Sent:
Thursday, 11 May 2006 10:37 p.m.
To: [hidden email]
Subject: How Do I Get VW 7.2 System widget font back?

 

I think I’ve established that the System widget fonts are different between 7.2 (running on 7.3 engine) and 7.4.

 

I did this by opening virgin images in 7.2 and 7.4 and inspecting the resulting VariableSizeTextAttributes from

 

LookPreferences widgetPolicy lookPolicyClass systemWidgetTextStyle.

 

7.2 lineGrid = 18, baseline = 14

7.4 lineGrid = 17, baseline = 13

 

Then I drill down lastFontPolicy, defaultFont, name and get:

 

7.2  'System~16~700~0~0~0~ansi~1'

7.4 'tahoma~16~400~0~0~0~ansi~0'

 

Using NamedFontSelector open, these appear to be the fonts that are being used for the text widgets.

 

I’ve also opened up the UIPainter and notice that capital I has serifs under 7.4 and non within 7.2, which corresponds to what is happening in my development 7.2 and 7.4 images.

 

The  systemWidgetTextStyle is stored within the class variable systemWidgetAttributes within WinXPLookPolicy class.

 

I would like to assign the 7.2 VariableSizeTextAttributes to this but I am at a complete loss as to how to find and reference this object to use for assigning.

(assuming this is the correct way to get my font back!)

 

Any help greatly appreciated here!

 

Cheers,

 

Stewart