A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
It is explained in MSDN at Use printer device fonts
You can use the same code in C# with P/Invoke ...
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm developing a WPF application (.NET FW 4.5) based on the idea to create a simple layout (text, shapes, pictures) for a specific printer device (using paper size, margin, color or b/n, etc).
I'm struggling with device fonts. For example, Zebra printers could use particular fonts which is not installed on the OS but only on the printer itself (or the driver, I'm not sure about this).
Is there a way to use device font in a WPF Application?
How can I enumerate the fonts supported by a specific printer?
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
It is explained in MSDN at Use printer device fonts
You can use the same code in C# with P/Invoke ...
Thank you for suggestion I used a very similar solution and now I'm able to collect all the font supported by devices.
Now I want to use the font in my WPF application.
I tried to use the following function:
Font newFont = Font.FromLogFont(myLogFont, hdcHandle);
//myLogFont is the LOGFONT structure assocated with device font
//hdcHandle is the HANDLE to printer device context
FromLogFont throws an exception because myLogFont is not of TrueType font.
Is there a way to use non TrueType font in WPF?