Closed Bug 468169 Opened 13 years ago Closed 1 year ago

Use a better monospaced font anywhere we use Courier New right now

Categories

(Core :: Layout: Text and Fonts, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1607913
Tracking Status
blocking2.0 --- -

People

(Reporter: faaborg, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Keywords: polish, Whiteboard: [See comment 17 for what we want][polish-hard][polish-visual][polish-p3][target-betaN])

Many platforms like XP and OS X do not include a great monospaced font, which
impacts the visual appearance of view source and text areas in Firefox.  Shipping a good default monospaced font is a nice way to make an app feel modern and give it an extra level of polish, since users are so accustomed to the typewriter hell called courier.

The Thunderbird version of this bug is bug 465633 (for plain text email).  The technical and license issues are also in play over in that bug, so which over one is resolved first will likely impact the other.
Whiteboard: [polish-hard][polish-visual]
(In reply to comment #0)
> Many platforms like XP and OS X do not include a great monospaced font

That's debatable. See e.g. http://www.codinghorror.com/blog/archives/000969.html for a discussion relevant to View Source (maybe less so for textareas where web pages can chose the font themselves).

Then again, why not just default to the system's preferred monospaced font? E.g. on Windows this would currently be: 1. Consolas (Vista, Office 2007); 2. Lucida Console (XP); 3. Courier New.
>That's debatable. See e.g.
>http://www.codinghorror.com/blog/archives/000969.html for a discussion relevant
>to View Source

Like all of the more aesthetic aspects of our design, it is indeed very debatable.  In general Consolas has received praise (which is why I just listed XP and OS X as the platforms I personally think are missing great monospaced fonts).

My personal favorite is Inconsolata http://www.levien.com/type/myfonts/inconsolata.html, which uses microserifs and is also influenced by the design of Consolas.  Unfortunately this font isn't finished yet, but I wonder if we could consider funding its completion, similar to how we sometimes contract out other forms of design work.

I recommend people try using Inconsolata as their default monospaced font in Firefox for awhile to get a feel for it, especially for using Bugzilla.

Here is another blog post discussing the decisions that Panic made for Coda:
http://vnoel.wordpress.com/2007/04/25/coda-coding-font-panic-sans/

Another issue related to having a full character set is the impact this would have on our download size.  One possibility might be to only ship a new font with certain localizations, or to break a larger font up across each localization.  I'm not sure what the requirements would be for an interface like view source (do we always need the full unicode set?) I also don't really know very much about how this would work, or if it is really feasible.

>Then again, why not just default to the system's preferred monospaced font?

This would certainly fit with our overall strategy of visual integration with the platform.  A few reasons why shipping a new font might be a good idea are:

-For the content area (and view source kind of has a content area) I'm not sure there is an expectation of visual integration, since these areas do not feel like browser chrome.

-If we ship a font that is better than what other applications on the platform are currently using, this puts us at a slight visual advantage over our competition.  It might not be something the user very consciously notices, but it gives us a higher level of polish compared to other apps.  I personally had this experience when first using Coda (Bitstream Vera Sans).  I didn't know what font they were using, or if it was new or already on the system, but I did have this overwhelming sense of "wow, this app looks fantastic."

-While not exactly our central goal, an additional reason to spread a good font for Firefox users is to improve the set of fonts available to the world.  Just as including Comic Sans in Windows 95 made the world a little bit worse, I think shipping Inconsolata to 20% of computers would make the world a little bit better :)
I've set it up as a default monospace font, and i like it a lot, both in Firefox and Tb.  One minor quibble is it uses a 0 w/ a slash through it, which I think makes eminent sense in a code editor, less sense in a generic content area or in reading plain-text messages.

Finding out what'd be involved in funding its completion would be good.
Thunderbird version of this bug: bug 465633
Because we mean to use it for reveal codes, we may be looking for
a 'programmer' font. Some considerations, depending on how far we
want to go in that direction:

 - How does it look on an anti-aliased and on a non-anti-aliased
   display?
 - How does it look at different sizes?
 - Does it differentiate 0O and 1liI ?
 - Does it emphasize punctuation marks, so you don't miss them or
   confuse them (e.g: ,.  :;)
 - Is it as good for reading/skimming large blocks of prose as for
   reading code?

I've been happy with Bitstream Vera Sans Mono for years, though
the comma and period are barely distinguishable at small font
sizes.

A couple of long guides to monospace/programmer fonts:
    http://keithdevens.com/wiki/ProgrammerFonts
    http://www.kuro5hin.org/story/2004/12/6/11739/5249
Is DejaVu Sans Mono's licence ( http://dejavu-fonts.org/wiki/index.php?title=License ) free enough?
This bug's priority relative to the set of other polish bugs is:
P3 - Polish issue that is in a secondary interface, occasionally encountered, or is not easily identifiable.

Very secondary interface-ish, but would be a nice visual win for Web developers or other technical users who commonly load view source.
Whiteboard: [polish-hard][polish-visual] → [polish-hard][polish-visual][polish-p3]
Duplicate of this bug: 564925
We should do whatever Thunderbird did, I think.
Yeah, at a minimum.  Getting a good open source font for use on XP would be a good follow up from this though.
Blocks: 574103
I think all platforms ship with decent monospaced fonts these days. I think it's odd that we'd want to ship our own. Uncanny Valley and all that.
For some reason I don't think the uncanny valley applies to fonts being system native, but I really can't quantify why I think that.  Either way, even if we go with Consolas (vista, 7) and Calibri? (OS X), we really should get a decent fixed width font for XP.
(In reply to comment #12)
> Calibri? (OS X)

Do you mean Menlo? Calibri is a proportional typeface and ships with Vista and above.
yeah, Menlo.

Also since this bug was filed in 2008, Incosolata has been finished, open source licensed and now hosted by Google:

http://arstechnica.com/web/news/2010/05/google-offers-web-designers-hosted-open-source-web-fonts.ars

http://code.google.com/webfonts/family?family=Inconsolata#specimen
(In reply to comment #13)
> (In reply to comment #12)
> > Calibri? (OS X)
> 
> Do you mean Menlo? Calibri is a proportional typeface and ships with Vista and
> above.

Menlo ships on OS X 10.6+ and is (finally) a replacement for Monaco.

There's also Andale Mono available on Mac and Windows Vista (I think?) which is a pretty decent monospaced typeface.

Maybe the uncanny valley doesn't apply to fonts. Applications have been shipping custom fonts for a long time and are often used to differentiate applications, so maybe that doesn't make sense.

I do wonder if this opens the door for us to start thinking about shipping default Sans Serif and Serif fonts as well.

Fonts are often a personal choice, especially when it comes to "programmer" fonts. Many people will have a font of choice installed on their machines and if they're picky about typefaces, will likely already have a default monospaced font selected through preferences.

anyway, some food for thought. Not sure how high a priority I'd give this.
(In reply to comment #14)
> http://code.google.com/webfonts/family?family=Inconsolata#specimen

Pretty ugly over here on XP, looks like cleartype is screwing up.
blocking2.0: ? → -
status2.0: ? → ---
No longer blocks: 574103
Ok, quick review of what we want:

XP: keep the current default (courier)
Vista/7: Consolas
OS X 10.5: Monaco
OS X 10.6: Menlo
Summary: Ship a better monospaced font for view source, and to use as a default → Use a better monospaced font for view source, and to use as a default
You should also consider tweaking font sizes -- the default is 13, and we in Thunderbird had to do +1 (to 14) for Consolas and -1 (to 12) for Monaco/Menlo to make text look roughly the same size.
Here’s a wacky idea: implement Elastic Tabstops[1] (together with bug 312716), and then switch to _proportional_ font in View Source. With the right typeface, the result can be both much more readable and quite beautiful[2].

[1] http://nickgravgaard.com/elastictabstops/
[2] http://nickgravgaard.com/elastictabstops/news/programming-fonts/

Any chance this will ever be possible?
Let's keep this bug on-topic, and avoid boiling any oceans. If you want to suggest the elastic tabstop stuff, do it in a separate bug. :)

(Also clarified title of the bug, it's not just for view source, but anywhere we are currently using Courier and monospace, including forms, pre/tt/code tags, etc.)
Summary: Use a better monospaced font for view source, and to use as a default → Use a better monospaced font anywhere we use Courier right now
Whiteboard: [polish-hard][polish-visual][polish-p3] → [polish-hard][polish-visual][polish-p3][target-betaN]
Adding Frank, since he asked, and is potentially interested in looking at this post-blockers. :)

(In reply to comment #17)
> Ok, quick review of what we want:
> 
> XP: keep the current default (courier)
> Vista/7: Consolas
> OS X 10.5: Monaco
> OS X 10.6: Menlo

…is still valid. Probably a bit more complicated than it should ideally be, since I don't think these are set by a stylesheet with fallback values.
For Windows: You should be able to simply copy the Thunderbird implementation into core, modifying as needed: <https://mxr.mozilla.org/comm-central/source/mail/base/modules/mailMigrator.js#53>. We even have tests for it: <https://mxr.mozilla.org/comm-central/source/mail/base/test/unit/test_windows_font_migration.js>. (Note that we moved serif and sans-serif over too, so you can do that too if you wish.)

Mac is simpler: <https://mxr.mozilla.org/comm-central/source/mail/app/profile/all-thunderbird.js#499>. font.name-list acts as a fallback. We can't use a fallback on Windows because the ClearType fonts look bad without ClearType on, and XP has it disabled by default -- so if someone installs a program that comes with the fonts, he'll be in trouble.
To get font.name-list working properly, you might also have to port over bug 550589 -- I'm not sure if Firefox has the same bug or not.
Adding jtd and dbaron after today's discussion. Font families we want (by platform) are in comment 17, Thunderbird's equivalent bug is bug 465633.

Specifying Consolas on e.g. XP with fallback to Courier is acceptable if the user doesn't have it installed — if that makes anything easier.
Whiteboard: [polish-hard][polish-visual][polish-p3][target-betaN] → [See comment 17 for what we want][polish-hard][polish-visual][polish-p3][target-betaN]
…and the same on OS X, of course — Menlo with fallback to Monaco.
(In reply to comment #24)
> Specifying Consolas on e.g. XP with fallback to Courier is acceptable if the
> user doesn't have it installed — if that makes anything easier.

This would make things much easier, but would suck for people with cleartype disabled but Consolas installed (since Consolas renders horribly with CT off), unless you plan to force cleartype on for Consolas.
Related (but shouldn't be in scope for this bug), we should consider talking to the WebKit people about making 16px the default for monospace, so we can get it consistent across all rendering engines. Firefox & Safari/Chrome are the only ones to render it as 13px, which makes no sense except for historical reasons. This is bug 175415, btw.
>since Consolas renders horribly with CT off

can we check the state of the cleartype pref before setting the font on the system?
Depends on: Consolas
Component: Theme → Layout: Text
Product: Firefox → Core
QA Contact: theme → layout.fonts-and-text
Summary: Use a better monospaced font anywhere we use Courier right now → Use a better monospaced font anywhere we use Courier New right now
Whiteboard: [See comment 17 for what we want][polish-hard][polish-visual][polish-p3][target-betaN] → [triage] [See comment 17 for what we want][polish-hard][polish-visual][polish-p3][target-betaN]
Whiteboard: [triage] [See comment 17 for what we want][polish-hard][polish-visual][polish-p3][target-betaN] → [See comment 17 for what we want][polish-hard][polish-visual][polish-p3][target-betaN]
No longer blocks: fxdesktopbacklog
May I suggest… Fira Mono, for all platforms?
(In reply to Alex Faaborg [:faaborg] (Firefox UX) from comment #28)
> >since Consolas renders horribly with CT off
> 
> can we check the state of the cleartype pref before setting the font on the
> system?
Flags: needinfo?(sid.bugzilla)
Depends on: Menlo
Duplicate of this bug: 1344750
Flags: needinfo?(rain)
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1607913
You need to log in before you can comment on or make changes to this bug.