MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / test_2645

Function test_2645

tests/test_general.py:321–333  ·  view source on GitHub ↗

Assert same font size calculation in corner cases.

()

Source from the content-addressed store, hash-verified

319
320
321def test_2645():
322 """Assert same font size calculation in corner cases.
323 """
324 folder = os.path.join(scriptdir, "resources")
325 files = ("test_2645_1.pdf", "test_2645_2.pdf", "test_2645_3.pdf")
326 for f in files:
327 doc = pymupdf.open(os.path.join(folder, f))
328 page = doc[0]
329 fontsize0 = page.get_texttrace()[0]["size"]
330 fontsize1 = page.get_text("dict", flags=pymupdf.TEXTFLAGS_TEXT)["blocks"][0]["lines"][
331 0
332 ]["spans"][0]["size"]
333 assert abs(fontsize0 - fontsize1) < 1e-5
334
335
336def test_2506():

Callers

nothing calls this directly

Calls 2

get_texttraceMethod · 0.80
get_textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…