File: test_badfonts.py

package info (click to toggle)
pymupdf 1.25.4%2Bds1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 98,632 kB
  • sloc: python: 43,379; ansic: 75; makefile: 6
file content (15 lines) | stat: -rw-r--r-- 396 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 pymupdf


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