Skip to content

Ability to configure font family in SQL editors#8553

Merged
adityatoshniwal merged 1 commit intopgadmin-org:masterfrom
MikeChristensen:GH-392-ConfigurableFontFamily
Mar 24, 2025
Merged

Ability to configure font family in SQL editors#8553
adityatoshniwal merged 1 commit intopgadmin-org:masterfrom
MikeChristensen:GH-392-ConfigurableFontFamily

Conversation

@MikeChristensen
Copy link
Copy Markdown
Contributor

@MikeChristensen MikeChristensen commented Mar 14, 2025

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:

image

SQL Editor:

image

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:

image

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, running make messages would 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.

Copy link
Copy Markdown
Contributor

@adityatoshniwal adityatoshniwal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the documentation along with screenshots.

@adityatoshniwal
Copy link
Copy Markdown
Contributor

Please update the documentation along with screenshots.

@MikeChristensen Please update docs as well. Thanks for the PR.

@MikeChristensen MikeChristensen force-pushed the GH-392-ConfigurableFontFamily branch from b7280d7 to a12b5f4 Compare March 24, 2025 04:31
@MikeChristensen MikeChristensen force-pushed the GH-392-ConfigurableFontFamily branch from a12b5f4 to f9ec10e Compare March 24, 2025 04:59
@MikeChristensen
Copy link
Copy Markdown
Contributor Author

Please update the documentation along with screenshots.

@MikeChristensen Please update docs as well. Thanks for the PR.

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.

@adityatoshniwal adityatoshniwal merged commit 13b44ff into pgadmin-org:master Mar 24, 2025
27 of 32 checks passed
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