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

DPI inconsistency #255

Open
trichview opened this issue Mar 2, 2019 · 1 comment
Open

DPI inconsistency #255

trichview opened this issue Mar 2, 2019 · 1 comment

Comments

@trichview
Copy link

When reading CSS sizes specified in pt, in, cm, mm, pc, THTMLViewer uses Screen.PixelsPerInch to convert sizes to pixels.
But when reading CSS sizes specified in px, Screen.PixelsPerInch is ignored, pixels are read as they are.
So, if Screen.PixelsPerInch <> 96, sizes are inconsistent.

But HTML assumes that pixels have 96 dpi.

Suggested change in function LengthConv:

...
else if U = 'px' then 
 V := V * Screen.PixelsPerInch / 96
...

However, this is not a complete fix. HTML may contain pixel sizes not only here, but also in other places (table CellPadding, Border, etc.)

@BerndGabriel
Copy link
Owner

Does commit [https://github.com/BerndGabriel/HtmlViewer/commit/6e78be76882a2ec6fc28a03564d15bffefa285a2] fix this issue in master branch?

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