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

The picture does not match the text #77

Closed
Alkamenos opened this issue Oct 26, 2014 · 7 comments
Closed

The picture does not match the text #77

Alkamenos opened this issue Oct 26, 2014 · 7 comments

Comments

@Alkamenos
Copy link

Maybe am I doing something wrong? My HTML does not match the picture. Can you help me?http://jsfiddle.net/Alkamenos/jov9kojf/

@cburgmer
Copy link
Owner

Are you speaking of the padding? Does the following fix it? http://jsfiddle.net/cburgmer/jov9kojf/1/

It seems that HTML snippets passed to drawHtml() should not get the default padding the browser applies to the body element.

@Alkamenos
Copy link
Author

Thanks! I was not attentive! :)

@Alkamenos
Copy link
Author

http://jsfiddle.net/cburgmer/jov9kojf/1/
The second line from the bottom does not match.

@cburgmer
Copy link
Owner

Font rendering is a pretty complex thing and AFAIK much of that is delegated to the host operating system. It might be difficult to find an easy work-around for this issue here. If you look at http://jsfiddle.net/jov9kojf/2/ the overlay shows that beginning with the first list of f's the character stream is offset by one character in Chrome. Firefox renders a near complete match, only the line under the text is offset by a pixel. There might be some CSS properties that can influence that.

@cburgmer
Copy link
Owner

It looks like font-kerning: normal fixes your issue: http://jsfiddle.net/jov9kojf/3/ From what I understand the default auto allows the browser to optimize and disable kerning.

Setting it by default though might not be a good idea as the browser is allowed to disable kerning for "normal" rendering (unless explicitly set in CSS), so that overwriting it for drawHtml() will again diverge.

@Alkamenos
Copy link
Author

It's resolving the issue. Thank you for help and for your library!

@cburgmer
Copy link
Owner

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

No branches or pull requests

2 participants