Skip to content
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

char need an attr linewidth #1137

Open
xuehuiareafred opened this issue May 9, 2024 · 4 comments
Open

char need an attr linewidth #1137

xuehuiareafred opened this issue May 9, 2024 · 4 comments
Labels
feature-request All feature requests receive this label initially, can be upgraded to "enhancement"

Comments

@xuehuiareafred
Copy link

image
add code: attr["linewidth"] = gs.linewidth
because some char use some font but add bold, maybe use linewidth can distinguish that.

thank you!

@xuehuiareafred xuehuiareafred added the feature-request All feature requests receive this label initially, can be upgraded to "enhancement" label May 9, 2024
@jsvine
Copy link
Owner

jsvine commented May 16, 2024

It is my understanding that line width applies only to paths, not to text. See, e.g., from the PDF reference:

Screenshot

Do you (or anyone else reading this) have a different understanding?

@xuehuiareafred
Copy link
Author

Thanks for your reply!
In my opinion "The line width parameter specifies the thickness of the line used to stroke a path" has two condition。one is the line's thickness, the other is the char's thickness. because pdfminer.six char has the attr line width, and bold char without bold font has bigger line width than common char。

@xuehuiareafred
Copy link
Author

line_width.pdf
my test result:
<PDFGraphicState: linewidth=0.12, linecap=2, linejoin=2, miterlimit=2, dash=None, intent=None, flatness=None, stroking color=(0, 0, 0), non stroking color=(0, 0, 0)>

NERFFC+HYShuSongErKW
10.449999999999932
<PDFGraphicState: linewidth=0.12, linecap=2, linejoin=2, miterlimit=2, dash=None, intent=None, flatness=None, stroking color=(0, 0, 0), non stroking color=(0, 0, 0)>

NERFFC+HYShuSongErKW
10.449999999999932
<PDFGraphicState: linewidth=0.12, linecap=2, linejoin=2, miterlimit=2, dash=None, intent=None, flatness=None, stroking color=(0, 0, 0), non stroking color=(0, 0, 0)>

NERFFC+HYShuSongErKW
10.449999999999932
<PDFGraphicState: linewidth=0.29887, linecap=2, linejoin=2, miterlimit=2, dash=None, intent=None, flatness=None, stroking color=(0, 0, 0), non stroking color=(0, 0, 0)>

NERFFC+HYShuSongErKW
10.449999999999932
<PDFGraphicState: linewidth=0.29887, linecap=2, linejoin=2, miterlimit=2, dash=None, intent=None, flatness=None, stroking color=(0, 0, 0), non stroking color=(0, 0, 0)>

NERFFC+HYShuSongErKW
10.449999999999932
<PDFGraphicState: linewidth=0.29887, linecap=2, linejoin=2, miterlimit=2, dash=None, intent=None, flatness=None, stroking color=(0, 0, 0), non stroking color=(0, 0, 0)>

@jsvine
Copy link
Owner

jsvine commented May 21, 2024

Thank you for this helpful example. I'll investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request All feature requests receive this label initially, can be upgraded to "enhancement"
Projects
None yet
Development

No branches or pull requests

2 participants