Open Bug 1559152 Opened 5 years ago Updated 2 years ago

Allow users to use a custom monospace font

Categories

(DevTools :: General, enhancement, P2)

enhancement

Tracking

(Not tracked)

People

(Reporter: fvsch, Unassigned)

References

Details

Attachments

(1 file)

I'd like to discuss using a user-defined font-family for all monospace text in DevTools panels. (This might be a duplicate of existing bugs. I only found old bugs like bug 951090 which suggests DevTools used to follow Firefox preferences for monospace text around Fx 28.)

On some platforms, and especially on Linux, our default font-family for monospace text might not be ideal for users. I also know some users with specific needs or taste, even some using Comic Sans in their IDE. It could be fun to allow users to pick their prefered font-family.

Firefox already has a preference for monospace text, which can be used in CSS with font-family: -moz-fixed (or font-family: monospace;, which seems to give us the same result). Ideally, we could just use that all the time, but for legacy reasons it tends to be set by default to Courier New, Courier or some other slab monospace, which is not ideal.

So currently we define our font-families explicitly:

:root[platform="mac"] {
  --monospace-font-family: Menlo, monospace;
}

:root[platform="win"] {
  --monospace-font-family: Consolas, monospace;
}

:root[platform="linux"] {
  --monospace-font-family: monospace;
}

I wonder if we could offer an option that sets something like:

:root.useDefaultMonospace {
  --monospace-font-family: monospace;
}

Based on a preference somewhere in devtools settings?
(Note: I'm not proposing picking up the font-size from Firefox preferences, only the font-family.)

Would this have value for our users?
Some use cases:

  1. Default font on Linux can be not great or hard to read (especially if it has small x-height characters), and it's hard to work around given the wild variety of Linux configs. But it looks like the current Linux styles already address that.
  2. User who find specific fonts more readable, be it Source Code Pro or Courier New or even Comic Sans.
  3. Vanity font choices, aka not a readability need but the user just wants to use a font with a special vibe to it like Input Mono, or that very pricey font that all the trendy React influencers like (Operator).

(In reply to Florens Verschelde :fvsch from comment #0)

Would this have value for our users?
Some use cases:

  1. Default font on Linux can be not great or hard to read (especially if it has small x-height characters), and it's hard to work around given the wild variety of Linux configs. But it looks like the current Linux styles already address that.

It seems to me that if text is hard to read, then we ought to fix this in devtools, not just give people a way to fix it themselves.

  1. User who find specific fonts more readable, be it Source Code Pro or Courier New or even Comic Sans.
  2. Vanity font choices, aka not a readability need but the user just wants to use a font with a special vibe to it like Input Mono, or that very pricey font that all the trendy React influencers like (Operator).

Martin, what do you think of this feature idea? If memory serves me right, we've had multiple bugs filed by users over the past years, asking for more customization abilities in devtools, I'll attempt to find some of them in a minute.

Victoria, in terms of design of the DevTools UI, you might have something to say about this.

Flags: needinfo?(victoria)
Flags: needinfo?(mbalfanz)

Here are the bugs I could find, we might need to close some of them as duplicates:

  • Bug 872390 - Make the font size of the source view in the debugger configurable
  • Bug 1319367 - Allow users to change code font-size in Developer Tools
  • Bug 964346 - Add a font-size options in the devtools options' panel

I personally think this is a great idea.

We are adding tools like track changes which allow developers to spend more time in DevTools, and the usual environment (like code editors) offer plenty of customization options (fonts, themes etc.). Being able to select a custom font would be a great step in this direction (esp. when there are poor default choices on some systems).

So, thumbs up from me 👍

Flags: needinfo?(mbalfanz)
Priority: -- → P2

Sounds good to me as well! (I think font-size seems like a bigger priority than font-face.)

Flags: needinfo?(victoria)

I've kept font-size out of the scope of this bug because:

  • it's much harder to do (because we have a lot of hardcoded font sizes and element heights all over devtools)
  • users can zoom the UI, as a workaround
See Also: → 1319367
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: