How to load a specific font in a font collection

46 views
Skip to first unread message

Ryan

unread,
Sep 22, 2014, 3:11:41 PM9/22/14
to pdfne...@googlegroups.com
Q:

How do I use a font that is contained in a font collection (ttc file)? In particular, I want to load "MS PGothic" font on windows, which is in the msgothic.ttc file along with “MS Gothic”, “MS PGothic”, “MS UI Gothic”.

If I call Font::CreateCIDTrueTypeFont(pdfDoc,”…\msgothic.ttc”)) , then the "MS Gothic" font (the first/default) is picked.

------------------------------------------------------------------

A:

Use Font.Create"pdfDoc, "MS PGothic") method. This will enumerate the fonts on the OS looking for the best match.

Note, you will need to use the CreateUnicodeTextRun method, and not the CreateTextRun method.
Reply all
Reply to author
Forward
0 new messages