Doh! I didn't think you literally meant to add "component" in your previous 
message. I thought it was in case the font was in a subfolder or something.

Works like a charm now. Thanks!



From: Tim Heuer 
Sent: Friday, August 29, 2008 12:16 PM
To: [email protected] 
Subject: RE: [OzSilverlight] Loading a custom font from a class library


You were missing one thing - "component":

 

this.FontFamily = new 
FontFamily("SilverlightClassLibrary1;component/tallpaul.TTF#Tall Paul");

 

this worked for me.

 

-th

 

tim heuer | (602) 405-4567 | im: [EMAIL PROTECTED]

blog: http://timheuer.com/blog/ | twitter: @timheuer

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Perry 
Stathopoulos
Sent: Friday, August 29, 2008 3:28 AM
To: [email protected]
Subject: Re: [OzSilverlight] Loading a custom font from a class library

 

Yeah I forgot to mentioned that I tried that. 

 

Anyway I recreated my problem in this simple solution (in attachment). If you 
can take a look and tell me what I'm doing wrong it would be greatly 
appreciated. Ideally I want to set the FontFamily programmatically in the 
control, but if I have to use a template that is acceptable.

 

Thanks,

Perry

 

 

From: Tim Heuer 

Sent: Thursday, August 28, 2008 11:21 PM

To: [email protected] 

Subject: RE: [OzSilverlight] Loading a custom font from a class library

 

Just so I understand, you have your app Foo.dll and you also are using 
MyCustomControl.dll right?  And the font is compiled as a Resource (not 
Embedded Resource) in MyCustomControl.dll?

 

If so, FontFamily in an element in Foo.dll should be:

 

MyCustomControl;component/fontfile.ttf#Font Name

 

<ShortAssemblyName>;component/<fontresourcefilename>#<fontfamilyname>

 

-th

 

tim heuer | (602) 405-4567 | im: [EMAIL PROTECTED]

blog: http://timheuer.com/blog/ | twitter: @timheuer

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Perry 
Stathopoulos
Sent: Thursday, August 28, 2008 4:02 PM
To: [email protected]
Subject: [OzSilverlight] Loading a custom font from a class library

 

I'm having trouble loading a custom font that is embedded in a class library 
that is required by a custom control in that library. I set the FontFamily as 
fontfile.ttf#FontName, and my font is set as embedded.

 

If I add the font file as embedded in my main silverlight application then it 
works, however this is not what I would like to do as I want a self containing 
custom control including its resources. Anyone have any ideas/suggestions?

 

Perry

------------------------------------------------------------------- 
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

<<image001.gif>>

Reply via email to