views:

2843

answers:

11

The font used in xterms is extremely compact yet readable. What font is that? The closest I've found that I can use in other other applications is DejaVu Sans Mono or Bitstream Vera Sans Mono. Those are as compact as xterms vertically but take up more space horizontally.

I'd really like to switch from xterms to Terminal.app and this is the one thing holding me back.

(I also think that font would be much better for emacs, xcode, or whatever editor.)

ADDED: In Terminal.app you can adjust the character and line spacing for any font. Is this possible in other applications?

I'm open to any other font that is as compact and readable as the xterm font. Dina looks really nice but it doesn't seem to work for Mac.

+1  A: 

Character- and line-spacing are customizable at the bottom of the Fonts panel.

Zach Langley
ah, good point, though as far as i can tell, that doesn't solve it. I added an addendum to the question about this.
dreeves
+2  A: 

X11 default fonts are usually bitmap fonts, which aren't of any use to non-X applications ... on my Mac box, the default font for X11 apps seems to be -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1, corresponding to the file /usr/X11/lib/X11/fonts/misc/7x14-ISO8859-1.pcf.gz

You can display the character table with the command /usr/X11R6/bin/xfd -fn -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1 and check if it's the one you see in your xterms. If so, I'm afraid there's nothing to do: PCF fonts are (very) low resolution bitmap fonts, and that's why they look so good on screen, by the way (they just fit with your particular screen resolution); but they're no way other Mac OS X applications are going to use them.

Arthur Reutenauer
The other answerer suggests you can use bitmap fonts for Terminal.app. Which one of you is right?
dreeves
If I knew the other answerer to be right, I wouldn't have written this answer :-)Anyway, I wouldn't bet that Aqua applications can't use bitmap fonts at all, but I'm quite sure that they can't use X11 bitmap fonts.
Arthur Reutenauer
Cool, I think that resolves my original question. Now the question is, what's a mac-compatible font as compact yet readable as is8859-1 or whatever the canonical name for the X11 xterm font is?
dreeves
You can edit the X11 font in a font editor like FontForge (http://fontforge.sourceforge.net/) and save it under a format Mac OS will understand (TrueType bitmap, probably). But you have to do that carefully, lest it will be even less readable, and I don't know the details of TrueType bitmap fonts.
Arthur Reutenauer
Ah, if anyone has ever undertaken this, I'd love to try it. Thanks everyone!
dreeves
+1  A: 

My favorite pixel font is 'Dina ttf 10px' at 16pt on a dark background. It makes a great font for coding, since it has slashed zeros, and distinct characters.

You can find the Mac TrueType version at http://www.geenat.com/?p=66 and the original bitmap version at http://www.donationcoder.com/Software/Jibz/Dina/index.html

The Proggy font that Dina is based on is also really sharp at a small text size. Unfortunately, it is a little too small for me.


Additionally, you can use SIMBL plugins to tweak Terminal.app to better suit you. In addition to the color preferences, I find all the plugins below really helpful when using Terminal.

For a start the default colours in Terminal.app are difficult to see. To fix this, you can install Ciaran Walsh's custom color plugin.

xer0x
Dina looks really nice! But when I copy Dina.fon to /Library/Fonts it doesn't seem to then automatically show up as a font option in Terminal.app. Is there any other step I need to take?
dreeves
.fon fonts are bitmap fonts for Windows. There are few chances Mac OS knows how how to use them. Font Book can't even open it.
Arthur Reutenauer
Sorry, I forgot to link to the Truetype version of the font. Here is a link to the converted OSX compatible font:http://www.geenat.com/?p=66
xer0x
+4  A: 

It's not exactly the same, but 10 point Monaco (with anti-aliasing turned off) is pretty darn close. I'd say it's actually a little better, because Monaco's 1/l and O/0 glyphs are more distinct than the X font's.

Andrew Medico
Ah, you're right; close! Thanks! Angle brackets look pretty bad to me in Monaco though. Check out the string "~>" -- it looks much better in xterm. You're right that 1/l and O/0 are better in Monaco.
dreeves
+1  A: 

Here are alternatives I've tried. (Thanks to Will and others.)

  1. Monaco 10pt with .9 line spacing (I don't know how to squish line or character spacing in anything other than Terminal.app) takes up exactly as much vertical and horizontal space as the xterm font. Without the line space squishing it takes up more vertical space. I don't think the squishing harms readability. Monaco has the advantage of slashed zeros but has worse angle brackets (they bump into adjacent characters awkardly, eg, "~>"). Upper case characters ("A" in particular) also don't look as good in Monaco. Mostly though, they are about the same.

  2. Monaco 9pt fixes the angle brackets and is more vertically compact than the xterm font (same horizontally). Capital I is pretty sucky (hard to distinguish from l and i and |).

  3. ProggyTiny from Proggy Fonts at 11pt. Setting the line spacing to .9 makes it vertically slightly more compact than X11's xterm font. Either way, it takes up exactly as much space horizontally. With or without line space squishing though, I find this option definitively worse than Monaco. The other Proggy varieties seem to not be as compact as the xterm font.

  4. Anonymous at 10pt with .95 character spacing (I still don't know how to squish character or line spacing in anything but Terminal.app) and normal line spacing is exactly the same size as the X11 font. Squishing the character spacing causes upper case characters to touch each other very slightly and numbers are rather ugly that way. With vertical (line) space squishing it can be made more vertically compact than the xterm font without harming readability. (Anonymous at 9pt is very very compact and still quite readable.) I really don't like the caret ("^") in this font, with or without squishing.

  5. FixedMedium6x13 set to size 13 and line spacing 0.80 yields the xterm font exactly. My friend David Yang reports that this works flawlessly for him on Snow Leopard. I'm on Leopard and it's unusable for me (with squished line spacing that makes it as compact as X11) because there's some kind of refresh problem -- it cuts off the tops of the letters until the terminal window re-renders, like when you alt-tab away from it.

Others I intend to try:

dreeves
Try Monaco 9 instead :)
Will Robertson
I'd love to find a version of FixedMedium6x13 with less whitespace so you don't have to set line spacing to 0.8. Then I could use it in other programs like Eclipse that don't support custom line spacing.
dreeves
+1  A: 

I've been using Bitstream Vera Mono later DeJaVu Sans Mono (for more unicode characters) for quite a long time but I've switched a few months ago to the font used by Android, Google's OS for mobile phones, called Droid Sans Mono. It is really more readable for me. For Terminal.app, I do shrink it a bit horizontally though.

Keltia
+4  A: 
Will Robertson
That screenshot looks non-antialiased.
Andrew Medico
Monaco (and some old Mac fonts) also have some bitmap versions embedded within them. Terminal.app has an option not to anti-alias the fonts, in which case it uses the correct bitmap size.You can adjust global anti-aliasing settings in the Appearance pane in System Preferences.
Will Robertson
(Hello Will) You misunderstood Andrew's comment: he was not asking about anti-aliasing in Terminal, he was correcting your answer above (“Monaco 9pt, anti-aliased” instead of “*not* anti-aliased”, obviously a typo) :-)
Arthur Reutenauer
Whoops, thanks! :)
Will Robertson
You're welcome, and Happy New Year in Australia!
Arthur Reutenauer
+1 for Inconsolata -- has become my font of choice for programming on the mac.
lostlogic
+2  A: 

The font used in xterms is extremely compact yet readable. What font is that?

The font you are referring to is known as "fixed" or "6x13".

I started (but gave up) a "6x13 redux" which was meant to be one of those TrueType fonts that only looks good at one size but was usable in Terminal.app. I gave up because creating a font with UNICODE glyphs is a HUGE undertaking. Just look at this glyph table for 6x13. BTW, that "6x13 Redux" font I created only seems to work in Terminal.app on Tiger, not on Leopard.

The closest I've come to 6x13 is ProggySquare at 11pt.

z8000
+3  A: 

I have successfully gotten Emacs.App to use the beloved misc-fixed 7x14 font. And it looks GOOD.

1) download ucs-fonts.tar.gz from http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html

2) extract the file 7x14.bdf

3) install FontForge (fontforge.sourceforge.net)

4) open 7x14.bdf in fontforge

5) in fontforge do File->Generate Fonts with "No Outline Font" and "Apple bitmap only sfont (dfont)"

6) save as /Library/Fonts/FixedMedium7x14.dfont

7) in your .emacs (setq default-font "-apple-Fixed-medium-normal-normal--14--*-*-m-0-iso10646-1")

8) WIN

Marty Vona
and this does work in Terminal.app too; select the "Fixed Medium 14pt" font.
Marty Vona
+1  A: 

Just use one of these:

You might want to adjust the line height to 0.85 when you select the font.

(Thanks to Marty Vona for the guide)

neu242
A: 

Try andale mono without anti-aliasing... it looks good on my mac pro 15in

yenliangl