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

Underlined text? #132

Open
Joeboy opened this issue Feb 27, 2023 · 2 comments
Open

Underlined text? #132

Joeboy opened this issue Feb 27, 2023 · 2 comments

Comments

@Joeboy
Copy link

Joeboy commented Feb 27, 2023

Hi! Thanks for this lib, which I'm currently using via genpdf.

I couldn't see a way to underline text, using either genpdf or printpdf? Any chance of supporting that, or documenting it if it's already supported in some way I haven't found? Thanks!

@fschutt
Copy link
Owner

fschutt commented Feb 28, 2023

as far as I'm aware, underlines are not a PDF feature, you'd need to calculate underlines manually using a text shaping crate

@Joeboy
Copy link
Author

Joeboy commented Mar 3, 2023

Thanks, I hadn't understood how fiddly it is to do this with the native pdf format. In case anybody's interested, I ended up doing it in a "pragmatic" (ie. nasty and hackish) way by forking both genpdf and printpdf, and printing underscores over the underlined chars. Which will only work right with a monospace font, but as it happens that's all I need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants