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

Font kerning non fixed upon zooming #3250

Open
7 tasks
EliotRagueneau opened this issue Jun 18, 2024 · 11 comments
Open
7 tasks

Font kerning non fixed upon zooming #3250

EliotRagueneau opened this issue Jun 18, 2024 · 11 comments
Labels
browser-bug A problem in the browser itself

Comments

@EliotRagueneau
Copy link
Contributor

Environment info

  • Cytoscape.js version : 3.9.2
  • Browser/Node.js & version : Arc Browser 1.47.1

Current (buggy) behaviour

What does the bug do?

The font seems to change the kerning upon reaching a certain threshold of zooming.

FontKernelBug.mov

Desired behaviour

It should be consistent (Ideally with the situation when zoomed out, as it seems closer to the definitions).

Minimum steps to reproduce

Unfortunately I wasn't able to reproduce the issue in the demo

For reviewers

Reviewers should ensure that the following tasks are carried out for incorporated issues:

  • Ensure that the reporter has included a reproducible demo. They can easily fork this JSBin demo: http://jsbin.com/fiqugiq
  • The issue has been associated with a corresponding milestone.
  • The commits have been incorporated into the corresponding branches. Bug-fix patches go on
    • master,
    • unstable, and
    • the previous feature release branch (e.g. 1.1.x if the current release is 1.2).
  • The issue has been labelled as a bug, if necessary.
@EliotRagueneau EliotRagueneau added the bug A bug in the code of Cytoscape.js label Jun 18, 2024
@maxkfranz
Copy link
Member

If you change the font to something like Helvetica Neue or Courier, do you still see this behaviour?

@EliotRagueneau
Copy link
Contributor Author

It does somehow:

CourierBugging.mov

@maxkfranz
Copy link
Member

maxkfranz commented Jun 27, 2024

Some fonts render differently at different scales generally. Often you would not notice, because the changes from small changes in zoom level would be slight.

Cytoscape uses visual caches. What you're seeing is a step function change in how the font is rendered rather than a smoother transition, because the cache is not used (or useful) when zoomed in very far.

Given that the cache gives significant performance improvements and the changing the cache to accommodate fonts that vary widely would be expensive, it may be best to make a careful choice of font that wouldn't have this problem.

Which font face are you using?

@EliotRagueneau
Copy link
Contributor Author

I am using Roboto font.

@maxkfranz
Copy link
Member

Open Sans is similar but does not exhibit this issue, as far as I'm aware.

@EliotRagueneau
Copy link
Contributor Author

I really tried to repoduce the issue on the fiddle, but I couldn't manage to reproduce there, but in my usage context, its consistently happening on the same nodes, and is most visible when the text is overflowing the max width, see

I did try many fonts, and the problem is present with all of them :/

@EliotRagueneau
Copy link
Contributor Author

I noticed that the font problem occurs when zoom level is exactly bellow 1.
Maybe that can help understand the origin of the problem

@EliotRagueneau
Copy link
Contributor Author

Open Sans is similar but does not exhibit this issue, as far as I'm aware.

Still the problem is there in my context

@maxkfranz
Copy link
Member

The bug isn't reproducible in Safari

@EliotRagueneau
Copy link
Contributor Author

EliotRagueneau commented Jul 9, 2024

From what I could see, it's a problem on Chrome and Chromium based browsers like Arc. Firefox and Safari do not have the issue

@maxkfranz
Copy link
Member

maxkfranz commented Jul 9, 2024 via email

@maxkfranz maxkfranz added browser-bug A problem in the browser itself pinned A long-lived issue, such as a discussion and removed bug A bug in the code of Cytoscape.js labels Jul 22, 2024
@maxkfranz maxkfranz removed the pinned A long-lived issue, such as a discussion label Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser-bug A problem in the browser itself
Projects
None yet
Development

No branches or pull requests

2 participants