Elastic tabstops news http://nickgravgaard.com/elastictabstops/news/ Latest news about development of Elastic tabstops en Elastic tabstops for Scintilla http://nickgravgaard.com/elastictabstops/news/scintilla-implementation/ <p>Some time ago I found out that David Kinder was working on adding elastic tabstops to the Windows version of <a href="http://inform7.com/">Inform 7</a>, a system for writing text adventure games. The Windows version uses <a href="http://www.scintilla.org/">Scintilla</a> as its text editing widget so David set to work on porting my Gedit implementation to Scintilla. With David's blessings I've put the code up on GitHub <a href="https://github.com/nickgravgaard/ElasticTabstopsForScintilla">here</a>.</p> <p>This is actually fantastic news as there are many text editors on various platforms which use Scintilla (see <a href="http://www.scintilla.org/ScintillaRelated.html">here</a> and <a href="http://texteditors.org/cgi-bin/wiki.pl?ScintillaEditorFamily">here</a>). Notable examples include <a href="http://anjuta.org/">Anjuta</a>, <a href="http://www.codeblocks.org/">Code::Blocks</a>, <a href="http://www.geany.org/">Geany</a>, <a href="http://notepad-plus-plus.org/">Notepad++</a>, <a href="http://www.activestate.com/komodo-ide">Komodo</a>, <a href="http://www.pnotepad.org/">Programmer's Notepad</a> and <a href="http://www.scintilla.org/SciTE.html">SciTE</a>, and hopefully we'll start to see some of these add support for elastic tabstops soon.</p> <p>By the way, in case any of the developers of those editors are reading this and need to know how to convert text formatted using elastic tabstops to use spaces instead (and vice versa), there's some Python code I wrote which does that <a href="http://pypi.python.org/pypi/ElasticTabstops/">here</a>.</p> "Elastic tabstops lite" http://nickgravgaard.com/elastictabstops/news/elastic-tabstops-lite/ <p>I was contacted the other day by someone who works on Ace, an open source browser based text editor, to tell me that he's been working on a version of elastic tabstops based on the Sublime Text editor extension at <a href="https://github.com/SublimeText/ElasticTabstops">https://github.com/SublimeText/ElasticTabstops</a>. This sounded great until I realised that the extension does not actually implement elastic tabstops at all. Apparently some users of Sublime Text had been asking for elastic tabstops but since that editor doesn't have an API which allows users to set tabstops at non-uniform positions on different lines, and since it's closed source so there's no way for them to change the API, they came up with a hack instead. This hack looks at cells above and below the one that's being edited and appends/removes spaces to/from the ends of them to keep things lined up. It changes the contents of the buffer (ugh!) rather than changing the view.</p> <p>This does keep things aligned but it has some significant disagvantages over proper elastic tabstops:</p> <ul> <li>only works with monospaced fonts</li> <li>means text cannot be replaced outside the editor through the use of sed etc. and still line up</li> <li>mixes tabs and spaces</li> <li>columns of text suddenly jump to the next fixed tabstop position once a cell gets too wide</li> <li>obviously an ugly hack</li> </ul> <p>Inserting spaces in the buffer to push text to the next fixed tabstop position is obviously an ugly hack but I'm charitably going to call this &quot;elastic tabstops lite&quot; since it does have a similar effect even if the tabstops aren't being moved at all. If you end up implementing this hack, please use the name &quot;elastic tabstops lite&quot; so that users don't get confused.</p> Announcing a limited public beta for my upcoming Visual Studio 2010 extension http://nickgravgaard.com/elastictabstops/news/vs2010-limited-public-beta/ <p><strong>Update on 2012-03-10: I'm still working on the Visual Studio 2010 extension - please be patient.</strong></p> <p>The beta version of my Visual Studio 2010 extension will soon be available to a limited number of users. A considerable amount of effort has been spent getting it to this stage but I want to polish it a bit before making it available to everyone. Please email "me" at this domain if you'd like to play with it (numbers will be limited). It will help me if you can explain why you think you will be a good tester.</p> <p>Meanwhile the Eclipse version will remain stalled until <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=318356">this bug</a> is fixed. If you'd like to help it along please add your support to getting it resolved.</p> Python package and new Gedit plugin http://nickgravgaard.com/elastictabstops/news/python-package-and-new-gedit-plugin/ <p>Recently I found a bug in the Python code which converts text from using spaces to using tabs with elastic tabstops (and vice versa), so I spent a lot of time rewriting the code as well as writing unit tests so that it was easier to fix the bug. When I finished fixing the code I thought it would make sense to split the core functionality out into a Python package so that it could be used by other projects. You can see the package at PyPI <a href="http://pypi.python.org/pypi/ElasticTabstops/">here</a>, and install it using <tt>sudo easy_install ElasticTabstops</tt></p> Blog and RSS URLs have changed http://nickgravgaard.com/elastictabstops/news/urls-have-changed/ <p>The URLs for the blog and RSS feed have changed, so please update any bookmarks from http://nickgravgaard.com/cgi-bin/elastictabstopsnews/blosxom.cgi to <a href="http://nickgravgaard.com/elastictabstops/news/">http://nickgravgaard.com/elastictabstops/news/</a>, and from http://nickgravgaard.com/cgi-bin/elastictabstopsnews/blosxom.cgi/index.rss to <a href="http://nickgravgaard.com/elastictabstops/news/index.rss">http://nickgravgaard.com/elastictabstops/news/index.rss</a></p> Programming fonts: proportional vs monospaced http://nickgravgaard.com/elastictabstops/news/programming-fonts/ <p><strong>Update on 2012-03-10: Someone wrote a link to some interesting proportional programming fonts in the comments section. <a href="http://code.google.com/p/i3project/wiki/Fonts">Here</a>'s the link.</strong></p> <p>One of the main reasons why I originally invented <a href="http://nickgravgaard.com/elastictabstops/">elastic tabstops</a> was because I'm a big fan of using proportional fonts for programming. As programmers we spend most of our time looking at code and in my opinion proportional fonts make this an easier and more pleasant experience. The creators of <a href="http://nickgravgaard.com/elastictabstops/smalltalk.png">Smalltalk</a>, <a href="http://nickgravgaard.com/elastictabstops/oberon.png">Oberon</a> and Plan 9's <a href="http://nickgravgaard.com/elastictabstops/acme.png">Acme</a> seem to agree.</p> <p>I've made some screenshots of Gedit using my <a href="http://nickgravgaard.com/elastictabstops/gedit/">elastic tabstops plugin</a> (minimum-width: 32, padding-width: 8) and the <a href="http://github.com/mig/gedit-themes">zenburn theme</a> with some different fonts I have installed on this Ubuntu system. The C file displayed is <a href="http://nickgravgaard.com/elastictabstops/newsmedia/bottlesofbeer.c">here</a>.</p> <ul class="nobullets"> <li> <img style="width: 732px; height: 231px;" alt="" src="http://nickgravgaard.com/elastictabstops/newsmedia/bob_courier10pitch_10.png"> <p>Courier 10 Pitch is one of IBM's serifed typewriter faces by Howard Kettler in Lexington in 1956. It's comparable to Courier New, but since I'll be covering a lot of Microsoft's core web fonts in this article I thought I'd use this font rather than the later derivative.</p> </li> <li> <img style="width: 731px; height: 226px;" alt="" src="http://nickgravgaard.com/elastictabstops/newsmedia/bob_andalemono_10.png"> <p>Andale Mono's a typical programmer's monospaced font. Let's see how it compares with the proportional fonts in the list.</p> </li> <li> <img style="width: 578px; height: 226px;" alt="" src="http://nickgravgaard.com/elastictabstops/newsmedia/bob_arial_10.png"> <p>Ah, Arial. I'd rather have taken a screenshot of Helvetica but I don't have it. This is my least favourite of the sans-serif proportional fonts listed in this article, but I think it's still an improvement on the 2 monospaced fonts above.</p> </li> <li> <img style="width: 548px; height: 212px;" alt="" src="http://nickgravgaard.com/elastictabstops/newsmedia/bob_timesnewroman_10.png"> <p>And here's good old Times New Roman. I think the italic version of this font was used for the code excerpts in Stroustrup's "<a href="http://www2.research.att.com/%7Ebs/3rd.html">The C++ Programming Language</a>" book. Of the fonts listed here, this one's the thinnest. Those squiggly brackets look a bit strange to me though.</p> </li> <li> <img style="width: 583px; height: 226px;" alt="" src="http://nickgravgaard.com/elastictabstops/newsmedia/bob_georgia_10.png"> <p>Georgia is my favourite of the proportional serif fonts listed here, and it's by Matthew Carter, who Microsoft commissioned to design 2 fonts (the other being the sans-serif Verdana) specifically for screen readability.</p> </li> <li> <img style="width: 573px; height: 226px;" alt="" src="http://nickgravgaard.com/elastictabstops/newsmedia/bob_trebuchet_10.png"> <p>Trebuchet's not bad, but there's better further down.</p> </li> <li> <img style="width: 594px; height: 226px;" alt="" src="http://nickgravgaard.com/elastictabstops/newsmedia/bob_lucidasans_10.png"> <p>Lucida Sans is pretty good and worth a look, especially if you can't or won't use Microsoft's fonts for whatever reason.</p> </li> <li> <img style="width: 645px; height: 240px;" alt="" src="http://nickgravgaard.com/elastictabstops/newsmedia/bob_verdana_10.png"> <p>And now my favourite, Verdana, also by Matthew Carter. It's exceptionally readable, possibly due to it's wide characters (but still much thinner than the 2 monospaced fonts at the top of the list). It was also designed to have pretty loose letter-spacing and emphasised distinctions between similarly-shaped characters to increase legibility (important in a programming font). You can read more about why this font (and Georgia) is so great for the screen <a href="http://www.will-harris.com/verdana-georgia.htm">here</a>. This is what I use every day.</p> </li> <li> <img style="width: 561px; height: 198px;" alt="" src="http://nickgravgaard.com/elastictabstops/newsmedia/bob_verdana_8.png"> <p>I put this on the end for fun. It's Verdana at size 8 without anti-aliasing and it's what I used to use when resolutions were lower and before anti-aliased fonts were widely used. It's still pretty readable though.</p> </li> </ul> <p>So that's the list. I hope you'll agree that proportional fonts are much easier to read than monospaced ones. You can use them for coding now (as long as no one tries to align text for anything other than indentation), and if elastic tabstops catch on you'll be able to use them for aligning text as well as indenting. I'm working on a plugin for Eclipse now (since a blocking missing feature has now <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=279356">been implemented</a>), so depending on which tools you use that day may be coming soon.</p> Support for more editors in the works http://nickgravgaard.com/elastictabstops/news/support-for-more-editors-in-the-works/ <strong>Visual Studio 2010</strong><br /> Following my last post last year (I really should try and post more frequently), someone from the Visual Studio development team at Microsoft got in contact with me (thanks Noah!). It looks like I will be able to implement elastic tabstops in Visual Studio after all, since VS 2010 should allow me to set non-uniform tabstops on different lines. I think I'll wait until the final version's released before I do anything else.<br /> <br /> <strong>Eclipse</strong><br /> I had a look into what it would take to get elastic tabstops working on Eclipse. Unfortunately it looks like SWT (the toolkit Eclipse uses) will not let one set non-uniform tabstops on different lines, which is a pre-requisite for the implementation of elastic tabstops. If you're an Eclipse developer (or feel like creating an account) you can vote this bug up <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=4866">here</a>.<br /> <br /> <strong>NetBeans</strong><br /> In contrast with Eclipse, NetBeans uses Swing, which is a toolkit that already supports the implementation of elastic tabstops (as can be seen in my demo applet <a href="http://nickgravgaard.com/elastictabstops/#tryitrightnow">here</a>). When I get time I'll try and look into writing a plugin for this IDE.<br /> <br /> <strong>Another editor supports elastic tabstops - Code Browser</strong><br /> Marc Kerbiquet emailed me last month to tell me that he'd added elastic tabstops to his editor: <a href="http://code-browser.sourceforge.net/">Code Browser</a>. He's also written a rather nice <a href="http://code-browser.sourceforge.net/elastic-tabstops.html">advocacy page</a>. Since it's cross platform this is probably the first editor to support elastic tabstops that runs on Windows. (There's also <a href="http://live.gnome.org/Gedit/Windows">Gedit on Windows</a>, which I'd like to see get more attention.)<br /> <br /> <strong>Plans for an editor of my own</strong><br /> I'm planning to start work on a new cross-platform editor which will of course support elastic tabstops. I have a few innovations I'd like to try, but I also intend to borrow ideas from the best, and I'll also make it scriptable so people can extend it as they see fit. The reason for this is that changing every single editor that exists is impossible, but by making an easily scriptable cross-platform editor which supports elastic tabstops from the start it should be possible for people to script it to feel like their favourite editor. Watch this space... An update and a request for help http://nickgravgaard.com/elastictabstops/news/an-update-and-a-request-for-help/ Well, it's been a while so I figured I should give everyone an update. Just over a year ago I released a plugin for Gedit. It works fine, but there are a couple of issues with it, the main one being that Gedit currently only exists on Linux and other X based platforms, and no ports exist for Windows or Mac OS X. The second issue is that it uses an inefficient yet relatively straight forward algorithm which recalculates everything every time the text changes (like my <a href="http://nickgravgaard.com/elastictabstops/#tryitrightnow">Java demo</a>). As a result I decided to make a better solution that is cross platform and caches the information it needs properly. I've decided to use PyGTK (the Python bindings for GTK) to make my own editor and I hope to have something I can share with you soon. Once my Python implementation is finished I'll also be able to replace the C based Gedit plugin with something which is faster and less work for me to maintain. Also, to make it easier for people to see the idea in action I've reworked my <a href="http://nickgravgaard.com/elastictabstops/#tryitrightnow">Java demo</a> on the <a href="http://nickgravgaard.com/elastictabstops/">main elastic tabstops page</a> so it can be embedded in the page as an applet.<br /> <br /> In other news, my job was outsourced a couple of weeks ago, and while I don't think I'll have too much trouble finding another one, I thought I'd use the time off as an opportunity to see if I can advance my goal of getting <a href="http://nickgravgaard.com/elastictabstops/">elastic tabstops</a> adopted in a major editor. I believe that the concept of elastic tabstops is a real improvement over the status quo, as presumably do some <a href="http://episteme.arstechnica.com/eve/forums/a/tpc/f/6330927813/m/568008754831?r=125008674831#125008674831">Visual Studio users</a>, <a href="http://www.wholetomato.com/forum/topic.asp?TOPIC_ID=6305#26784">Visual Assist X (a Visual Studio add-in) users</a>, <a href="http://it.slashdot.org/article.pl?sid=06/07/03/1820235">Slashdot editors</a>, <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=149603">Eclipse developers</a>, <a href="http://www.joelonsoftware.com/items/2006/07/03.html">ex Microsoft Excel program managers</a> and many others. Since developers for Microsoft's platform pretty much all use Visual Studio exclusively, it occurs to me that elastic tabstops could be adopted without developers for the platform suffering from the chicken and egg problem that developers on other platforms may face. So, if you work at Microsoft (or know someone who does) now would be a great time to speak to someone on the Visual Studio team about getting them to help me add this feature.<br /> <br /> Let's see if we can make things better for programmers. A proper elastic tabstops plugin for gedit http://nickgravgaard.com/elastictabstops/news/proper-plugin-for-gedit/ Right, following Paolo Maggi's suggestion on the gedit mailing list, I've turned the gedit patch into a proper plugin and made the following fixes:<br /> * Other chars than just \n can now terminate paragraphs<br /> * Italic and bold characters are now handled properly<br /> * The minimum width and padding width values can now be configured using gconf<br /> Go to <a href="http://nickgravgaard.com/elastictabstops/gedit/">nickgravgaard.com/elastictabstops/gedit/</a> for more information, and please email me if you have any problems. Introducing elastic tabstops in gedit http://nickgravgaard.com/elastictabstops/news/gedit/ I've been pretty quiet for a while, but that's because I've been busy hacking gedit to support elastic tabstops. I've also made a plugin for gedit that allows users to work on projects which use spaces for alignment. To see a screencast of it in action or to download it, visit <a href="http://nickgravgaard.com/elastictabstops/gedit/">nickgravgaard.com/elastictabstops/gedit/</a> New demo of elastic tabstops solves previous version's blank line issue http://nickgravgaard.com/elastictabstops/news/new-demo/ Judging from the feedback I've received so far, many people liked the concept but complained that the demo implementation meant they had to insert blank lines where they wouldn't normally. Well, I've been working on this for a few days and have come up with a variation on the previous system. Whereas the original system split the text into blocks (whenever it found a blank line), lined up all of the tabs in each block and then stretched each tabstop to fit the widest piece of text in each column, the new version takes advantage of the nested nature of code. As before, it works by creating an array from the text using tabs as the delimiter, but this time it finds a column block by looping through each column individually until it finds a missing tab and then it resizes that column block to fit the widest piece of text it contains. The result is a system that doesn't need all the blank lines that the first version did and makes better use of horizontal space. It also minimises the amount of text that moves on other lines when text is modified.<br /> <br /> Please try the <a href="http://nickgravgaard.com/elastictabstops/ETNotepad.jar">new version</a> and give me your feedback. If you'd like to compare it with the old version you can try that <a href="http://nickgravgaard.com/elastictabstops/ETNotepad_old.jar">here</a>...<br /> <br /> <img src="http://nickgravgaard.com/elastictabstops/gridlines.png" alt="grid lines" width="600" height="545" /> Post about first public version of elastic tabstops http://nickgravgaard.com/elastictabstops/news/first-post/ Okay, it's been suggested I create a way to keep people informed, so here it is.