I have a Silverlight application that I need to embed some less-than-common fonts in. It's simple enough for me to just copy over the TTF/OTF and compile that with my app. However, in many cases, only like 5-10 of the characters are actually used. In other cases, some font files are incredibly large (Arial Unicode MS Regular is 22.1 MB, as an example). Fast download times of my app is really important, so optimizing the fonts used is paramount.
So, what I was thinking is that I've seen in applications like Expression Blend where a <Glyph/>
is used to create a read-only font and you can also just choose embed only certain characters. In other circumstances, I've seen people use fonts that only contained certain characters as a sub-set of the full font (and not use a <Glyph/>
in Silverlight, but rather just use the sub-set .TTF as <FontFamily/>
.) That's kind of what I'm after, except I'm not using Expressions.
I'm not looking for sneaky workarounds, like exporting to an XPS file and grabbing the .odtff file.
Is there a programmatic way (.NET/GDI+) to create a sub-set of a font with only certain characters and compile it out to a .TTF/.OTF? Also, this would need to work for .TTC files as well.