def categoryForGlyphName(self, glyphName, allowPseudoUnicode=True): """ Get the category for **glyphName**. If **allowPseudoUnicode** is True, a pseudo-Unicode value will be used if needed. This will return *None* if nothing can be found. """ if allowPseudoUnicode: value = self.pseudoUnicodeForGlyphName(glyphName) else: value = self.unicodeForGlyphName(glyphName) if value is None: return "Cn" return unicodeTools.category(value)
def test_category(self): self.assertEqual(category(ord("a")), "Ll") self.assertEqual(category(0x0001000), "Lo")