How to specify a TTC font index in a Glyphs.FontURI property?

Whiletrue 1 Reputation point
2021-04-09T11:36:57.733+00:00

I want to put a TTC (True Type Collection) font file in FontURI property of a Glyphs. I use .Net5.0

I found in the old silverlight documentation this : https://learn.microsoft.com/en-us/previous-versions/windows/silverlight/dotnet-windows-silverlight/ms599247(v=vs.95)

FontUri also supports TTC (TrueType Collection) fonts. You can index a specific font face offset in the collection using the format collectionname.ttc#n where n is the index within the collection. You can omit "#0" if you intend to reference the first font face in the collection.

But in the net5.0 documentation this paragraph is not in the documentation :

https://learn.microsoft.com/en-us/dotnet/api/system.windows.documents.glyphs.fonturi?view=net-5.0

I tried the #1 in the FontURI (for Cambria Math) but without luck. enter image description here

Here is the code i tried to create the glyph font URI :

glyph.FontUri = new Uri(@"c:\Windows\Fonts\cambria.ttc#1");  

Is there a way to render glyphs from a TTC file in .net5 ?

Developer technologies | Windows Presentation Foundation
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.