Automatic Chinese fonts plotting (#4951)

* Automatic Chinese fonts plotting

* Default PIL=False
This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-09-27 13:48:15 -07:00
1 parent c5ba2abb4a
commit a820b43aca
4 files changed
+18 -20

No files matched your search

+3 -4
View File
@@ -161,10 +161,9 @@ def is_pip():
return 'site-packages' in Path(__file__).resolve().parts
def is_ascii(s=''):
# Is string composed of all ASCII (no UTF) characters?
s = str(s) # convert list, tuple, None, etc. to str
return len(s.encode().decode('ascii', 'ignore')) == len(s)
def is_chinese(s='人工智能'):
# Is string composed of any Chinese characters?
return re.search('[\u4e00-\u9fff]', s)
def emojis(str=''):