Loading Fonts for Glyphs in Silverlight
Asked Answered
L

1

7

Is it possible to load a font at runtime in Silverlight for the Glyphs object. I've tried all sorts

-I've set the fonturi to a web location at runtime - no joy
-I've tried the same approach as textblock etc by setting the source to a stream but Glyphs do not support this.
-I've googled forever on it, but it seems that the only way is to have the fonts marked as resources in your SL project - which means rebuilding the xap everytime you need a new font - or knowing the list of fonts you need at design time.

So the question really is...Does anyone know how to truly dynamically load fonts for Glyphs in Silverlight?

Lorie answered 25/1, 2010 at 9:19 Comment(4)
Can you please tell more about the "no joy" part? In what way exactly is it unjoyful?Deontology
"no luck" or more officially usmilitary.about.com/od/glossarytermsn/g/n4322.htmForensics
Are you still looking for a response to this? I can tell you how I do it.Dissect
I believe this is prohibited purposefully. I believe it was in SL3 Beta but was taken out for the release. I wish I could find the link but I think the issue was that some of these fonts are licensed in such a way that makes pulling them from the web taboo. At least this is what I read on the XPS silverlight viewer project somewhere.Caveat
P
2

My friend discovered that FontSource property is the key point. Also setting FontRenderingEmSize and Fill properties is essential step to success. FontSource allows loading both remote and embedded TTF fonts by providing a stream.

Panto answered 7/7, 2010 at 17:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.