-
-
Notifications
You must be signed in to change notification settings - Fork 711
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
Handle y offset of glyphs #1958
Comments
Hi! That’s probably a bug in Harfbuzz. I don’t have the ITF Devanagari font, but I also have the bug in my browser, based on the same shaping libraries as WeasyPrint, on this page (but not in Chrome and Firefox). Could you please share the font by mail (for testing purpose, of course)? |
Thanks @liZe ! I am using ITF Devanagari font that is available by default on mac. I'm not sure if I can/should export and share it. html {
font-family: 'ITF Devanagari';
font-size: 22pt;
} <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Test</title>
</head>
<body>
<p>ङ्गु</p>
</body>
</html> and the python code I use html_01 = HTML(filename='./app/template/01-template.html')
css_01 = CSS(filename='./app/template/01-style.css')
pdf_01 = html_01.write_pdf(stylesheets=[css_01])
with open('../dist/01.pdf', 'wb') as f:
f.write(pdf_01) |
Thanks for sharing your HTML/CSS, but I can already reproduce without 😄.
Even if I can swear that I won’t use the font for anything but testing, even if it’s technically possible (the font is just a regular file that you can copy and share), even if it’s included in macOS by default, it’s probably illegal to share the font with me. The problem is that I can’t help you without this font 😒. If you don’t want to share the font, you can do the technical stuff I’d like to do, but it may be difficult, and obviously I don’t have a Mac to guide you! Here are the steps you can follow:
If you see the problem on the glyph, then it’s (probably) a bug in HarfBuzz and we should open a new issue on their bug tracker. If it’s correctly displayed, then we’ll have to dig further! |
Strange. I’m not sure that it’s the same font used for your two examples, but both work, so… Could you please share a PDF where the problem appears? |
sure! here you go - 01.pdf |
I’ve tried to find the reason why we have this bug, but without the font I can’t do much. If someone wants to share the font… |
thanks @liZe! would you be ok to share your email? |
You’ll find it on my profile. Thanks! |
Thanks! I've sent you an email. |
Thanks a lot, it really helped! The bug is in WeasyPrint, in Anyone intersted? It would be a nice first contribution for anyone with some Python knowledge who isn’t scared of reading specifications. 😄 I’ll help of course! |
Thanks @liZe! I would love to contribute! def set_rise(self, height):
"""Set rise."""
self.stream.append(_to_bytes(height) + b' Ts') Should I raise a PR in that repo first to include this change and then upgrade it in here (WeasyPrint) to use it? |
💜
Yes! You can call the function |
Hello! I am creating a pdf with weasyprint's html to pdf feature. I've gotten everything to work fine except for one specific set of combination of devanagari characters - in this case a glyph made up of conjunct consonant with vowel diacritics - e.g. ङ्गु - which is made up of ङ, ग and ु. It looks like
in
ITF Devanagari
font (in vscode or chrome or firefox browsers). The glyph is ङ, underneath that a partial ग and underneath that ुI am a loss of what should I be investigating. I’ve tried playing with css’ font feature settings but that doesn’t seem to have any effect. I'll appreciate any help to point me in the right direction or forum!
The text was updated successfully, but these errors were encountered: