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

Give option to remove hyphen when text wraps to a new line #1679

Closed
4 tasks done
RichMatthews opened this issue Dec 8, 2023 · 3 comments
Closed
4 tasks done

Give option to remove hyphen when text wraps to a new line #1679

RichMatthews opened this issue Dec 8, 2023 · 3 comments
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@RichMatthews
Copy link

RichMatthews commented Dec 8, 2023

Before you start - checklist

  • I followed instructions in documentation written for my React-PDF version
  • I have checked if this bug is not already reported
  • I have checked if an issue is not listed in Known issues
  • If I have a problem with PDF rendering, I checked if my PDF renders properly in PDF.js demo

Description

I have an issue when displaying an email in a pdf. when it wraps over to a new line it adds a hyphen.
test@gmail.com
becomes

test@gm-
ail.com

so now it looks like the email contains a - when of course, it does not.

how is this fixed in react-pdf? I don't immediately see any good solution.

Font.registerHyphenationCallback(word => {
  // Return entire word as unique part
  return [word];
});

doesn't seem to work as it applies it to all text but I just want it applied specifically to one string

Steps to reproduce

Render a string and cause it to wrap over multiple lines

Expected behavior

the option to at least say, do not show a hyphen

Actual behavior

it shows a hyphen

Additional information

No response

Environment

  • Browser (if applicable):
  • React-PDF version:
  • React version:
  • Webpack version (if applicable):
@RichMatthews RichMatthews added the bug Something isn't working label Dec 8, 2023
@RichMatthews RichMatthews changed the title Remove hyphen when text wraps to a new line Give option to remove hyphen when text wraps to a new line Dec 8, 2023
@SunnySze0000
Copy link

+1

@RichMatthews
Copy link
Author

@wojtekmaj any solution for this?

@wojtekmaj
Copy link
Owner

It looks like you confused React-PDF with @react-pdf/renderer. Please file an issue in their repo instead.

@wojtekmaj wojtekmaj closed this as not planned Won't fix, can't repro, duplicate, stale Jan 25, 2024
@wojtekmaj wojtekmaj added the invalid This doesn't seem right label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants