Customised version of Hack font

100 views
Skip to first unread message

David Grigg

unread,
Mar 31, 2018, 5:20:53 AM3/31/18
to Standard Ebooks
Hack is an open-source fixed-width font designed for use in software coding. (https://github.com/source-foundry/Hack)

I've been using it as the default font in Atom, my text editor of choice when working on Standard Ebooks productions.

The developers of Hack encourage you to customise it to your own needs, so today I've been having a play with that. One of the things I've found difficult in working on Standard Ebooks with Atom is that visually there was no difference between a hyphen and an em-dash. And when it comes to two-em dashes and three-em dashes, all I've been seeing was a square block.

Anyway, it occurred to me that I could modify Hack to provide unique glyphs for these characters. And so I've done that. I thought maybe the font might be of use to others working on these projects (of course, you are welcome to let me know that your text editor already makes this easy in some way...)

Anyway, this is very, very preliminary, I'll probably keep tinkering with the font to see what else I could add. Let me know if you are interested and I'll upload an OTF or TTF file when I'm a bit further along.

Here's a sample. There's a hyphen in 'jam-jars', then followed by a one-em dash. Previously they would have looked identical:




Alex Cabal

unread,
Mar 31, 2018, 3:16:43 PM3/31/18
to standar...@googlegroups.com

Great, thanks!

Also note that in the meantime, this is what the `unicode-names` tool is for. You pass it a string and it outputs the Unicode name of each character. This is precisely for differentiating between things like thin space, no break space, en dash, em dash, etc.

--
You received this message because you are subscribed to the Google Groups "Standard Ebooks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to standardebook...@googlegroups.com.
To post to this group, send email to standar...@googlegroups.com.
Visit this group at https://groups.google.com/group/standardebooks.
To view this discussion on the web visit https://groups.google.com/d/msgid/standardebooks/0644eb48-3215-47f7-9893-d323b5b79ef4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Grigg

unread,
Mar 31, 2018, 8:48:14 PM3/31/18
to Standard Ebooks

David Grigg

unread,
Mar 31, 2018, 9:07:07 PM3/31/18
to Standard Ebooks
'Unicode-names' is a great tool for seeing exactly what characters are in a string. But I want to be able to see visually the difference between hyphens and dashes, between two- and three-em dashes, etc. That's because I proof-read the xhtml code rather than the epub when doing my final read through. I then check the epub visually page by page to make sure all of the CSS is doing its thing and there are no weird layout issues.

Anyway, I've tinkered a bit more and I'm now posting up the current OTF version of a font I call 'MyHack' (not very original!). I've included the Hack License (which says you are free to modify and redistribute the Hack font provided you include the license).

Attached as MyHack.zip
MyHack.zip
Message has been deleted

Jonathan Kift

unread,
Apr 3, 2018, 12:46:47 PM4/3/18
to Standard Ebooks
Hi David,

I'm starting to use Atom as my primary editor. Do you know a way to send text to the command line and have the result replace the selected text? For example, I'd love to be able to select a title, hit a key, and have that selection replaced with the output of tools/titlecase. Sending the results of unicode-names to the output pane would be handy, too. I've done a fair bit of googling, but I can't seem to find a straightforward solution to what would seem to be a common situation.

~Jonathan

Alex Cabal

unread,
Apr 3, 2018, 1:08:11 PM4/3/18
to standar...@googlegroups.com

I use Sublime and it allows you to do that... and in fact I have titlecase and a few other tools macro'd in just exactly that way :)

--
You received this message because you are subscribed to the Google Groups "Standard Ebooks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to standardebook...@googlegroups.com.
To post to this group, send email to standar...@googlegroups.com.
Visit this group at https://groups.google.com/group/standardebooks.

David Grigg

unread,
Apr 3, 2018, 6:28:45 PM4/3/18
to Standard Ebooks
I'm on a Mac and I use Keyboard Maestro to do a heap of things like this. I have perhaps two dozen different keyboard shortcuts set up specifically for Standard Ebooks work. It's amazing what you can do with Keyboard Maestro, including calling third-party routines including shell scripts. I don't have the time to try this out at the moment (looking after grandchildren!) but I'm sure I could easily create a routine to do what you are looking for 

There are also a lot of good plug-ins for Atom, including a good TitleCase plug-in (https://atom.io/packages/title-case) which seems to produce identical results to tools/titlecase. Again I don't have time to research, but I would be surprised if there isn't one to let you pass things to a command-line script and return the result.

Alex Cabal

unread,
Apr 3, 2018, 6:29:51 PM4/3/18
to standar...@googlegroups.com
On 04/03/2018 05:28 PM, David Grigg wrote:

> There are also a lot of good plug-ins for Atom, including a good
> TitleCase plug-in (https://atom.io/packages/title-case) which seems to
> produce identical results to tools/titlecase.

Our titlecase is unique--please use ours :)

David Grigg

unread,
Apr 3, 2018, 6:31:41 PM4/3/18
to Standard Ebooks
Well, of course it always gets checked by Lint. But I'll have a go at creating a routine to call tools/titlecase directly -- once the grandchildren are gone!

Jonathan Kift

unread,
Apr 3, 2018, 6:44:49 PM4/3/18
to Standard Ebooks
Cool. I haven't seen anything Atom-specific, but that doesn't mean it's not there. I'm on Ubuntu, so maybe there's a Keyboard-Maestro-equivalent out there.

Also, this Hack font looks great! I'll give it a try on my next production.

Thanks for taking a break from the grandkids! Do they appreciate how big of a computer nerd you are? :)

David Grigg

unread,
Apr 3, 2018, 7:06:57 PM4/3/18
to Standard Ebooks
This Atom package seems to do the trick:


I installed it, selected text, and then ran the package, entered ~/tools/titlecase as the command and the text in the editor was replaced by the title-cased version. If I had more time I'm sure I could set it up to put in the command automatically.

David Grigg

unread,
May 11, 2018, 9:52:36 PM5/11/18
to Standard Ebooks
I've been continuing to tinker with my custom version of the Hack font for proofing ebooks in HTML mode (which is how I do it). Given that I find it hard to visually distinguish between left and right quotes, I modified Hack to display more obvious symbols. See examples below. Updated version of the font attached (now named EbooksHack). Feel free to download and use if you find it useful.

In fact, in grabbing the sample below, it revealed to me that I'd made an error, with a right-single-quote instead of a left at the beginning of the reported speech!


EbooksHack.otf
Reply all
Reply to author
Forward
0 new messages