@@ -101,7 +101,7 @@ def test_utf16m_sfnt():
101101 entry = next (entry for entry in fontManager .ttflist
102102 if Path (entry .fname ).name == "seguisbi.ttf" )
103103 except StopIteration :
104- pytest .skip ("Couldn't find font to test against." )
104+ pytest .skip ("Couldn't find seguisbi.ttf font to test against." )
105105 else :
106106 # Check that we successfully read "semibold" from the font's sfnt table
107107 # and set its weight accordingly.
@@ -111,14 +111,25 @@ def test_utf16m_sfnt():
111111def test_find_ttc ():
112112 fp = FontProperties (family = ["WenQuanYi Zen Hei" ])
113113 if Path (findfont (fp )).name != "wqy-zenhei.ttc" :
114- pytest .skip ("Font may be missing" )
115-
114+ pytest .skip ("Font wqy-zenhei.ttc may be missing" )
116115 fig , ax = plt .subplots ()
117116 ax .text (.5 , .5 , "\N{KANGXI RADICAL DRAGON} " , fontproperties = fp )
118117 for fmt in ["raw" , "svg" , "pdf" , "ps" ]:
119118 fig .savefig (BytesIO (), format = fmt )
120119
121120
121+ def test_find_noto ():
122+ fp = FontProperties (family = ["Noto Sans CJK SC" , "Noto Sans CJK JP" ])
123+ name = Path (findfont (fp )).name
124+ if name not in ("NotoSansCJKsc-Regular.otf" , "NotoSansCJK-Regular.ttc" ):
125+ pytest .skip (f"Noto Sans CJK SC font may be missing (found { name } )" )
126+
127+ fig , ax = plt .subplots ()
128+ ax .text (0.5 , 0.5 , 'Hello, 你好' , fontproperties = fp )
129+ for fmt in ["raw" , "svg" , "pdf" , "ps" ]:
130+ fig .savefig (BytesIO (), format = fmt )
131+
132+
122133def test_find_invalid (tmpdir ):
123134 tmp_path = Path (tmpdir )
124135
0 commit comments