We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca1a0ac commit 25bafa5Copy full SHA for 25bafa5
1 file changed
tests/test_general.py
@@ -2221,3 +2221,25 @@ def test_4928():
2221
except Exception as e:
2222
print(f'Ignoring expected exception: {e}')
2223
2224
+def test_4902():
2225
+ print()
2226
+ with pymupdf.open() as doc:
2227
+ page = doc.new_page()
2228
+ text = 'Hello World'
2229
+ bw = 0.4
2230
+ fontsize = 20
2231
+ page.insert_text(
2232
+ (72, 72),
2233
+ text,
2234
+ fontsize=fontsize,
2235
+ render_mode=2,
2236
+ color=(1, 0, 0),
2237
+ fill=(0, 1, 0),
2238
+ border_width=bw,
2239
+ )
2240
+ data = doc.tobytes()
2241
+ with pymupdf.open('pdf', data) as doc:
2242
+ page = doc[0]
2243
+ spans = page.get_texttrace()
2244
+ for span in spans:
2245
+ print(f'test_4902(): {span["linewidth"]=}, should be {bw*fontsize=}.')
0 commit comments