@@ -185,6 +185,32 @@ def test_font_get_missing_glyphs_cmap_encoding_2():
185185 assert missing_glyphs == {"é" }
186186
187187
188+ def test_font_get_missing_glyphs_cmap_encoding_3 ():
189+ font_cmap_encoding_3 = Path (os .path .join (os .path .dirname (dir_path ), "file" , "fonts" , "微软简标宋 - PlatEncID 3.TTF" ))
190+ font_file = FontFile .from_font_path (font_cmap_encoding_3 )
191+
192+ assert len (font_file .font_faces ) == 1
193+ font_face = font_file .font_faces [0 ]
194+ assert isinstance (font_face , NormalFontFace )
195+
196+ # Try "ヲ" since cp936 doesn't support this char
197+ missing_glyphs = font_face .get_missing_glyphs ("AÉé㈤ヲ" )
198+ assert missing_glyphs == {"É" , "ヲ" }
199+
200+
201+ def test_font_get_missing_glyphs_cmap_encoding_4 ():
202+ font_cmap_encoding_4 = Path (os .path .join (os .path .dirname (dir_path ), "file" , "fonts" , "文鼎中特廣告體 - PlatEncID 4.ttf" ))
203+ font_file = FontFile .from_font_path (font_cmap_encoding_4 )
204+
205+ assert len (font_file .font_faces ) == 1
206+ font_face = font_file .font_faces [0 ]
207+ assert isinstance (font_face , NormalFontFace )
208+
209+ # Try "ヲ" since cp950 doesn't support this char
210+ missing_glyphs = font_face .get_missing_glyphs ("é¥卷ヲ" )
211+ assert missing_glyphs == {"é" , "ヲ" }
212+
213+
188214def test_font_get_missing_glyphs_cmap_legacy_arabic_simplified ():
189215 font_path = Path (os .path .join (os .path .dirname (dir_path ), "file" , "fonts" , "legacy-arabic-simplified-SimplifiedArabic.ttf" ))
190216 font_file = FontFile .from_font_path (font_path )
0 commit comments