Skip to content

Defining variable fonts #248410

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

Draft
wants to merge 234 commits into
base: main
Choose a base branch
from
Draft

Defining variable fonts #248410

wants to merge 234 commits into from

Conversation

aiday-mar
Copy link
Contributor

@aiday-mar aiday-mar commented May 8, 2025

points to test:

  • verify that when selecting a word like export, all other instances in the modified lines are highlighted correctly
  • check that we are able to scroll the full expanded text, especially after reload
  • verify that cmd+hover makes the correct quiggle appear
  • verify sticky scroll rendering is correct
  • make sure that whitespaces are correctly rendered
  • check that when moving with the cursor, the cursor and character positions are correctly aligned
  • check that multi-line selection is correctly rendered
  • check that multi-cursor is correctly rendered
  • check what happens when the font size is larger than the line height
    • line height overflow is hidden
  • make ghost text the same size as the text to the immediate left of it
  • verify parameter hints are correctly rendered
  • check can define several different font infos on line
  • verify rendering is correct when accessibility is turned on
    • decided to disable it when screen reader optimized, see below.
  • check what happens when ranges for font infos intersect
    • non deterministic behavior, when ranges intersect, the first range in the array takes precedence for the font info
  • check what happens when the font size is smaller than the normal font size
  • verify that when typing rendering is correct, there are no errors
  • evaluate indent guides
    • The indent guides are not correctly aligned with the lines of variable font size. If they were to be, the lines would be diagonal which would not look good. So indent guides don't need to be adapted.
  • ignore font size and font family decorations when in diff editor
  • verify that IME input is the correct size
    • with experimental edit context
    • with initial edit context
      • The ime is not correctly sized on a line that has variable font size
  • verify that when adding new line from within modified line, the height is adapted correctly and synchronously with the line height. Currently the font size overflows, while the line height is shorter
  • verify that when word wrap is toggled on, and the window is resized down, the text is correctly wrapped
  • verify the font is correctly rendered on cutting and pasting
  • test on checker.ts and that there is no performance lag

Points to discuss

Placement of spans within view line

By default the spans are placed so that the bottom line of the spans are aligned. This makes for better rendering but creates some issues:

  • How to align the rendered whitespaces so that they are placed correctly between the words? To align the whitespaces we need to know where the span is located vertically within the view line. That would imply having some mechanism to fetch the bottom position within the line, and directly reading from the dom.
  • How to correctly align the IME text area with the position of the actual text? Again here we would need to know the exact non-deterministic position of the text within the view-line

Because of these factors, it is easiest to position the text in the middle of the line.

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

Successfully merging this pull request may close these issues.

3 participants