O
O
Oleg Pogrebnyak2016-05-25 21:42:17
C++ / C#
Oleg Pogrebnyak, 2016-05-25 21:42:17

Checking if a font exists (c# wf)?

There is a text output:

e.Graphics.DrawString(output, new Font("QUARTZ MS", 14), brush, point);

The problem is that on some computers the font I need is called "QUARTZ" and on others it's called "QUARTZ MS".
Is there some condition to check if the font is present on the computer?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
#
#algooptimize #bottize, 2016-05-25
@S0HardCore

Option 1 - get a list of all fonts in Windows, check for the presence of the required one (google)
Option 2 - try to create the desired one once and determine whether it exists or not, this will work if an exception occurs.
Were these options considered, if so, what is the difficulty?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question