Re: [OzSilverlight] SL Fonts.?

2008-11-01 Thread ross jempson
It can be done in WPF but the same class doesn't seem to exist in Silverlight

eg. Here is an example

 Window.Resources
DataTemplate x:Key=FontTemplate
  StackPanel Orientation=Horizontal
Border BorderThickness=1 BorderBrush=Black Margin=10
TextBlock FontFamily={Binding Source}
Text=Sample Text Margin=5 /
/Border
TextBlock Text={Binding Source} VerticalAlignment=Center /
/StackPanel
/DataTemplate
  /Window.Resources

  ListBox x:Name=fonts ItemTemplate={StaticResource FontTemplate} /


 And in code :

fonts.ItemsSource = System.Windows.Media.Fonts.SystemFontFamilies;


On Sat, Nov 1, 2008 at 11:18 PM, Muhammad Niaz [EMAIL PROTECTED] wrote:
 Hi can anybody tell me how to get default Fonts  that are available in SL2
 using foreach, mean to populate Combobox or any control dynamically.?





 Thanks  Regards,

 Muhammad Niaz

 Software Engineer

 Intagleo Systems Pvt Ltd

 www.intagleo.co.uk



 ---
 OzSilverlight.com - to unsubscribe from this list, send a message back to
 the list with 'unsubscribe' as the subject.
 Powered by mailenable.com - List managed by www.readify.net


--- 
OzSilverlight.com - to unsubscribe from this list, send a message back to the 
list with 'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net




RE: [OzSilverlight] SL Fonts.?

2008-11-01 Thread Miguel Madero
Muhammad, 

I'm not sure you could get that info directly from SL, but you can look for the 
appropriate function in JS and call it from SL.

If you depend on a certain font you can include them in a zip file and get them 
through a request and create a FontSource object using the stream. This is part 
of SL docs

Downloading Fonts
Silverlight does not include any fonts in its installation package. If you want 
to use a font for a TextBlock or TextBox element that is not on the list of 
supported local fonts, you can specify the font in XAML by using the FontFamily 
property, or in code using the FontSource property. The FontFamily property can 
specify a single font file or a zip file containing font files. In either case, 
the file must be embedded in a DLL as a resource. When using FontSource, your 
code can load the font (or zip of fonts) from a stream such as isolated 
storage. 




 Miguel A. Madero Reyes
 www.miguelmadero.com (blog)
 [EMAIL PROTECTED] 
 +61 (0) 406-704-161
 623/243 Pyrmont Street 
 Pyrmont, NSW, 2009
 Australia
 Please reconsider your environmental responsibility before printing this 
e-mail
The information in this e-mail is confidential and may be legally privileged. 
It is intended solely for the addressee. If you are not the intended recipient, 
any disclosure, copying, distribution or any action taken or omitted to be 
taken in reliance on it, is prohibited and may be unlawful.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Muhammad Niaz
Sent: Sunday, 2 November 2008 2:18 AM
To: listserver@ozSilverlight.com
Subject: RE: [OzSilverlight] SL Fonts.?

Thanks Ross 
:)


Thanks  Regards,
Muhammad Niaz
Software Engineer
Intagleo Systems Pvt Ltd
www.intagleo.co.uk

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of ross jempson
Sent: Saturday, November 01, 2008 7:22 PM
To: listserver@ozSilverlight.com
Subject: Re: [OzSilverlight] SL Fonts.?

It can be done in WPF but the same class doesn't seem to exist in
Silverlight

eg. Here is an example

 Window.Resources
DataTemplate x:Key=FontTemplate
  StackPanel Orientation=Horizontal
Border BorderThickness=1 BorderBrush=Black Margin=10
TextBlock FontFamily={Binding Source}
Text=Sample Text Margin=5 /
/Border
TextBlock Text={Binding Source} VerticalAlignment=Center /
/StackPanel
/DataTemplate
  /Window.Resources

  ListBox x:Name=fonts ItemTemplate={StaticResource FontTemplate} /


 And in code :

fonts.ItemsSource = System.Windows.Media.Fonts.SystemFontFamilies;


On Sat, Nov 1, 2008 at 11:18 PM, Muhammad Niaz [EMAIL PROTECTED]
wrote:
 Hi can anybody tell me how to get default Fonts  that are available in SL2
 using foreach, mean to populate Combobox or any control dynamically.?





 Thanks  Regards,

 Muhammad Niaz

 Software Engineer

 Intagleo Systems Pvt Ltd

 www.intagleo.co.uk



 ---
 OzSilverlight.com - to unsubscribe from this list, send a message back to
 the list with 'unsubscribe' as the subject.
 Powered by mailenable.com - List managed by www.readify.net


---
OzSilverlight.com - to unsubscribe from this list, send a message back to
the list with 'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net







--- 
OzSilverlight.com - to unsubscribe from this list, send a message back to the 
list with 'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net




--- 
OzSilverlight.com - to unsubscribe from this list, send a message back to the 
list with 'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net