Locale current preferredFontFamily: #('system' 'gill').

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

Locale current preferredFontFamily: #('system' 'gill').

Maarten Mostert-2
Hi,
In 7.9.1 in the documentatio basic Libraries page 152 (Setting the Preferred Font Family)
I find an example to set the preferred font family which doesn't work ??

 

Locale current preferredFontFamily: #('system' 'gill').

 

 

Basically the bottom line problem I have is that when setting a DSV label to display an Icon with something like:

 

fixedCostLabel

^(LabelAndIcon
with: (UserMessage defaultString: 'Material' key: #materialCost) "astext asComposedText" )

icon: MyAssets package16

 

The font size in the label changes:

 

labelFont.png

 

So if anyone knows how to solve that ??

 

Best regards,

 

@+Maarten,

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Locale current preferredFontFamily: #('system' 'gill').

Kooyman, Les
Maarten:

At the time the locale subsystem was changed to incorporate the CLDR, many but not all things on Locale were surfaced at the CompositeLocale level (the Locale replacement). This is of course what you are talking to in a modern VisualWorks image as the result of sending the message 'Locale current'.

(Class #Locale itself is somewhat vestigial in that it still serves as a place to send several class messages, but you might end up talking to an instance of #Locale or #CompositeLocale, depending upon which is active in your image.)

Assuming that you are using the new locales, you will find #preferredFontFamily on the class #LocaleEncodingComponent. This is accessed by a private message to an instance of #CompositeLocale, #encodingComponent. So your example might be changed to read:

Locale current encodingComponent preferredFontFamily: #('system' 'gill').

It is planned for the legacy Locales (the old set) to be retired to a loadable parcel in VisualWorks 8.0, but until then you might want to test which locale set you are using if you want your code to work with both sets of locales (although I think most people are using the CLDR ones these days).

Les Kooyman
Cincom Smalltalk Engineering



From: [hidden email] [[hidden email]] on behalf of Maarten Mostert [[hidden email]]
Sent: Friday, January 03, 2014 8:44 AM
To: VW NC
Subject: [vwnc] Locale current preferredFontFamily: #('system' 'gill').

Hi,
In 7.9.1 in the documentatio basic Libraries page 152 (Setting the Preferred Font Family)
I find an example to set the preferred font family which doesn't work ??

 

Locale current preferredFontFamily: #('system' 'gill').

 

 

Basically the bottom line problem I have is that when setting a DSV label to display an Icon with something like:

 

fixedCostLabel

^(LabelAndIcon
with: (UserMessage defaultString: 'Material' key: #materialCost) "astext asComposedText" )

icon: MyAssets package16

 

The font size in the label changes:

 

labelFont.png

 

So if anyone knows how to solve that ??

 

Best regards,

 

@+Maarten,

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Locale current preferredFontFamily: #('system' 'gill').

Holger Kleinsorgen
In reply to this post by Maarten Mostert-2
Maarten Mostert wrote
Hi,

Basically the bottom line problem I have is that when setting a DSV label to display an Icon with something like:
 
fixedCostLabel

 ^(LabelAndIcon
 with: (UserMessage defaultString: 'Material' key: #materialCost) "astext asComposedText" )
 icon: MyAssets package16
 
The font size in the label changes:
Label uses the global default text style, not the widget text style of the look policy.
You can set the text style, though:
  (Label with: 'Test') attributes: Screen default defaultWidgetPolicy lookPolicyClass systemWidgetTextStyle
or if you have a UI builder at hand:
  (Label with: 'Test') attributes: self builder policy class systemWidgetTextStyle
Reply | Threaded
Open this post in threaded view
|

Re: Locale current preferredFontFamily: #('system' 'gill').

Maarten Mostert

Thank you Holger _  You're the best __

 

> "Holger Kleinsorgen" <[hidden email]> |

> Maarten Mostert wrote


> > Hi,
> >
> > Basically the bottom line problem I have is that when setting a DSV label
> > to display an Icon with something like:
> >
> > fixedCostLabel
> >
> > ^(LabelAndIcon
> > with: (UserMessage defaultString: 'Material' key: #materialCost) "astext
> > asComposedText" )
> > icon: MyAssets package16
> >
> > The font size in the label changes:
>
> Label uses the global default text style, not the widget text style of the
> look policy.
> You can set the text style, though:
> (Label with: 'Test') attributes: Screen default defaultWidgetPolicy
> lookPolicyClass systemWidgetTextStyle
> or if you have a UI builder at hand:
> (Label with: 'Test') attributes: self builder policy class
> systemWidgetTextStyle
>
>
>
>
> --
> View this message in context:
> http://forum.world.st/Locale-current-preferredFontFamily-system-gill-tp4733945p4734506.html
> Sent from the VisualWorks mailing list archive at Nabble.com.
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc