Tofu detection

Sample strings used here is language autonyms. But the text to test can be anything.

Choose Algorithm

Default algorithm - Compare the dimensions of first characters, if the dont change, assume tofu.
Use tofu font - A font that claims to support every character in Unicode and maps them all the the .notdef glyph, which happens to have a very large width (10em). Then set that font for the text to check as a fallback font. If no fonts are found on the system, you would get the tofu font, which is easy to detect given the unusual width.