Skip to content

All this time our editor has used monospace. Use a real code font#8076

Merged
pierremtb merged 14 commits intomainfrom
franknoirot/adhoc/style-code-editor-font
Aug 22, 2025
Merged

All this time our editor has used monospace. Use a real code font#8076
pierremtb merged 14 commits intomainfrom
franknoirot/adhoc/style-code-editor-font

Conversation

@franknoirot
Copy link
Copy Markdown
Contributor

@franknoirot franknoirot commented Aug 15, 2025

Better late then never I guess! We use Source Code Pro elsewhere, so all this PR does is apply it to the CodeMirror instance. Source Code Pro is much more suitable for small font sizes, so I actually felt the need to scale down the base font for the editor after changing it. It was a little debatable but I went with text-xs for higher density. This has made me realize that we really should make settings for the following when we have time:

  • setting for app font-size
  • setting for editor font-size
  • setting for editor font-family (maybe could take a URL?)

Before

Screenshot 2025-08-15 at 4 38 57 PM

After

Screenshot 2025-08-22 at 11 07 11 PM

Edit: the initial screenshots in this PR description showed that I had changed nothing. I corrected the nothingness, then merged this, and then updated the "After" image with a shot from Staging after merging.

Better late then never I guess! We use Source Code Pro elsewhere, so all
this PR does is apply it to the CodeMirror instance. Source Code Pro is
much more suitable for small font sizes, so I actually felt the need to
scale down the base font for the editor after changing it. It was a
little debatable but I went with `text-xs` for higher density. This has
made me realize that we really should make settings for the following
when we have time:
- [ ] setting for app font-size
- [ ] setting for editor font-size
- [ ] setting for editor font-family (maybe could take a URL?)
@franknoirot franknoirot requested a review from a team as a code owner August 15, 2025 20:40
@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
modeling-app Ready Ready Preview Comment Aug 22, 2025 2:08pm

@max-mrgrsk
Copy link
Copy Markdown
Contributor

Good catch! I hope the fonts in the variables pane look fine.

Comment on lines +10 to +11
url('./VF/SourceCodeVF-Upright.ttf') format('truetype-variations');
url('./VF/SourceCodeVF-Upright.ttf') format('truetype supports variations');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's a syntax error in the font-face declaration. The semicolon after format('truetype-variations') terminates the declaration prematurely, which would prevent the subsequent format from being recognized. Replace the semicolon with a comma:

url('./VF/SourceCodeVF-Upright.ttf') format('truetype-variations'),
url('./VF/SourceCodeVF-Upright.ttf') format('truetype supports variations');

The same issue appears in the italic font-face declaration below.

Suggested change
url('./VF/SourceCodeVF-Upright.ttf') format('truetype-variations');
url('./VF/SourceCodeVF-Upright.ttf') format('truetype supports variations');
url('./VF/SourceCodeVF-Upright.ttf') format('truetype-variations'),
url('./VF/SourceCodeVF-Upright.ttf') format('truetype supports variations');

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think you're probably correct here! I might rather open an upstream issue with that repo though

Comment on lines +10 to +11
url('./VF/SourceCodeVF-Upright.ttf') format('truetype-variations');
url('./VF/SourceCodeVF-Upright.ttf') format('truetype supports variations');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's a syntax error in the font-face declaration. The line ending with format('truetype-variations'); should end with a comma instead of a semicolon since it's followed by another source URL. This would make the CSS declaration properly parseable by all browsers:

url('./VF/SourceCodeVF-Upright.ttf') format('truetype-variations'),
url('./VF/SourceCodeVF-Upright.ttf') format('truetype supports variations');

The same issue appears in the italic font-face declaration below.

Suggested change
url('./VF/SourceCodeVF-Upright.ttf') format('truetype-variations');
url('./VF/SourceCodeVF-Upright.ttf') format('truetype supports variations');
url('./VF/SourceCodeVF-Upright.ttf') format('truetype-variations'),
url('./VF/SourceCodeVF-Upright.ttf') format('truetype supports variations');

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

And deleting in another spot after the font size changed happened to not
cause the error this test expected to occur
@franknoirot
Copy link
Copy Markdown
Contributor Author

Gonna wait until after we get #7542 in, don't want to derail anything

@franknoirot franknoirot marked this pull request as draft August 20, 2025 19:14
@franknoirot franknoirot changed the title All this time our editor has used monospace....wow All this time our editor has used monospace. Use a real code font Aug 20, 2025
@pierremtb
Copy link
Copy Markdown
Contributor

Just tested again locally, looks great!

@pierremtb pierremtb marked this pull request as ready for review August 22, 2025 20:16
@pierremtb pierremtb merged commit bb3fb2f into main Aug 22, 2025
71 of 72 checks passed
@pierremtb pierremtb deleted the franknoirot/adhoc/style-code-editor-font branch August 22, 2025 20:16
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