-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
draw_rect: does not respect width if color is not specified, and possible doc issue #1913
Comments
I found this: https://pymupdf.readthedocs.io/en/latest/shape.html#commonparms Reading between the lines, I can guess what is happening from:
Notes:
|
Hmmm, if I don't specify color then each PDF viewer gets to make a possibly different decision about what width to use. Is that so? |
It might be so, but it would nonetheless be a bug: the default color by the books is black. |
Next version will correct this: |
subset_fonts(): added `verbose` arg.
…1913, pymupdf#1909 Changes to: jm_checkquad(), trace_lineto(), trace_close(), jm_trace_text_span().
subset_fonts(): added `verbose` arg.
…1913, pymupdf#1909 Changes to: jm_checkquad(), trace_lineto(), trace_close(), jm_trace_text_span().
Changing the default value of "color" parameter from None to (0,) causes color "black" if letting default it. New verbose parameter in Document,subset_fonts suppresses messages by default.
…1913, pymupdf#1909 Pertain to 2 issues: False detection of rectangles, leading to too many triples of consecutive "line" commands being converted to "rect" items in the returned dictionary. We now only accept exactly 3 consecutive "line" commannds followed by "close path" to be a "rect candidate. This can no longer ever happen within function "jm_checkquad()". Calculating the font size in function "jm_trace_text_span" was incorrect and leading to wrong results if properties "a" and "d" of the text matrix (scaling factors in matrix "trm") are different. Changed to sqrt(a * d) - the geometric mean of the two.
Changing the default value of "color" parameter from None to (0,) causes color "black" if letting default it. New verbose parameter in Document.subset_fonts() suppresses messages by default.
Changing the default value of "color" parameter from None to (0,) causes color "black" if letting default it. New verbose parameter in Document.subset_fonts() suppresses messages by default.
Fixed in 1.21.0 |
Width alone does not change width [1], although from looking at our other code it looks like we were already aware of this. [1] pymupdf/PyMuPDF#1913
The last box has the default width, same as if the width
kwarg
was not specified.But perhaps it is supposed to be this way: not wanting to embarrass myself I went to RTFM:
So I clicked on the
Shape.draw_rect
link but the arguments were not documented there either. I guess I didn't try that hard but within 2 or 3 mins I was not able to find documentation about howwidth
andcolor
are supposed to interact.The text was updated successfully, but these errors were encountered: