Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Underline not rendered correctly. #609
What steps will reproduce the problem?
Save this font.
What is the expected output? What do you see instead?
What version of dompdf are you using? What version of PHP? On what
Please provide the HTML source code you want to convert, or any additional
Any underlined text will do.
I was using an older version of dompdf and I tried to underline that font. The result was a to thin underline and way below the text. But the text was at top as it should have been.
I updated to the latest version and now the underline is OK, but the text is where the old underline was.
The commit that fixed the underline and broke the text is 17446bc.
while the wrong one had
The same day this was commited, March 25th of last year, a change for php-font-lib was done too. Reverting the change for php-font-lib was how I actually generated the correct pdf. Now both the underline is in the right position and has the right thickness and the text is in the right position too.
But I don't know what that could brake either.
Still not as it should, because if I write something with "p" for example the underline is bellow the text and does't cut the "p" as it should.
Hey, I found this issue and I got nearly the same problem. I've inserted Open Sans from the google fonts into my document with this link tag:
In an older version I edited the file OpenSans-Regular.ufm.php to have these values:
'UnderlineThickness' => '50',
How can I change the UnderlinePosition for a font that is inserted via the html document with a font-face statement in the css part?
I'm happy to get some information on how to solve this.
@inbaz I tried edit .ufm.php file in vendor directory and this work for me too.
My font is Garuda and Initial UnderlinePosition value is -32. I need change it to -1100 for make it look good in my pdf.
Thank you for point out this info. It help me a lot. :)
Update: After I use it. This solution is just temporary for underline only. It will not work with line-through.
Currently this line don't have proper value. I think we expect
For this older commit. Just as you see. These code use Ascender and Decender value to shift
For me I like that lastest implement that make