Skip to content

Conversation

@bmjcode
Copy link
Collaborator

@bmjcode bmjcode commented May 19, 2025

When I had a chance to briefly test Frescobaldi on a Mac, I noticed the editor font defaulted to the system sans-serif font. This PR explicitly sets a monospace default font on macOS to match the behavior on other platforms.

Do any of our Mac users have a preference for which font? I assume Monaco is the safest choice since it's been in every macOS version, but it looks like Apple favors other fonts in recent OS versions.

@bmjcode bmjcode added the macOS label May 19, 2025
@fedelibre
Copy link
Member

Let's CC some macOS users who may not follow this repository or the macOS label

@inkandpaper-app @JunTamura1959 @marnen @jacques-menu

@JunTamura1959
Copy link
Contributor

@bmjcode @fedelibre
I've just realized that I've been using Menlo 10-point font, but I don't remember when or why I chose this setting. Readability is quite similar. Menlo has slightly narrower vertical spacing, which allows for the display of more lines in the same vertical space, but some might think that Monaco is easier to read.

@bmjcode
Copy link
Collaborator Author

bmjcode commented May 20, 2025

Thanks @JunTamura1959. Any other Mac users have a strong preference either way?

@inkandpaper-app
Copy link
Contributor

Why not SF Pro? It is the default system font on all Apple platforms.

@marnen
Copy link
Contributor

marnen commented May 21, 2025

@inkandpaper-app I assume that this is referring to the font for the source code editor, not the main UI font. I don’t know about you, but I wouldn’t want SF Pro as the default source code font.

https://developer.apple.com/fonts/ implies that SF Mono is the current default in Xcode, so that seems like a good choice. I think Menlo used to be Xcode’s default.

@bmjcode
Copy link
Collaborator Author

bmjcode commented May 22, 2025

@inkandpaper-app @marnen Yes, I meant the editor font. From what I've read Apple used Monaco, then Menlo, then SF Mono. I'm not a regular Mac user myself, so I don't know offhand which macOS versions we support or which versions used which fonts. I guess we could default to SF Mono and use QFont substitutions to fall back on the older fonts if needed.

@marnen
Copy link
Contributor

marnen commented May 22, 2025

@bmjcode:

From what I've read Apple used Monaco, then Menlo, then SF Mono.

That sounds like what I remember seeing on my Mac.

I don’t tend to use the default font in my text editors in any case, but I do think we should have a sane default.

@JunTamura1959
Copy link
Contributor

For some reason, I cannot find "SF Mono" in the font pull-down menu in Frescobaldi. "Monaco" and "Menlo" are there. The default editor font in my Xcode is set to "SF Mono."
I'm running Frescobaldi 4.0.3.dev1 (a8f79c4) on macOS 15.5 (w/OCLP 2.4.0) on MacBook Pro late 2016 Intel Core i5.

This adds standard logic in app.py to select an appropriate default
editor font for each platform (generally that used by the system text
editor: Notepad on Windows, TextEdit on macOS, etc.).

My original intention was simply to provide a sane default for macOS,
but since this is used in multiple places I thought a more robust
implementation would benefit all platforms.
@bmjcode bmjcode force-pushed the macos-default-font branch from 96925ca to 283f51a Compare May 29, 2025 23:09
@bmjcode
Copy link
Collaborator Author

bmjcode commented May 29, 2025

The rewritten version I just pushed defaults to SF Mono on macOS, falling back on the older fonts if that one is unavailable. The fallback logic is technically cross-platform, though in practice Windows and Linux don't currently need it since all versions that can run Frescobaldi provide our first-choice fonts.

@jacques-menu
Copy link
Collaborator

I always use Menlo on my Macs, in Terminal and BBEdit for example. IIRW, it replaced Monaco at the time.
It's easy to read and exhibits indentation well.

Copy link
Member

@fedelibre fedelibre left a comment

Choose a reason for hiding this comment

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

I can test on Linux only, but I've checked that this doesn't break anything.

@bmjcode
Copy link
Collaborator Author

bmjcode commented Jun 5, 2025

Well, if there is a problem I'm sure we'll hear about it. 😁

@bmjcode bmjcode merged commit fc6d96a into frescobaldi:master Jun 5, 2025
@bmjcode bmjcode deleted the macos-default-font branch June 5, 2025 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants