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

Non-printing characters support #1508

Closed
mrunderline opened this issue Nov 27, 2021 · 6 comments
Closed

Non-printing characters support #1508

mrunderline opened this issue Nov 27, 2021 · 6 comments
Labels
bug Existing features not working as expected
Milestone

Comments

@mrunderline
Copy link

we are using weasyprint(53.0) to generate persian pdf and have problem with thin-space (or half-space).
here is some examples:
this one taken in webview mode:
Screenshot from 2021-11-27 11-32-18
and this one is after generating a pdf with weasyprint:
Screenshot from 2021-11-27 11-32-24

as you can see, the pdf result has some some problem with thin-space. I also try to change my font to solve this problem, but nothing happen. would you please help me to solve this problem?

@liZe
Copy link
Member

liZe commented Nov 27, 2021

would you please help me to solve this problem?

I think that the problem is caused by alignment, not by the thin-space character. Could you please share an HTML+CSS sample that causes the problem?

@mrunderline
Copy link
Author

css:

h2 {
  border: 1px solid #ccc;
  padding: 3mm;
}

html:

<h2>کارشناسی ارشد ناپیوسته</h2>
<h2>کارشناسی‌ارشد ناپیوسته</h2>

result:
Screenshot from 2021-11-27 15-39-14

@liZe
Copy link
Member

liZe commented Nov 28, 2021

Oh, you’re right, there’s a problem because of this space. Let’s find what!

@liZe
Copy link
Member

liZe commented Nov 28, 2021

The culprit character is not a thin space, it’s a zero-width non-joiner. This character is a non-printing character, and there’s a bug with these characters in WeasyPrint.

@liZe liZe changed the title thin-space support Non-printing characters support Nov 28, 2021
@liZe liZe added the bug Existing features not working as expected label Nov 28, 2021
@liZe liZe added this to the 54.0 milestone Nov 28, 2021
@liZe liZe closed this as completed in 424f080 Nov 28, 2021
@liZe
Copy link
Member

liZe commented Nov 28, 2021

Thanks a lot for this bug report! It’s now fixed and tested.

@mrunderline
Copy link
Author

thanks a lot, i'm so eager for new version! 🤘🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants