Docstrings using non-fixed-width fonts?

Hi All,

I'm using Linux / Pycharm 1.5.1 (but problem appeared in 1.2 as well), and I'm having a minor, but irritating problem.

My docstrings appear to be using non-fixed-width font. Becaus the four spaces that occur before the docstring are using a fixed-width font, and becuase docstrings are multiline, this causes all of the docstrings to appear to have a messed up indention level.


I'm intentionally not formatting the code below in order to show the problem:

def blah():

___""" Start of comment.

...Next line text.

...Next line text."""

Now imagine the underscores are spaces in non-fixed-width font. Notice how the "Next line text" appears to be at a different indention level than the start of the docstring? It's very bothersome when using a language like this.

I can't seem to change this in the settings.

Settings->IDE Settings->Editor->Colors and Fonts->Python->Docstring

looks like it only as options to change the colors, and the Font type (bold, Italic), but not the type of font.

Does anyone know how to change this to fixed-width, or otherwise eliminate the overhang problem I'm seeing?

3 comments
Comment actions Permalink

I found the problem:


The problem is that using 'italic' on my system appears to either cause: a) fonts to be of a different width, or b) fonts to be non-fixed-width, and the default is for pycharm to use italic fonts for docstrings.

If I turn off italics, the over/under hang problem I described above goes away.

I'm surprised I didn't find the answer to this problem by searching the forums though... I couldn't be the only person who noticed this.

Does this problem not occur if you are using Windows/Mac or something?

0
Comment actions Permalink

I suspect it depends on the font.  I don't think I've had your problem with docstrings on my linux installation, but I had something similar happen with bold when I tried to get inconsolata working: http://devnet.jetbrains.net/message/5298340#5298340

Fonts in linux have always been tricky enough.  Throw Java in to the mix and things seem entirely incomphensible to me.

0
Comment actions Permalink

Hello Ryan,

This is indeed a Linux specific problem. The easiest fix for it is to change

the default editor font in Settings | Editor | Colors & Fonts from Monospaced

to something else (Bitstream Vera Sans Mono for example). Then you can keep

the italics for docstrings, and they'll be displayed correctly.

I found the problem:

The problem is that using 'italic' on my system appears to either

cause: a) fonts to be of a different width, or b) fonts to be

non-fixed-width, and the default is for pycharm to use italic fonts

for docstrings.

If I turn off italics, the over/under hang problem I described above

goes away.

I'm surprised I didn't find the answer to this problem by searching

the forums though... I couldn't be the only person who noticed this.

Does this problem not occur if you are using Windows/Mac or something?

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0

Please sign in to leave a comment.