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

Underline text decoration with Liberation Sans too thick #319

Open
smfukaya opened this issue May 5, 2024 · 2 comments
Open

Underline text decoration with Liberation Sans too thick #319

smfukaya opened this issue May 5, 2024 · 2 comments

Comments

@smfukaya
Copy link

smfukaya commented May 5, 2024

Hi,

Flying Saucer 9.7.2 is producing a very thick underline text decoration from an HTML with a "underline" element (<u></u>) using Liberation Sans (it has a underline thickness of 150 — tested with 2.00.5 and 2.1.5 that I built myself).

20240505_124856-Flying Saucer 9 7 2 - Liberation Sans - very thick underline

I compared it to Open HTML to PDF 1.0.10 and found out that it hard codes the underline thickness to 50 in order to produce a more pleasant decoration.

20240505_124911-Open HTML to PDF 1 0 10 - hard-coded underline thickness

Could you please confirm if the Flying Saucer behavior is expected and if so could you advise me on any workaround.

Best regards,
Sergio

@asolntsev
Copy link
Contributor

@smfukaya I don't the background of underline sickness, but I see "50" is hardcoded in FS code:

image

Also, I see that FS can read this number from the font definition (*.ttf files).

@smfukaya
Copy link
Author

smfukaya commented May 5, 2024

Hi @asolntsev ,

Thank you for your quick reply. The problem is that, at runtime, the default thickness value is being overridden by Liberation Sans 150 value for thickness.

FontForge: Liberation Sans 2.00.5

20240505_134753-FontForge - Liberation Sans v2 00 5 - Underline Thickness

FontForge: Liberation Sans 2.1.5

20240505_135005-FontForge - Liberation Sans v2 1 5 - Underline Thickness

Best Regards,
Sergio

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

No branches or pull requests

2 participants