Assert a valid PDF fontname.
()
| 46 | |
| 47 | |
| 48 | def test_fontname(): |
| 49 | """Assert a valid PDF fontname.""" |
| 50 | doc = pymupdf.open() |
| 51 | page = doc.new_page() |
| 52 | assert page.insert_font() # assert: a valid fontname works! |
| 53 | detected = False # preset indicator |
| 54 | try: # fontname check will fail first - don't need a font at all here |
| 55 | page.insert_font(fontname="illegal/char", fontfile="unimportant") |
| 56 | except ValueError as e: |
| 57 | if str(e).startswith("bad fontname chars"): |
| 58 | detected = True # illegal fontname detected |
| 59 | assert detected |
| 60 | |
| 61 | def test_2608(): |
| 62 | flags = (pymupdf.TEXT_DEHYPHENATE | pymupdf.TEXT_MEDIABOX_CLIP) |
nothing calls this directly
no test coverage detected
searching dependent graphs…