Skip to content

Instantly share code, notes, and snippets.

View mdelhoneux's full-sized avatar

Miryam de Lhoneux mdelhoneux

View GitHub Profile
@mbollmann
mbollmann / unicode_scripts.py
Created March 2, 2022 14:12
Access Unicode Script property in Python & find out which script(s) a string contains
#!/usr/bin/env python3
# Unicode characters are neatly categorized into different "scripts", as seen on
# the character code chart <http://www.unicode.org/charts/#scripts> and defined
# in Annex #24 <https://www.unicode.org/reports/tr24/>.
#
# Unfortunately, Python's unicodedata module doesn't provide access to this
# information. However, the fontTools library does include this.
# <https://github.com/fonttools/fonttools>
#