Assert same font size calculation in corner cases.
()
| 319 | |
| 320 | |
| 321 | def 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 | |
| 336 | def test_2506(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…