string textToCheck =
"Russian: Русский Текст. Greek: Κείμενο στην ελληνική γλώσσα. Japanese (unrepresentable): 日本";
// see the code example in ImGearPDEText.Add
ImGearPDEFont fontSerif = CreateFont("Times-Roman", "Type0", "Identity-H");
// Ensure that the text is fully representable by the font.
// Add a warning if not.
if (!fontSerif.IsTextRepresentable(textToCheck))
{
System.Collections.Generic.IEnumerable<char> unrepresentableChars =
fontSerif.FindUnrepresentableCharacters(textToCheck);
string unrepresentableCharsString = String.Empty;
foreach (char unrepresentableChar in unrepresentableChars)
{
if (unrepresentableCharsString != String.Empty)
{
unrepresentableCharsString += ",";
}
unrepresentableCharsString += unrepresentableChar;
}
MessageBox.Show(
string.Format(
"The selected font, {0}, does not support the following characters: [{1}]",
fontSerif.GetAttributes().Name.String, unrepresentableCharsString));
}