Ability to configure font family in SQL editors#8553
Merged
adityatoshniwal merged 1 commit intopgadmin-org:masterfrom Mar 24, 2025
Merged
Conversation
adityatoshniwal
requested changes
Mar 17, 2025
Contributor
adityatoshniwal
left a comment
There was a problem hiding this comment.
Please update the documentation along with screenshots.
akshay-joshi
requested changes
Mar 20, 2025
Contributor
@MikeChristensen Please update docs as well. Thanks for the PR. |
b7280d7 to
a12b5f4
Compare
a12b5f4 to
f9ec10e
Compare
Contributor
Author
Okay, I'm pretty sure I did that right. Lemme know if any more changes are needed. Thanks for taking the time to review, this is my first PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Decided to take a stab at #392 since I've been wanting to use Nerd Fonts in the SQL editor as I do with my other IDEs. Should be a fairly straight forward change.
New Font Family Option in Editor Preferences:
SQL Editor:
Default Font
If the Font family setting is blank (or the settings were upgraded from previous version of pgAdmin), it will default to
Source Code Pro, which is the current default (and only) font:Localization
Since there's some new strings (Such as
"Font family"in the UI, these would need to be localized into the various languages pgAdmin supports. From what I can tell, runningmake messageswould use pybabel to pull out all the strings into the various translation files. When I ran this locally, it found all sorts of new stuff and wrong line numbers of existing stuff. This leads me to believe that there's probably some sort of "localization pass" before new versions are released to the public. However, if there's anything I should do with this PR, let me know.Ligatures
For some reason, I was not able to get ligatures to display in Codemirror even if the font supports it. Chome will render them correctly by default using a font that supports them, so I came to the conclusion Codemirror does something that breaks them. Using the developer tools and searching the Codemirror source code and issue tracker didn't shed any light on the reason. I figure most people don't want or need coding ligatures in SQL so it's probably not a big deal. I wouldn't mind figuring out how to get them working, and also provide the user a way to disable them using the
font-variant-ligatures: none;CSS property. I might take another stab at this when I have some time, but as I said it's probably not a huge priority.