Answer the question
In order to leave comments, you need to log in
How to implement automatic selection of a font that supports a given language?
Good day.
Using ImageMagick in php, I generate a picture with text. The problem is that I do not know in advance what text will need to be written on the picture (it will be substituted dynamically) and I do not know what language it will be in. That is, if I set, for example, the Helvetica font for this inscription and then I need to write the text in Chinese, then we will get only question marks. How to fix this problem? And is it possible to somehow find out in the code whether a particular font supports a particular character?
Yes, there is Noto which supports all languages. However, each language has its own .ttf font and the problem with choosing a font does not go away. And I haven't seen one .ttf file that would support all languages...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question