fix(sqllab): Fix cursor alignment in SQL lab editor by avoiding Lucida Console font on Windows #21380
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
Windows does not have a bold version of
Lucida Console
installed by default. [1] [2]Instead, Windows creates a fake bold version of the font, which is slightly wider. [3]
In the SQL lab editor this leads to the cursor alignment issues linked below.
Consolas
andCourier New
both come with bold monospaced version pre-installed on Windows [2] and cause no issues with cursor alignment. That is why I am proposing to change the order of the fonts.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Available in any of the linked issues
TESTING INSTRUCTIONS
Requirement: Windows machine with standard fonts, meaning
Menlo
is not installed,Lucida Console
is installed, but missing the bold version.Then just type any SQL keyword the SQL lab editor, such as
SELECT * FROM table_name
.The cursor is no longer aligned over the word table_name.
This is fixed when the font order is changed via the browser's development tools
ADDITIONAL INFORMATION
Fixes Cursor falls behind in SQL Lab #9253
Fixes Cursor falling behind in SQL Lab #15749
Fixes sqllab cursor misplaced #19094
Fixes text cursor algin did not fix the text in sqlLab. #19580
Fixes Cursor falls behind in SQL Lab #20436