()
| 161 | |
| 162 | |
| 163 | def test_3933(): |
| 164 | path = os.path.normpath(f'{__file__}/../../tests/resources/test_3933.pdf') |
| 165 | with pymupdf.open(path) as document: |
| 166 | page = document[0] |
| 167 | print(f'{len(page.get_fonts())=}') |
| 168 | |
| 169 | expected = { |
| 170 | 'BCDEEE+Calibri': 39, |
| 171 | 'BCDFEE+SwissReSan-Regu': 53, |
| 172 | 'BCDGEE+SwissReSan-Ital': 20, |
| 173 | 'BCDHEE+SwissReSan-Bold': 20, |
| 174 | 'BCDIEE+SwissReSan-Regu': 53, |
| 175 | 'BCDJEE+Calibri': 39, |
| 176 | } |
| 177 | |
| 178 | for xref, _, _, name, _, _ in page.get_fonts(): |
| 179 | _, _, _, content = document.extract_font(xref) |
| 180 | |
| 181 | if content: |
| 182 | font = pymupdf.Font(fontname=name, fontbuffer=content) |
| 183 | supported_symbols = font.valid_codepoints() |
| 184 | print(f'Font {name}: {len(supported_symbols)=}.', flush=1) |
| 185 | assert len(supported_symbols) == expected.get(name) |
| 186 | |
| 187 | |
| 188 | def test_3780(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…