question

Whiletru3 avatar image
0 Votes"
Whiletru3 asked Whiletru3 commented

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

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://docs.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://docs.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 ?

windows-wpf
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Whiletru3
IndicesProperty identifies the Indices dependency property. Its glyph specification has the form [GlyphIndex][,[Advance][,[uOffset][,[vOffset][,[Flags]]]]]. You can refer to Draw Text Using Glyphs for the example. Did this meet your requirement?


0 Votes 0 ·

Hello, No this issue in not about glyph but about True Type Collection font (a file with multiple font in it) :(

0 Votes 0 ·

0 Answers