Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 157 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

The Consolas font, which the CSS sets as the preferred font for the code blocks on Stack Overflow, looks exceedingly terrible on my machine (it's my favourite font on Windows, but on Linux... blech).

It would be really helpful (to me anyway) if somewhere on the site I could change the font for code blocks, so that the font I specified would become the preferred font for code blocks. My eyes would be grateful.

share|improve this question
What about this? ;-) – Shadow Wizard Nov 13 '11 at 18:59
@ShadowWizard I don't exactly want a hot-dog themed meta, but if you take away everything but the font specification, it looks like the right thing. How do you use it? – Seth Carnegie Nov 13 '11 at 19:04
Not sure, never done that myself but this look promising. :) – Shadow Wizard Nov 13 '11 at 19:09
@ShadowWizard oh, I use Chrome :) – Seth Carnegie Nov 13 '11 at 19:13
Stylish for Chrome or put the CSS in your Default/User Stylesheets/Custom.css file @SethCarnegie. – Mat Nov 13 '11 at 19:14
@Mat that's exactly what I was looking for. If you want to add that as an answer I'll upvote and accept. – Seth Carnegie Nov 13 '11 at 19:20
@SethCarnegie: You might also want to check out superuser and/or Unix & Linux to get your font fixed :) – Mat Nov 13 '11 at 19:32
@Mat nah, I've already gotten used to Droid Sans Mono. I know what the problem is though, but I can't fix it because of a series of unfortunate dependencies. Thanks again. – Seth Carnegie Nov 13 '11 at 19:37
If Consolas is that ugly, why not remove it entirely? Like on these sites the CSS will then fall back to the next from the list: font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif. Not your first choice indeed, so the user stylesheet is a better fix. But other sites will probably have similar fallbacks defined. – Arjan Nov 13 '11 at 20:33
up vote 3 down vote accepted

All you need for that is a user stylesheet with something like the following:

#mainbar code {
    font-family: Serif !important;

Serif might not be the best selection here :). The #mainbar selector should make it match all over SE, and hopefully not too much elsewhere.

For Chrome, you need to put that in your Default/User Stylesheets/Custom.css file. (Not sure where that lives on Windows. On Linux, should be under ~/.config/chrome.)

Given that most modern browsers let you have user stylesheets, and that extensions for doing things like this exist (like for instance, with Stylish for Chrome, plugin also exists for Firefox), I don't think there is enough justification to having per-user settings for this.

If you give the option just for the code-block font, someone's going to ask for some other font tunable, or color, or spacing, or... and that's probably going to end up being a QA nightmare.

share|improve this answer
Brilliant, thanks. FWIW, it's Droid Sans Mono :) – Seth Carnegie Nov 13 '11 at 19:31
So, @Seth, is this still a feature request? If not, please retag it as support. – Arjan Nov 13 '11 at 20:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .