views:

105

answers:

0

I'm trying to embed some fonts into a WPF dll.

I've set the build action on the fonts to Resource. Loading the fonts from disk works fine, but from a pack uri, I get an exception.

Is this an unsupported scenario, or am I just doing it wrong?

GlyphTypeface gtf;
//OK
gtf = new GlyphTypeface(new Uri(@"filePath\Fonts\cmex10.ttf"));

//throws System.NotSupportedException
gtf= new GlyphTypeface(new Uri("pack://application:,,,/resources/fonts/cmex10.ttf"));