2010-01-04

Every time a new version of Visual Studio is released it seems that some details change for the worst. Don't get me wrong there is also added value, but for the hardcore coder some design decisions seem rather obtuse.

I would argue that the most important part of an IDE is the editor. To get the most out of a code editor I always configure it with a font that give me the most amount of overview while still being readable. For me this threshold seems to be a font with the size of 6x10 pixels. While I have ClearType enabled where possible, for my coding font I prefer the extra clarity of a non-antialiased font.

When Visual Studio 2005 was in beta I noticed that each each line in the editor had an extra pixel added to it. I dutifully reported this bug at Microsoft Connect, but of course this was by design to allow for "squiggles". This lost me 10% of my vertical screen real estate. Not good I though, and after some redesign of my raster font I was able to make a special 9 pixel version of it only for use in Visual Studio.

Visual Studio 2010 Beta 1 was released in May. Eager to try out the new C++0x features of the C++ compiler I installed it and fired up the new version of the tool I spend a considerable portion of my day in front of. I proceeded to the options to select my font and... Well nothing. My font was not available for selection. Disappointed I uninstalled the beta and resigned myself to wait for the next beta. I did plan to report the bug, but other things kept my attention.

Back in October Beta 2 was released. The first thing I tried was configuring my font. Now it was available, but when I selected it the editor stayed the same, and after restarting it was not possible to open documents. I played around with some default fonts and it turned out that now instead of one extra pixel between lines there were two. Sigh...

After some googling the picture became clear. Something horrible had happened. The decision had been made that the editor was to be coded in WPF. Apparently this meant raster fonts are no longer supported in Visual Studio, only outline fonts. How could this have happened? What were they thinking at Microsoft, a code editor not supporting raster fonts? Surely not. While I saw the writing on the wall I still reported not supporting raster fonts as a bug, but alas it was not meant to be. I also reported the humongous line spacing. At least this was acknowledged and I was promised that RTM would revert to the Visual Studio 2008 less horrible one extra pixel per line.

The Solution
At this time I started looking for workarounds as getting Microsoft to care seemed doomed. I found a place to complain at the Visual Studio Blog, and some hope at WPF Text Blog.

It turns out that between Beta 1 and Beta 2 support for embedded bitmaps in East Asian fonts were added. Well great I though, it should be an easy thing to take advantage of this fact by fulfilling the criteria of being an east Asian font.

Turns out it was not that simple figuring out the criteria. Getting the embedded bitmaps to be used outside of Visual Studio 2010 was as easy as specifying certain MS Code Pages in the OS/2 Panpose table of the TTF. Making Visual Studio 2010 do the same thing seemed impossible.

The tool of choice for doing my font editing was fontforge, an open source font editor. After much tinkering with many setting I tried loading one of the default fonts that worked in Visual Studio 2010 and just exporting it again. Turns out that this action made the font not use the embedded bitmaps in Visual Studio. At a loss I asked Microsoft what properties a font needed to fulfill to be considered Asian. The answer lead me to believe that some kind of checksum or some other hard coded approach was used to decide to render the embedded bitmaps.

Ok I thought, lets forget about the embedded bitmaps. While looking for font editing tools I had stumbled on fontflasher. This tool converted pixelated fonts into outlines that correspond exactly to pixel boundaries. If this program could solve my problems it would be worth the cost, but it turned out that it didn't render my raster font correctly, but another font was used instead.

I could find no other program that could do the same thing, so I resigned myself to writing such a program. I proceeded to read and implement the various standards for reading and writing .FON, .FNT and .TTF files. In doing so I found out about the various properties and tables available in a TTF file, and with this knowledge in hand I thought I would give the embedded bitmaps a last try. While fiddling around with this I actually found a font that still used the embedded bitmaps in Visual Studio 2010 when reexported in fontforge. This font was 'MS Mincho'.

After much trial and error I found a list of requirements that would make Visual Studio 2010 use the embedded bitmaps in my custom font!

Here draw a rectangle that fills a portion of the descent of the font. Depending on the amount of descent filled in, the line spacing in Visual Studio will differ. If you fill in the whole descent the line spacing will be default, if you fill in only some descent the line spacing will be reduced. In this example I'm aiming for reduced line spacing.

Select View->24 pixel outline. This will display the outline glyphs for the font. We only have one outline that is not empty, and this is the A character.

Select the Space character (32) and press Ctrl+C to copy it's contents.

Scroll down to 12356 and paste with Ctrl+V. Do the same thing for all of the following characters:

You should end up with a view looking somewhat like the following. The characters in question and selected, and thus yellow.

Select File->Save to save your font.

Select File->Generate Fonts...

Make sure that TrueType and in TTF/OTF is selected and press Save. You might get a warning about Em Size, just press Yes.

Now just install your generated font by right clicking it in explorer and choose Install.

The font should now be usable in Visual Studio 2010. One caveat is that the font only works at the sizes that have bitmaps available, so make sure to select the correct point size, othewise the editor will be fully black except for the outline specified for A characters.

Example Font
Here is my custom 'Mono Pro' font, both in raster format and a special version for Visual Studio 2010 with reduced line spacing.
Now updated for correct line spacing in Visual Studio 2010 RC:Download MonoPro.zip

Ok, got Terminal to semi-work.In Fontforge when I'm generating the ttf, the box which I assume indicates what size is available says 12. And if I later choose 9 in Visual Studio it works. So if one is pt and the other px or whatever. So my question is, how do I construct a Terminal ttf that can display 6 (in Visual Studio)?

Kvasi, first of all you are the man!!!!!!Also, I love Terminal 9 pt as well, for those times when my eyes are tired. Can you please convert Terminal 9 pt as well. Between Terminal 6 pt and Termina 9 pt, we have the two best fonts ever made!

By the way, in case nobody else noticed, Kvasi actually removed on pixel of inter-line space, so you can actually fit more lines on the screen than you could using the raster based Terminal 6 pt in VS2008. Unfortunatelly, that also made this TTF font incompatible with VS2008 (VS2008 chops off the tops of characters, for some reason), but who cares :) . This is for VS2010. Now Kvasi, if you could just make a tight Terminal 9 pt. TTF we would be in heaven!!

Update: I have now fixed Kvasi's conversion of Terminal 6 pt to be correct (i.e., non-messed up highlighting and the original vertical spacing, instead of his vertically condensed spacing). I have also converted Terminal 9 pt, including 4 vertical spacings from original to very condensed (ala Kvasi). I would like to share all of this and will in the near future post Terminal 6 and 9 pt fonts as TTF with multiple vertical spacing options, from original, to very vertically condensed. The highlighting will be correct in all versions. Stay tuned...

Update: For the very impatient among you, here is Terminal 9 point in its original glory with properl highlighting and vertical spacing. IMPORTANT: When you select this font in Visual Studio, make sure you set the point size to 21 or it will not display properly:

Update: I spoke too soon. The highlighting was 1 pixel off, here is the corrected "fast track for the impatient" version. Remember to tell VS2010 that you want to view it as 21 point or you will not see the characters:

Update: For the impatient, here is the original Terminal 6 point with correct vertical spacing, fixed caret selection and better highlighting (see Note).

Note: This version deviates from the original Terminal in VS2008 with regard to the highlighting. The highlighting has been raised by 1 pixel. This was done because of the new VS2010 highlighting and to make caret based selection of text more accurate. For upper case letters and lower case letters without descenders, which is the vast majority of programming text, the highlighting centers the characters better. Also, tools such as Visual Assist for VS2010 seem to work better with this highlight spacing, as well. Actual vertical spacing of text is the same as in VS2008 using Terminal 6 pt, so you will get the correct number of lines per screen (adjusted of course for the new VS2010 look and feel). You must select 6 point size in VS2010 when you select this font or you want see a thing.

Making Lucida Console bold doesn't work for me in the VS2010 editor. It's a mixed bag. If you like the bold look of Terminal 9 pt, that's the way to go. If you don't like that bold look, you get arguably better readability (larger chars), more vertical lines and the same horizontal width using a hacked Lucida Console 10 pt. I don't want to post the hacked Lucida Console, but if you want to create a version yourself, the settings are:

You can use any TTF editor to make the change, and I recommend you don't overwrite the original Lucida Console and name the new font Lucida Console Tight. Lucida has very vertically long punctuation characters. The settings above effectively remove any vertical space between those characters, making them potentially touch (especially square brackets). For letters and numbers, though, things look fine.

Update: As promised, here is the complete Terminal 9 pt set. This includes the latest version of the original Terminal 9 pt, as well as two additional versions of Terminal 9 pt with modified line spacing (i.e., a -1 px and a -2 px version) for even more lines per screen. You can install all of them at the same time, because they have different easily identifiable names. Here are the stats at 1600x1200:

Update: Here is the Terminal 6 pt set, for people who love this font. It includes the original Terminal 6 pt and a -1 px version for more lines per screen, at some expense of readability. This is about as tight as you'd reasonably want to go with this font. The stats at 1600x1200:

Terminal 6 pt original: 108.5 linesTerminal 6 pt -1 px: 122.5 lines

At -1 px and with a 122.5 line count and assuming you can handle the very tight but not unreasonable vertical spacing, this is the most legible small font I know of. And now, it is truly VS2010 RTM compatible, with proper highlighting and caret select positioning.

Update: These fonts are VS2010 only! If you use these with VS2008, the lowercase character descenders will be partially clipped off. Also, please don't forget to use 6 pts for the "Terminal 6" font size and 21 pts for the "Terminal 9" font size, or all you will see is a bunch of thin rectangles where upper case A's appear on the screen.

Actually, sorry, Bitstream or MS decided to enforce their copyright on the Terminal font which is about 26 years old. I must say I am somewhat surprised, since the release of this font in TTF benefits Microsoft in more VS 2010 sales to Terminal font users. However, it is well within their rights to ban distribution of modified forms of this font and I will respect that. So, sorry folks, you will have to make these changes to your Terminal font on your own. If I have the time, I will post the actual offsets and other settings used to produce the TTF versions.

I'm trying to convert drift (from the artwiz-latin1 project at http://sourceforge.net/projects/artwiz-latin1/) and I'm almost there, but I'm running into a strange issue... My first try at converting it worked, but only at the sizes between 7.2pt and 7.8pt. (tested in WordPad) The problem here is that VS2010 doesn't allow you to put in decimal sizes, and since I can't specify a size in that range, it doesn't show up at all. The font shows up as being 10px / 7.5pt@96dpi in the Element | Bitmap Strikes Available dialog in FontForge. However, if I change the size in that dialog, it deletes all the glyphs, and if I add a new size (like 12px, which correlates to 9pt) I can't seem to copy the original glyphs over to the new ones.

How can I change this font so it shows up correctly at a whole-number point size instead of a fractional one?

Hi, Eric. I am trying to reproduce your results for the Courier font, but am unsuccessful. The fonts I create don't show any characters at any size (except the bar for the A character). I tried them in Visual Studio, in Notepad, even in my own rendering code that uses GDI.

As a test I downloaded your MonoPro font, opened it in font forge, changed the name and selected "Generate Fonts". The resulting TTF doesn't show any characters. Your original font does show up in Notepad at size 8. So somehow during the export some critical data gets lost.

Can you please list what version of font forge are you using? I am running the version from 9/14/2009.

Wow...That has to be the most bizarre, unexpected, and cryptic set of "Magic Instructions" I've ever seen. I have no idea how you figured that out...or how long it must have taken you...but you reduced my effort to about 5 minutes for a perfectly functioning Terminal 9pt font in Visual Studio (any any other TTF-only application!). Thanks a million for the heroic effort; I've been reading Terminal 9 in every text editor I've ever used for the past 25 years (yes, we had computers 25 years ago...), and the thought of losing it now is unthinkable.

To anyone else out there who wants to do this for any of your Raster fonts, as of 2010-11-20 using the current version of FontForge, the instructions are to-the-letter perfect; take your time, be careful, and follow them exactly, and you'll have a usable TT font in a couple of minutes.

Notes:

1) When he says "Draw a Rectangle" he means to pick the "Rectangle" tool (lower left corner) on the Drawing toolbox and draw the rectangle with that.

2) When he says to select "View->24 pixel outline", he means to go pick it from the MAIN window, not the Drawing window.

3) For anyone wondering what files are Terminal and Fixedsys, Terminal is VGAOEM.FON, and Fixedsys is VGAFIX.FON.

There is one issue you have to take in account - the font is usually created in pixelsize, while VS offers the font size in points, which are dependent on dpi. For instance, if you use 96 dpi, then font with pixelsize 12 can be selected as a pointsize of 9 in Visual Studio. Thus some bitmap fonts cannot be seen correctly, because VS cannot find the proper pixelsize for the selected pointsize. In this case you will see only the underlines, which stands for the letter A, because there are no other vector glyphs.

The easiest way to create some usable font is as follows:

1) Use the latest FontForge.2) Open some monospaced font, which is close to your preferences and which contains all characters that you need.3) In a Font Information dialog (Ctrl-Shift-F) in "OS/2->Charsets" add the page 950, Traditional Chinese. Then add the six Hiragana characters, as mentioned above.4) Create several bitmap-based glyphs (Ctrl-Shift-B), e.g. 9, 10, 11 and 12 pixels. Uncheck "Use FreeType" option, as it may create some letters with different width that the rest.5) Draw your own versions of glyphs. For the beginning, draw only a couple of glyphs, for instance the decimal digits only.6) Generate fonts (Ctrl-Shift-G), save the ttf. Install the font into your Windows.7) Open the Visual Studio and check, which font size shows your glyphs, try to recognize according to their shape, which pixelsize it may be.8) In FontForge remove all pixelsizes, which cannot be selected in Visual Studio. Draw all remaining glyphs in those pixelsizes, which have been correctly displayed in VS.

Fonts created this way can be used also in other favorite IDEs, such as InteliJ-IDEA, CLion or PhpStorm. Don't forget to uncheck the "Setting->Editor->Appereance->Use anti-aliased font" option.

I'm having a bit of trouble with a font I made with a service called FontStruct. It's a web service, and originally pixel fonts are just intended for Flash. I get major anti-aliasing problems, and I was wondering if you had any fixes I could do with FontForge that would fix my problem. Thanks in advance for helping me if you do!

I'm really loving the theme/design of your blog. Do you ever run into any internet browser compatibility issues? A number of my blog visitors have complained about my website not working correctly in Explorer but looks great in Safari. Do you have any solutions to help fix this problem? sign in hotmail

It is a time consuming process to locate a legitimate, high-quality designer Michael Kors Handbags On Sale at a decent price. One brand name that is sought after is the Michael Kors Bags On Sale. Anywhere you see high demand you will find people out to make a quick buck.

This is such a great resource that you are providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free. It is the old what goes around comes around routineobat benjolan di tangan

Issues related to Binance 2fa not working.2fa is the main component to preserve your Binance account from other malware activities that can create difficulties like virus attack, hacking attack and much more. If your 2fa is not working properly, you should get this problem fixed as soon as possible by dialing Binance support number. 800-665-6722 which is available all day and night and obliterate all the errors in a jiffy. The specialists are always there at your service, all you have to do is address them on time.

Joseph A. Bank, which was founded in Baltimore in 1905, has more than 600 stores. The companies did not announce whether any of those stores would close. "On this scale, we can do whatever we want, which is a lot of fun," Stephenson says of the small batches. "We sit down at the end of the day and decide what we're going to do next. We talk to [brewers in] Dublin about what they're brewing and compare that to what we're brewing.".

How does AI help specialty businesses, in particular? patriotic t shirts Consider Stonewall Kitchen, a Maine based food company. At Stonewall Kitchen, they use AI canelo shirts to predict what items a given buyer will want, individualizing the online sales process. Two customers may see different products prioritized for the same search based on navigation data.

Are you blacklisted? Struggling to get a personal loan? Has your application been DECLINED due to Low Credit Score? Over COMMITTED? Affordability? But you know you can afford this loan. Loans Approved in 4hours, you can email us at opploansLLC@gmail.com

Nice to be visiting your blog again, it has been months for me. Well this article that i’ve been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share :

I graduated from the same district and the noise level is extremely loud. Several students names have been drowned out by the make your own shirt cheap actions of others. Each parent needs to have respect for each other because everyone wants to hear the graduate name. Long before mcgregor shirts it was spawning some of the most mysterious hairdos in Tom Hanks' career, The Da Vinci Code became a literary phenomenon by giving history professors chest pain. Real historians were probably glad for the increased interest in the Bible as a historical document, and might even approve of Dan Brown's general depiction of history as a rich tapestry of mysteries, but they probably weren't quite as thrilled with Brown's promise that those mysteries have clear cut right and wrong answers, discoverable by anyone resourceful enough to solve a USA Today crossword puzzle. While the mysteries that his protagonist encounters during the course of the book might be a little obvious, the cryptograms and word puzzles didn't stop inside the pages of The Da Vinci Code.

If you need better online TV treatment, then Pinoy TV will serve you real good. With one website, you get all the directions that you need, to all that you need to see and know. This is, therefore.Click here to know more about TFC TV Live