Category Archives: Text Editors

Hacking Hack

4
Filed under Fonts, Text Editors, Visual Studio

First, the TLDR

Download my custom Hackd font here. Unzip, and install the two TTF files. That’s it.

On Programming Fonts

I’ve long been a fan of dedicated, monospaced programming fonts. I’ve even got a page here dedicated to a breakdown of most of the fonts I’ve had the opportunity to work with and review over the years.

I’ve used a number of these for a good period of time, including Consolas, Cascadia Code, and FiraCode among others.

But, for some time now, Hack has been my goto choice. It’s clear, simple, with good spacing, and excellent readability.

Alas…

As usual, though, there’s a few things that have always not sat well with me.

First, Hack has a peculiar dotted zero.

That’s just always seemed off to me.

Plus, it’s percent sign just didn’t jive with the rest of the font.

msedge_3oPHWPX4FB

And then there’s ligatures.

The Ligatures

If you aren’t familiar with ligatures, they’re basically substitutions of a single, conhesive glyph for 2 or more glyphs places next to each other.

For instance, a ligature for “greater or equal”, “>=” might look like this:

It’s important to note however, that ligatures are just a rendering nicety. They don’t actually change the characters you type at all. So, although it might look like one character on screen, your file’s content will still be “>=” just like it always has been.

I realize that there’s a lot of gnashing of teeth online about whether ligatures are worth it or not. In the end, I think it’s completely a matter of preference, and I happen to find them quite nice to look at and helpful during my day to day coding.

And Hack doesn’t have ligatures

When Monospaced isn’t Monospaced

Virtually all dedicated programming fonts are monospaced; every glyph has the same width. But, while a font might say that it’s monospaced, and might have all the right metadata to indicate that it’s monospaced, it turns out that all that doesn’t necessarily mean that it is monospaced.

In fact, there are some apps out there that detect a monospaced font not via metadata, but rather via a Windows call that actually tests if all the glyphs are the same width.

I happen to use a couple of those apps and, as it happens, Hack doesn’t pass that test, so it’s not listed as a choice for font in those apps. And that has been a (rather admittedly trivial) thorn in my side for some time now.

Introducing Hackd

So without further ado, I’d like to present my own take on a programming font; Hackd!

Hackd is based on Hack v3.003, used for most base symbols and upper/lowercase latin glyphs.

I then merged in glyphs from FiraCode v6.002 for all ligatures and pretty much all other characters.

Further, I pulled the % glyph from Firacode and tweaked it slightly to look more “Hack”ish.

 

And finally, I merged in the Powerline glyphs from “Hack Regular Nerd Font Complete Windows Compatible” from the NerdFonts collection.

NOTE: I left out virtually all of the excess glyphs from NerdFonts, including company logos, weather symbols, etc. I just don’t see much utility in having them in the font, unless, maybe, there might be some use for them in some kind of command line terminal customization? I did include the PowerLine symbols for that reason.

Would love to hear any comments on that…

How I Did It

I used FontForge for all manipulations.

I started with FiraCode-Regular and FiraCode-Bold.

Replaced all the glyphs from ! through ascii 255 with the Hack glyphs.

Then pulled all the powerline glyphs from the Hack NerdFont ttf file.

Replaced the % sign using the FiraCode version, then tweaked it by scaling it and repositioning it slightly to look better.

Tweaked all glyph widths to be the same. This automatically causes FontForge to generate a proper “monospaced” font that truly is considered monospaced. Originally, Hack had several glyphs that had a 0 advance, which caused the font to not be considered monospace, even though it really should be.

Updated various metadata in fonts to reflect the history, source, new name and version number.

Repeated all this for both the Regular and Bold versions of the font.

What About Italics?

Once that was done and the new fonts installed, the regular, italics, bold and bold italics alternatives were all available, so I did not create the BoldItalic, Italic, BoldOblique or RegularOblique alternatives as they didn’t seem necessary.

Disclaimer

I’m no fontographer, and I definitely couldn’t have done this without the fantastic work done by the Hack and FiraCode authors, much less the author of FontForge, so my hat’s off to all of them!

Font choice is a highly personal thing, and this work reflects my own personal preferences and taste. My main reason for documenting this is to show that there are tools available that make this kind of customization completely possible, if not easy.

 

Another Free Text Editor to Give NotePad++ a Run

0
Filed under Text Editors

imageI’ve used Notepad++ for years now. It’s a great free editor, is reasonably fast, very configurable, and had a fairly wide swatch a features, plus a very nice plugin architecture and quite a number  of nice plugins are available.

If you haven’t checked it out, it’s definitely something to investigate.

However, there are a few elements that I’d grown a little annoyed with, in particular the spell check (or rather a lack of spell check). Now there is a very nice plugin to give it  that’ “red squiggly underline spell check” that most all text-oriented apps have these days, so that’d good. The bad news is, for larger files, that plugin can make Notepad++ drag terribly.

So, I decided it was time to start looking for a possible replacement.

I’m not going to list all the editors I looked out. There’s tons of good editor reviews and lists out there. Googling “Best Free Text Editor” or just “Best Text Editor” will give you plenty of reading material.

But I did want to mention two that I came across and that are quite worthy of further investigation.

Sublime

The Sublime Editor is a new player. It’s not free, although the downloadable eval is fully functional. You’ll just get nag messages every 50 saves or so.

image

Sublime looks fantastic. Smooth animations, draggable, tabs, a document map scrollbar, themes, etc. All the standard fair is there, with a big glaring notable exception. They don’t provide ANY kind of configuration UI. Now, I’m pretty comfortable editing config from the confines of a text editor, so it’s not that it’s difficult. But seriously, expecting anyone to put together a set of colors for syntax highlighting using just a text editor is just a bit of a reach in my book. Plus, they want 59$ to register, but registering doesn’t even get you a config UI. And truthfully, for 59$, I can buy a full copy of UltraEdit, which is a far more polished editor, even if it doesn’t look near as good.

Long story short, Sublime is definitely an editor to keep an eye on. In a few years, it’ll be worth looking into again (or the project will be dead in the water, not sure which).

RJ Text Ed

RJ Text Ed has been around for a while, from the looks of it, but I’ve only just now come across it. How did that happen?

Rickard Johansson is the author, and I can honestly say, he’s put a lot of nice work into this application.http://www.rj-texted.se/bilder/main01-100.png

The default screens and colors leave a lot to be desired in my book, but then, I’m more of a White on Black editor kind of guy than black on white, so that’s the first thing I did, change out the theme and all the syntax highlighting colors.

The good thing is, though, that that’s all very easy to do with this editor.

There’s all the things you’d expect: Macros, Syntax coloring, tabs, etc, but then a few things you might not, like a full project system (for grouping sets of files you’re working on), colorable tabs, 2 file explorer windows that are quite capable in and of themselves, simultaneous editing of multiple locations, a function list parser and navigator, the list goes on.

Plus, Rickard seems very active with development, and there’s a fairly active forum he runs at the website.

All in all, a very capable editor and a nice free alternative to NotePad++.

Check it out.