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

Vertical text position is different between Safari and other browsers #1751

Open
kiguri opened this issue Apr 29, 2024 · 5 comments
Open

Vertical text position is different between Safari and other browsers #1751

kiguri opened this issue Apr 29, 2024 · 5 comments

Comments

@kiguri
Copy link

kiguri commented Apr 29, 2024

As shown below, on the left is Safari, on the right is Edge, the word "Grandma" has a different vertical position. This leads to all browsers on IOS (using the Safari kernel) being different from Android
Screenshot 2024-04-29 at 10 22 41

@lavrton
Copy link
Member

lavrton commented Apr 29, 2024

Please provide a minimal online demo. What font you used?

@Adam-Greenan
Copy link

Adam-Greenan commented May 1, 2024

I'd like to bump this, we have the exact same problem.

Each browser chrome, edge, firefox and safari all render text slightly differently on the y-offset.

We haven't found a possible solution to this issue yet that viable without manually creating an offset for each browser, on each font - even that is primitive, hardcoded and is never perfect.

My issue raised similar questions when using konva-node, but the same issue is present in konva react on a regular frontend.

Every font, either served via our website, inbuilt from the system or even compiled into the react app directly, all have different rendering differences between browsers.

#1694

@Adam-Greenan
Copy link

Adam-Greenan commented May 8, 2024

https://codesandbox.io/p/devbox/konva-konva-react-text-location-rendering-on-different-browser-devices-issue-https-github-com-konvajs-konva-issues-1751-z2kkpw?file=%2Fsrc%2FApp.jsx%3A43%2C44

I've prepared a brief demonstration of the problem in CodeSandbox.

Moreover, I've included several screenshots showcasing how the text rendering varies vertically across different browsers and devices. This inconsistency persists regardless of the font used—whether native to the browser, downloaded directly from the web, or from Google Fonts.

Here's a screenshot taken on Google Chrome for macOS, the platform where the demo was developed:
Screenshot 2024-05-08 at 13 52 23

Similarly, here's another screenshot from the same macOS device, but this time using Safari:
Screenshot 2024-05-08 at 13 56 13

This inconsistency persists across various browsers and devices.

I trust these visuals effectively illustrate the issue.

Expanding on this issue:

Not only does the problem persist with different fonts, but it also extends to varying font sizes. Interestingly, the same fontFamily, when used with different font sizes, exhibits larger vertical gaps with larger font sizes compared to smaller ones.

Moreover, each fontFamily has its own distinct degree of vertical variance, with some fonts showcasing more pronounced inconsistencies than others. This further complicates the matter and underscores the need for a comprehensive solution.

@Adam-Greenan
Copy link

Bump

@lavrton
Copy link
Member

lavrton commented May 16, 2024

Please take a look into this comment: #559 (comment)
I need a help with testing. I hope that will fix the issue.

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

3 participants