Wednesday, December 29, 2010

Visual Studio 2010 vs. Inconsolata font, part 2

Recently, someone notified me that TTF version of popular Inconsolata font had released and is accessible here. There were some troubles with the OpenType version of the font, so you had to convert it manually to TTF format in order to use in Visual Studio 2010.

So, I’ve downloaded and installed it immediately. The font appeared in Visual Studio 2010 font list. Good. I’ve set it as a default font for text editor and what I’ve seen? Something unexpected:

Inconsolata in Visual Studio 2010

All kind of braces are being rendered in bold, the same goes for semi-colon and comma symbols. But wait, may be the problem is not in VS2010 and the font has troubles? Let’s check the hypothesis and do the same in VS2008:

Inconsolata in Visual Studio 2008 

Looks amazing!

Checking the hypothesis in Notepad:

 Inconsolata in Notepad

Again, no problems. The font is really awesome.

So what are the problems with that Visual Studio 2010 text editor? What were the reasons to change the bug-free and greatly working component from Visual Studio 2008 to this unreliable child of modern technologies? I don’t know.

P.S.
If you find a workaround, please, notify me. Thanks.

30 comments:

  1. I downloaded ttf version of inconsolata, but i saw that ttf version is not working as antialised in ssms and vs 2010

    when i install otf version, font becomes antialised (of course only in ssms, i cant see font in vs 2010)

    how can i make TTF version work as antialised in vs 2010 ?

    ReplyDelete
  2. Hello,

    Unfortunately, I don't know how to fix issues of the font rendering in Visual Studio 2010. It seems that we should wait for an updated version of the font from its author.

    ReplyDelete
  3. but you have same issue too , right ?

    ReplyDelete
  4. Right.
    VS 2010 code editor, which is written on WPF, has some troubles in font rendering, it has its own rendering engine and it doesn't rely on Windows rendering system. That is the root of all evil.

    ReplyDelete
  5. Just tried this and found that I see the 'bold braces' problem in C# but not C++. Curiouser and curiouser...

    ReplyDelete
  6. I can hardly believe this. I was thinking that there is one editor for all languages and it is "configured" with a set of syntax rules, etc.

    Btw, I'm just curious, what if you take an ordinary C# file and change its extension to '.txt', will these 'bold braces' still remain?

    ReplyDelete
  7. Hi,

    Did you check this out? It's still not perfect (braces look weird in VS2010) but it's a lot better: http://pgl.yoyo.org/bits/tech/inconsolata-cleartype-raph-leviens-inconsolota-font-hinted-for-windows/51:2008-09-25/

    ReplyDelete
    Replies
    1. Hi, looks like in this post I used the version you are pointing to (see the first sentence) and it had troubles with braces and commas. But anyway, thanks for the comment.

      Delete
    2. Yes, I was in a hurry with the link, there is actually a newer version (with less problems): http://code.google.com/p/googlefontdirectory/source/browse/inconsolata.

      It's a real pity VS2010 does not render it properly.

      Delete
    3. Wow, thanks a lot!

      Can't wait to try it. Hoping that the font became more usable in VS 2010.

      Delete
    4. Hmmm, just have downloaded the 'Inconsolata-Regular.ttf' and found out that it is binary equal to 'Inconsolata.ttf' from Dec 2010. So they only added 'Inconsolata-Bold.ttf' and that's all. =(

      Delete
    5. Yes but the point is that the hand-crafted bold version is much nicer than the synthetic bold style used before, so it looks not so bad: screenshot.

      Delete
    6. Ahh, finally got the point! The screenshot shows that it looks much better now.
      Will try again and may be write one more post. How could I refer to you, Mister X?

      Delete
    7. Here you go. No big deal :)

      Delete
  8. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. Bogdan, that's awesome. I'll try the updated set of fonts today and publish the results.

      Thanks a lot!

      Delete
    2. Bogdan, it seems to work perfectly. I'm really happy with that version of the font.

      Could it be shared officially? Is that possible and how?

      Delete
  9. As for how it can be shared officially, I don't know yet, maybe Dave can clue us in on that.

    ReplyDelete
  10. Hey, apparently my comment disappeared!?

    So the story is that I contacted Dave Crossland with this (as he provided the hinted Inconsolata for Windows). Dave is involved with a lot of libre font projects and he kindly agreed to help. He created 3 files, a Regular with true 'Regular (400)' weight metadata, a Regular with fake 'Bold (700)' weight metadata, and a NEW and true Inconsolata Bold (700) which was recently published in Google Web Fonts.

    I made an arhive with the files, which can be downloaded from my public dropbox: Inconsolata.7z

    -

    ReplyDelete
    Replies
    1. Bogdan, the comment is strangely vanished.

      Wouldn't be the right way of publishing that version of font is to upload it to the google fonts directory as Dave did earlier? Could you ask Dave about that? I think that there should be the only one public source of the font, so sharing it in a blog won't be a good idea.

      Delete
  11. WARNING... All the Inconsolata TTF versions I've tested have the same problem, the space size is incorrect, there's a error rate that's accumulated and the alignments of text lines with several spaces is a mess (much longer than it should be).
    But in the original Inconsolata.otf the alignments are almost perfect AND in the TTF conversion made by Dave Crossland (thanks Bogdan for the link!).

    Cheers,

    Javi

    ReplyDelete
  12. Ah! One more thing, if you want to use Inconsolata with a perfect alignment in VC++2010 install Inconsolata-Regular-400.ttf and Inconsolata-Bold.ttf and set a font size of 9 or 12.

    Javi

    ReplyDelete
  13. HOw does Inconsolata TTF work in VS 2012?

    ReplyDelete
    Replies
    1. Haven't tested yet. As soon as I have VS 2012 installed, I'll post about it.

      Delete
  14. waiting for confirmation - does VS 2012 support OpenType fonts?

    ReplyDelete
  15. The otf version is supported in VS 2012. However, the 11pt size has a problem, I noticed the character '=' actually shows like a minus '-'. It is displayed correctly in sizes 10 and 12. Screenshot of the 10pt font: https://dl.dropbox.com/u/52140670/inconsolata-10pt-otf.png

    ReplyDelete
  16. Here is the update for the latest version of ttf version of Inconsolata and Visual Studio 2010 & 2012: http://dmitrimaximov.blogspot.ru/2012/11/visual-studio-2010-2012-vs-inconsolata.html

    2 Bogdan: I've tested ttf version in 11,12,13 sizes and all of them looks nice.

    ReplyDelete
    Replies
    1. The ttf yes, but the otf has some rendering problems.

      Delete
    2. Yeah, I understand. Just wanted to clarify the situation with ttf version if anybody reads us...

      Delete