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

Draft: allow various font-sizes #238269

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

Draft: allow various font-sizes #238269

wants to merge 93 commits into from

Conversation

aiday-mar
Copy link
Contributor

@aiday-mar aiday-mar commented Jan 20, 2025

points to test:

  • when moving cursor from line that is normal height to line that is larger height, the cursor flickers, and moves to the end
  • 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 whitespace is correctly rendered
    • whitespaces can be modulated for a different font size
    • whitespaces are not aligned correctly with different font sizes
      • either make the text align all in the middle
      • align each whitespace at different heights depending on the font size
  • 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 that font infos out of view are correctly rendered
  • check what happens when the font size is larger than the line height
  • make ghost text the same size as the text to the immediate left of it
    • check the code written is appropriate
  • verify parameter hints are correctly rendered
  • verify that IME input is the correct size (need to remove the removal of experimental edit context when accessibility turned on)
    • with experimental edit context when accessibility turned on and without
    • with initial edit context when accessibility turned on and without
       - [ ] since spans are aligned on the same line on the bottom, when doing composition, the text area is set in the middle of the line, then is is moved down when composition ends. Could be resolved by guessing where the text is aligned. Easiest is to place the text in the middle of the line.
      ⚠️ Generally there is still a lag time between the update of the line height and the update of the font size
  • verify the accessibility box is correctly positioned when different font size
    • with experimental edit context
    • with initial edit context
  • 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.
  • verify the font is correctly rendered on pasting
    • It takes a bit of time to update the font sizes but otherwise they are correctly updated
  • 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
    • The two are updated at different times. Hence instead I set a maximum size on the font so it is never larger than the line height, so font size does not exceed the line height.
  • verify that when word wrap is toggled on, and the window is resized down, the text is correctly wrapped
    • the line heights and font sizes are correctly adapted if needed (especially when editing)
    • the line breaks at the correct position
  • check can define several different font infos on line
  • 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
  • verify that font sizes are preserved across editors when switching editors
    • sometimes font sizes were disappearing because the test code was incorrectly defined. I was calculating the font sizes on document symbol provider request, not on editor opening.
  • check what happens when the font size is smaller than the normal font size
  • injected text options should be tested to verify it is possible to inject text too at different heights
  • when pressing enter from line that is larger, the line height and font size are updated only a few seconds later (after decorations are updated)
    • much quicker when not defining the font size change from within the document symbol provider, but from the document change event as was intended.
  • check if other options related to the font should be definable
    • font size is used in the notebook logic, but I will not look into that here
  • 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.

@aiday-mar aiday-mar self-assigned this Jan 20, 2025
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