WPF font selection model

my name is Mikhail Leonov, I’m a developer on the WPF Text team.

WPF introduces a new font selection model that allows applications to select fonts using FontFamily, FontWeight, FontStyle and FontStretch properties. Customers often need to know how the information stored in the font files is mapped to these properties by the WPF engine, so we wrote a white paper that contains detailed explanation of the font mapping process in WPF. I hope this paper is useful to developers and font designers, and I’m looking forward to your feedback. The attached copy of the paper is in the PDF format, but I can also upload XPS and DOCX versions if needed.

Best regards,
Mikhail Leonov – MSFT

WPF Font Selection Model.pdf

Comments (6)

  1. Darrel says:

    As I am starting to develop a WPF application that will create XPS documents, I found this posting while searching for a solution to creating a font selection interface that will provide the means to also identify the path to the font file for adding the resource in the XPS document.  Section 5 (Font chooser guidelines) suggests that the System.Windows.Media.Fonts object is the starting point for the Font Chooser dialog you show and this screen capture shows that you are able to determine the Font Uri of the actual font file.

    Is there any chance you could provide some hints on how to find the actual font file path as I am not finding any method that does that?


  2. text says:


    I’d like to know more about how your application decides which fonts to embed.

    Typeface and FontFamily objects returned by the font chooser dialog don’t always correspond to a single physical font file because of font fallback.

    There is a FontEmbeddingManager class that helps with gathering information about physical font files used by a series of GlyphRun objects, but I’m not sure if this will work for your scenario.

    A good place for asking detailed questions like this one is http://forums.microsoft.com/msdn/showforum.aspx?forumid=119&siteid=1, as it’s read and monitored by more people.


    Mikhail Leonov – MSFT

  3. Afifi says:


    I am trying to display some Arabic text in a TextBolck in a WPF window. When I use a font like Tahoma, the text is displayed fine. But when I use some font like "rekaa" (font file is rekaa.ttf), the Arabic text is displayed as rectangles!

    I tried installing the font and using it in Microsoft word and it works fine. I also tried embedding the font in the WPF application as a resource and using it but I got the same result.

    Can anybody tell me how to correct this problem?

    Thanks A lot


  4. WPF needs some built-in (or toolkit) controls for selecting fonts and colours. There’s a font dialog

  5. Hi, my name is Niklas Borson and I’m a developer on the DirectWrite team at Microsoft. DirectWrite has

  6. gcadmes says:

    Is the source code available for the Font Dialog you have pictured in the WPF Selection Model document?