File: test_badfonts.py

package info (click to toggle)
pymupdf 1.21.1%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 13,404 kB
  • sloc: python: 8,737; makefile: 8
file content (15 lines) | stat: -rw-r--r-- 390 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""
Ensure we can deal with non-Latin font names.
"""
import os

import fitz


def test_survive_names():
    scriptdir = os.path.abspath(os.path.dirname(__file__))
    filename = os.path.join(scriptdir, "resources", "has-bad-fonts.pdf")
    doc = fitz.open(filename)
    print("File '%s' uses the following fonts on page 0:" % doc.name)
    for f in doc.get_page_fonts(0):
        print(f)