Live data from Hacker News

Almost monospaced: the perfect fonts for writing

blakewatson.com

131–140 of 174 posts

Re: Almost monospaced: the perfect fonts for writing

#131
post #97

Earlier quoted context omitted.

I've been using proportional fonts in programming for about ten years. I stopped doing things like abc = 1 d = 2 which add very little readability value IMHO. Things like func(arg1, arg2, arg3) usually don't align well because func( has a different width than the five spaces in the lines below. However 1) my text editor (emacs) aligns those lines for me (probably any programmer's editor does) so at least I don't have…

I do something similar also with if() and others: if (condition... && condition... && condition... ) {

Same here but pushed it to force same column condition statement:

    if ((
      condition1
    ) && (
      condition2
    ) && (
      ...
    )) {

Re: Almost monospaced: the perfect fonts for writing

#132
post #78

A while ago, while repurposing an old laptop into a distraction-free “typewriter” I researched fonts with a typewriter-like aesthetic. Here’s what I found: Sun Gallant Demi, Solarize, Libertine/Libertinus Mono, Triplicate, Prestige Elite, CMU Typewriter, Latin Modern Mono, MingLiU, sony-misc, Verily Serif Mono, Century Schoolbook Mono BT, UM Typewriter, American Typewriter, Courier, Pitch, TiredOfCourier, Xanh Mono,…

>(I don’t remember which one I ended up using, though.) Buried the lede on that one. Was looking forward to the recommended typewriter font.

The freeware screenwriting program trelby had some articles that led to one recommending the use of courier prime. I use it when I am working on manuscript copy, it could probably do okay for programming as well.

https://www.1001fonts.com/courier-prime-font.html

Re: Almost monospaced: the perfect fonts for writing

#133
Here's proportional font for camelCase programming. It adds a padding to the left of the capital letters, and has a much wider space character.

https://ericfortis.com/portfolio/design#-verdana-camel

---

For aligning content, I think IDEs should be able to represent some parts of the code as tables. For example, similar to the Decision Tables of Jetbrains Projectional Editor:

https://youtu.be/iN2PflvXUqQ?t=357

Re: Almost monospaced: the perfect fonts for writing

#134
post #110

Earlier quoted context omitted.

> I long ago concluded that trying to line stuff up in columns like this in code is a mistake. It often results in realignment of blocks for small changes so what should be a small diff in the git history ends up being big. Seems wrongheaded to me; that's the same reason Elm wanted you to write arrays like this: [item1 ,item2 ,item3 ,item4 ] instead of a sane way. It means adding or removing an element only changes o…

Leading comma is better at resolving textual 3-way merges, e.g.: [ a [ a [ a , b , b / , b , c --> , c / , c , d , d / , dd ] , e ] ] Your usual 3 way merge algorithm will correctly deduce: [ a , b , c , dd , e ] Contrast this with trailing comma: [ a, [ a, [ a, b, b, / b, c, --> c, / c, d d, / dd ] e ] ] You now have a merge conflict between "d," and "dd". However, if you were to require a trailing comma after the f…

[deleted]

Re: Almost monospaced: the perfect fonts for writing

#135
post #61

Earlier quoted context omitted.

This just seems like a limitation of the technology. When you change the width of one column, the whole table should realign, without any changes to those parts of the file (it's just about how it's displayed). I recall reading something about "tab stops" that solved this problem, but I don't think there are any mainstream implementations of it.

I think you mean elastic tab stops https://nickgravgaard.com/elastic-tabstops/

Elastic tabstops actually mentions the input font in its "see also" section!

Re: Almost monospaced: the perfect fonts for writing

#136
post #32

Isn't the whole point of monospaced fonts columnar alignment (e.g. the table in the article)? Seems like "almost" defeats the point. Then again, I don't see values lined up much these days: { "someKey": "someValue", "someOtherKey:" "someOtherValue, and if you only care about leading whitespace (that is, the whitespace before a character appears on the line), maybe it doesn't matter how your font is spaced. I suspect…

I long ago concluded that trying to line stuff up in columns like this in code is a mistake. It often results in realignment of blocks for small changes so what should be a small diff in the git history ends up being big. Only rarely is the vertical alignment useful because mostly code isn't read vertically. Used in moderation, the reverse Christmas tree style used in the Linux kernel can be as good for readability (…

> ... trying to line stuff up in columns like this in code is a mistake.

I've encountered this sentiment more than a few times and I find it hard to accept. It totally makes sense to align repetitive stuff in columns. That's why people use tables in other contexts, and code should be no different. This alignment makes clear any deviations from the norm and lets you "see" the structure of the data easily.

It doesn't matter for minor stuff and, usually, the code linter/formatter is "good enough"-- but sometimes, you REALLY want to have columnar layout!

Re: Almost monospaced: the perfect fonts for writing

#137

This is the first time I've heard of iA Writer, it looks like exactly what I need right now for nanowrimo... focused on writing prose with some minimal feedback tools. Going to give it a shot!

My first time seeing it too, it really does look appealing! I am using Scrivener's very generous Nano demo this year (https://www.literatureandlatte.com/nanowrimo). Free from Oct 15 - Dec 7, and at the end of that you get a 50% discount if you hit 50k words, which is pretty cool. So anyway, I've got my outline and stuff all in Scrivener but maybe I'll try iA next year, or for some other markdown writing work. It kind of reminds me of what Tomboy notes felt like in GNOME back in the day.

Re: Almost monospaced: the perfect fonts for writing

#138
post #84

Earlier quoted context omitted.

The value of alignment (at least for me) is not in making the text of the code more readable. Instead, the value is communicating the structure of the code. Seeing the same shape repeatedly tells me a lot about what is happening. It also helps highlight changes between two lines that are very similar.

> the value is communicating the structure of the code. I agree and I think that is the same thing as code-readability. Code-readability means you can easily understand the code. I personally try to abide by what I call "hedge" formatting convention, the punctuation forms a vertical hedge which then shows the structure of your code clearly: [ a , b , c ] Moving my eyes down to look for the closing bracket is easier (…

Thanks, I hate it.

But as long as everything is written under the same guidelines, I will accept it.

Re: Almost monospaced: the perfect fonts for writing

#139

Isn't the whole point of monospaced fonts columnar alignment (e.g. the table in the article)? Seems like "almost" defeats the point. Then again, I don't see values lined up much these days: { "someKey": "someValue", "someOtherKey:" "someOtherValue, and if you only care about leading whitespace (that is, the whitespace before a character appears on the line), maybe it doesn't matter how your font is spaced. I suspect…

If you drop the awkward "3/4" width and just have 0.5, 1, 1.5 char widths, then you could recover alignment by using U+2009 as the half-width space, maybe entered as Shift+space.

Re: Almost monospaced: the perfect fonts for writing

#140

I use iA Writer Duo for writing prose and fiction a lot. If you're willing to pay for typefaces, though, there's a really good "almost typewriter" font called Triplicate, which comes in four versions -- the original, a slight variation with the same metrics as Courier, a "code" version that has a few characters changed to be better for coding (this is a great alternative to the more expensive Operator Mono, in my exp…

Unfortunately applying both Poly and Code gives you an imperfect result: the default l glyph has a flat base, Poly makes it narrower, and Code makes it a curly tail, but enable both (e.g. font-feature-settings: "ss01", "ss02") and you get the Poly glyph rather than the Code glyph or a hybrid, both of which would be nicer, and MB has said “won’t fix” (and I haven’t gone to the trouble of patching it myself). A demo of…

I'd never actually tried to enable both at once, but I'm not surprised it doesn't work. I love writing prose with Triplicate Poly, but I code with monospaced fonts, as neither most code editors nor most codebases seem to work that well with proportional fonts.
Post reply on HN