6

I am using emacs-mac-port 24.4 on OSX 10.10. My company-mode drop-down menu is ugly. The unicode symbols in it are not the same width, which results in a ragged menu. The left image is with Monaco, the right one is with DejaVu Sans Mono.

Is there a font better than DejaVu Sans Mono in this regard?

Or is it possible to use the system dropdown menu like yasnippet?

4

Edit 2:

Well, it looks like this answer might be wrong. Now I think that the enclosed alphanumeric characters and friends might be fullwidth forms, similar to the CJK unicode characters. This would explain why Ⓢ takes up exactly two spaces when using GNU Unifont.

In which case, this might best be filed as a company-mode bug.

Possible solution:

If you notice, each company entry is the full word, followed by some variable padding, followed by the character, followed by exactly one padding space, followed by the space for the scroll bar. Perhaps company can leave out one padding space for each fullwidth character in the entry.


DejaVu does not include the circled S character (U+24C8), or any other circled characters other than numbers1. Emacs is falling back to another font to display the character. You can determine exactly which font by calling describe-char with the point on the character.

This fallback font is wider than DejaVu or Monaco at the same height, which gives you the behavior you're seeing. You can change fallback fonts with fontsets. Here's a relevant SO question on this topic. Perhaps you can configure the fallback font to use a narrower width (if that is supported by the font). Alternatively, you can install and specify a new font that includes more characters to fallback on (maybe with the same height to width ratio as DejaVu?)

Edit:

According to Xah Lee:

DejaVu has significantly more Unicode symbols than other popular fixed-width fonts

So you may be out of luck finding one unicode-complete monospaced font.

GNU Unifont includes all characters in the Unicode BMP, but I think it's pretty ugly.


  1. These are called Enclosed Alphanumerics. You can find DejaVu's coverage in their SVN, including specifics of which characters are covered.
  • It is not just the width of the fullwidth glyph or the width of glyphs in the fallback font. It is also a problem with multiple fontsizes: i.stack.imgur.com/UV15O.png – neic Mar 3 '15 at 16:05
  • @neic Interesting. Does the problem remain when you disable your theme (M-x disable-theme RET theme-name RET [you can tab complete your theme's name])? And what theme are you using? Also, are you using Emacs as a GUI or through a terminal? – nanny Mar 3 '15 at 16:32
  • I am using zenburn and GUI. It is the same when the theme is disabled. – neic Mar 3 '15 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.