I have a similar question to this one
However, I have a less strict requirement.
All I need is to detect if the input string contains any non alphabetic string.
If it does contain non-alphabetic string, then I will select a different font file.
if it contains ONLY alphabetic string, then I will select a font file like AmericanTypeWriter.
By alphabetic string, that would include all kinds of possible symbols such as commas, punctuations, etc.
It is hard to define alphabetic string.
Let me define what is an example of non-alphabetic string.
这是中文
And assuming utf-8 format for the string.
Another way to define: anything that does not fall under non-European language character, is automatically assumed to be alphabetic string.
I need to do this detection in php by the way.