Show HN: Coding Font – A game to find your favorite coding font
codingfont.com
codingfont.com
- Center the code samples on the page. So that your not unintentionally one over the other due to differences in viewing angle and vision ability.
- Make all the fonts equal in height regardless of font point. Knee jerk reaction will be to go with the font that is closest to a persons normal preference.
- Hide Font names and size/points.
- Light theme and other color options.
- Other programming language options.
- jiI1l0O test. I like to see those characters that can often be too similar in shape shown together.
- Controversial, throw in some non mono-spaced fonts.
This is a big one for me. None of the sample text had a capital O to compare to 0.
// The five boxing wizards jump
#include <stdio.h> // <= quickly.
int main(int argc, char **argv) {
float il1[]={1-2/3.4,5+6==7/8};
int OxFaced=0xBAD||"[{(CQUINE";
unsigned O0,l1,Z2,S5,G6,B8__XY;
printf("@$Hamburgefo%c`",'\n');
return ~7&8^9?0:l1|!"j->k+=*w";
}
It has a pangram, lots of confusable pairs of characters adjacent to each other, opening brackets next to each other and near a pipe character, quotes and commas next to each other, lining operators (i.e., ->, += and <=), and every normal punctuation character on a US keyboard. It also happens to be a valid, though useless, C or C++ program.I know I'm not the only one that uses one. Specially I use Input which has both mono and proportional versions and designed for programming.
In the past I used Verdana, Georgia, and Trebuchet MS. That last one may seem like an odd choice, but I really like the way it renders on a high-DPI display, with thick readable strokes and easily distinguished "confusable" characters.
Trebuchet MS does have some flaws, so I started customizing it into what I call Trebuchet++. What got me started on this was the poor tilde in TMS. I swapped in a better one with FontForge, and then started experimenting with a few other things.
One thing that bothered me in particular about proportional fonts is that the underscore character is so much wider than a period. This creates the wrong visual grouping in something like this:
name_with_underscores.method_with_underscores()
The default spacing causes "underscores.method" to be bound tighter visually than the individual names on each side.
So I edited the underscore to add negative spacing while keeping the underscore itself fairly wide. And I added positive spacing around the period. This makes it more clear visually that "name_with_underscores" and "method_with_underscores" are individual names separated by the dot.
The next tweak I plan on is adding some positive spacing after a "(" and before a ")" and similarly with [] and {}. It makes me sad that modern coding standards prohibit spaces inside (), [], and {}, even though it makes so much sense logically to have spaces inside them.
If I can't fix my company's mandatory code formatter, at least with a proportional font I can adjust it to put just a bit of whitespace there.
In the meantime, if you drop me an email (address is in my profile) I will be happy to send you a copy of the FontForge project and the compiled .ttf font.
- Option to lock scrolling so they both scroll at the same time.
- Button to flip them in place to help see the differences.
- ligatures
- italics
Also, please make it an option to hide the font names so that it is a true blind comparison.
Awesome idea, though!
Try it out!
- Allow line-height adjustment.
- Add Lucida Console (still my favorite coding font at 8 px cap height). :)
I like the current scheme which keeps the line height or px equal I'm guessing. So this should be a toggle-able option.
Another feature request: It'd be nice to compare the overall width of each font in terms of having 80 or 100 or 120 character limits on width. I'm always wondering what font is the best for viewing two files side-by-side on a 1280x800 display.
I ended up with my current IDE font (Fira Code) winning. Could be that I just prefer this font or I'd accidentally gone with a familiar option.
My main reason for liking both is ligatures support, which the website failed to show off.
One property that might make that list is whitespace between lines. This one is misleading though since it can be adjusted when rendering (in some IDEs) with leading.
Same for me, even the same font as for you, Fira. I just find it very clear and simple and it supports a great set of ligatures. A lot of other fonts I didn't like at all. So maybe I subconciously chose this, but I feel it's also just a reflection of my demands for a coding font.
But I agree that it might be good to try it anonymized -- I was very impressed by the eventual winner when I saw it early on, and I remembered its name. I could feel myself slightly favoring it in later matches. Then again, maybe that's a reasonable part of the process -- this isn't really an objective judgement to be making in the first place.
Single elimination also isn't likely to produce the "one true" result, unless the initial pairings were very carefully chosen to partition the design space. (I think they were random, so the result is somewhat arbitrary.) Still a fun little exercise, though.
I ended up picking Noto Sans Mono by a very slim margin over Fira Code. Interesting...
Edit: Clicking 'Restart Tournament' seems to spawn a worker that pushes my CPU over 100%. Open source your code, perhaps?
I always get a comment on the font when I screenshare...
[0]: https://www.tes.com/news/does-comic-sans-really-help-dyslexi...
{ "statusCode":400, "error":"Bad Request", "message":"{\"error\":{\"code\":429,\"message\":\"Quota exceeded for quota metric 'Queries' and limit 'Queries per day' of service 'webfonts.googleapis.com' for consumer 'project_number:524817652413'.\",\"errors\":[{\"message\":\"Quota exceeded for quota metric 'Queries' and limit 'Queries per day' of service 'webfonts.googleapis.com' for consumer 'project_number:524817652413'.\",\"domain\":\"global\",\"reason\":\"rateLimitExceeded\"}],\"status\":\"RESOURCE_EXHAUSTED\"}}", "data":{ "error":{ "code":429, "message":"Quota exceeded for quota metric 'Queries' and limit 'Queries per day' of service 'webfonts.googleapis.com' for consumer 'project_number:524817652413'.", "errors":[ { "message":"Quota exceeded for quota metric 'Queries' and limit 'Queries per day' of service 'webfonts.googleapis.com' for consumer 'project_number:524817652413'.", "domain":"global", "reason":"rateLimitExceeded" } ], "status":"RESOURCE_EXHAUSTED" } }, "metadata":{ "request":{ "url":"https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyA0...", "method":"GET", "body":null, "headers":{ "User-Agent":"Retool/2.0 (+https://docs.tryretool.com/docs/apis)", "X-Retool-Forwarded-For":"194.209.182.135" } }, "headers":{ "vary":[ "Origin, X-Origin, Referer" ], "content-type":[ "application/json; charset=UTF-8" ], "date":[ "Wed, 27 Oct 2021 14:22:25 GMT" ], "server":[ "ESF" ], "content-length":[ "520" ], "x-xss-protection":[ "0" ], "x-frame-options":[ "SAMEORIGIN" ], "x-content-type-options":[ "nosniff" ], "alt-svc":[ "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000" ] }, "status":429, "statusText":"Too Many Requests" } }
I'll echo what the other comments are saying - it'll be good to make it a blind tournament with some representative code samples from languages like C#, Python, TypeScript etc. At the end you could present the 'top 5' fonts that were chosen by the user (or all of them, ranked)
I'm not a fan of ligatures so I'd want to eliminate them entirely or see such things in the code sample shown so that I can choose/disallow it.
Because it's for IDEs, make good use of the screen real estate, maybe that 'about' section on the left could go on the bottom, giving the side-by-side comparison more space to view all the code.
The 'Visit Site' link could be a normal hyperlink, my browser is blocking the popup that it creates currently. All that needs to be is an <a> with a target="_blank".
Finally for mobiles I think hide that 'product hunt' badge, it's getting in the way of the buttons.
But I'd also like to skip certain battles and save them for later. Like right now I'm down to 10 fonts and I just can't decide. I'd like to skip to the next battle.
A feedback: The use case is less than ideal. Its CSS. That shouldn't be a problem but its (i) its not the kind of syntax I'm used to reading, and (ii) its not a ligature heavy use case.
As an instance, I'm given a choice between Fira Code and Fira Mono. First off, er... maybe don't put them together. Second, the only difference between the two, as far as I can remember is that one has ligatures enabled, one doesn't. And the CSS codebase I'm reading doesn't seem to have any ligatures, so :shrug:
That said, there's so much variety in fonts that someone's favorite is likely missing regardless of the selection. Perhaps an initial culling based on features would help, eg. ligatures/no ligatures, serif/sans-serif, etc.
I'm also not really able to firmly decide, so I tend to switch fonts every so often.
Many "good" fonts are no longer hinted to fit to the raster grid, it is just assumed that you are using AA, period. What happens in that circumstance, is that the unhinted font looks really misshapen. Because of this in Firefox I de-select "Allow pages to choose their own fonts, instead of your selections above" and use instead a font that was designed to work well without AA (for the web, I like using Verdana).
So, for an editor's font, the best ones are bitmapped raster fonts for that pixel-perfect sharpness.
You can also use a TTF/OTF font with embedded bitmaps at specific sizes.
Regular TTF will work well also, if it is old enough that it contains hinting instructions. E.g. Bitstream Vera Sans is a monospaced font that is properly hinted for a pixel grid.
I was crazy enough to handwrite all of the TTF hinting instructions for it (albeit with a macro assembler-like tool). Every glyph in the regular and bold variants is superhinted to look pixel perfect without AA when viewed in the 9px to 19px range, and decent beyond that. With AA on, all four variants are hinted for the pixel grid at 9px and up. I also came up with some magic to try to force Cleartype to still grid-fit it horizontally.
Also missing one of my go-tos "Input Mono"[0]. What's great about it is that it comes with so many custom choices that you can configure specific character shapes and choose a width/weight that renders well for your particular use case.
EDIT: I've been with Inconsolata for a few years, but maybe a new contender can appear :)
This. The 'lorem ipsum' CSS provided wasn't too bad, but that's not my brace style and I found it jarring, waah D:
> About B612 Mono
B612 is an highly legible open source font family, designed and tested to be used on aircraft cockpit screens. Its design makes it particularly suitable for degraded contexts (ensuring legibility and readability of data), with a positive effect on reducing visual fatigue and cognitive load. Particular attention was given to the uniformity of the typeface, whether being used for isolated terms, reading information on a map, mixing capital letters and numbers, waypoint lists, long or abbreviated texts...
> In 2010, Airbus initiated a research collaboration with ENAC and Université de Toulouse III on a prospective study to define and validate an “Aeronautical Font”: the challenge was to improve the display of textual data information on all cockpit screens, concerning more specifically legibility, readability and reading comfort...
https://fonts.google.com/specimen/B612+Mono#about
To me it looks like the designers achieved their goals. Best to play this game after eight or ten hours' coding.
Edit: Win 10, Chrome 95 maximized on 1600x900
Edit 2: Surprisingly, the font that won when I ran it on Chrome was #2 when I tried it again on Firefox (I tried not to look at the names as much as possible to avoid this).
A possibly better method (but harder to implement) would be to show code snippets briefly, then ask a related question. This would test how well you can actually read the various fonts - as long as the samples and questions control for other things.
- Allow editing and preserve the user's content or at least the ability to select a language. CSS doesn't display a lot of the nuances present in other languages, and some people simply use monospaced for other kinds of writing. Though I appreciate this may add a requirement for a syntax formatting library.
- Add Iosevka and Cascadia Code fonts, among probably many others that will be suggested here. Better yet, add the ability for a user to set a custom font source URL and change it to a blind test!
- Themes, pretty self explanatory.
And, maybe I missed it, but there's no light mode or ability to change weights. Some weights are highly legible in light mode, but then illegible in dark mode—and vice versa.
Somethings I would like to have:
- The "editor" windows should be bigger
- Remove the left side
- Let me choose the language
- Give an option for a blind test. Basically don't let me see the font name.
- Option to give me only fonts with Ligatures.
-- make the individual fonts compete more times in randomized comparisons (one font should not win over a single other)
-- option to overlap the renderings in a canvas with bitmap difference (to highlight the differences in glyphs)
-- option to choose the text to be rendered, with syntax highlighting
-- upload fonts for further comparison (maybe through @font-face src URLs); edit the list of comparisons
'(67 vs 89) vs (12 vs 45)' will filter out early good option '67'. Irrelevant if you goal is '89'; relevant if your goal is '(89, 67)'.
There should an option to hide names of what font it is.
fwiw i've tried so many fonts and nothing beats andale mono for me on macos. i always come back to it. fantasque sans mono on windows is nice too, i think its on google fonts.
Played through the game (on MacOS), came here to ask if we could add a custom font into the game so I could put Andale Mono there.
Fantasque Sans Mono on Github sends to:
https://fontlibrary.org/en/font/fantasque-sans-mono
Andale Mono is bundled with MacOS, and for Windows is here:
https://sourceforge.net/projects/mscorefonts/files/MS%20Core...
And for Linux, here:
The font that seems to not make me want to try others is Recursive Mono (medium, casual). https://www.recursive.design/ Even I admit it looks a bit off at larger sizes but at say 15pt it's fantastic.
- Liberation Mono
- DejaVu Sans Mono
- SF Mono
That said, I ended up picking Cousine, which is a font I had never heard of before.
(Edit: Cousine seems to be identical to Liberation Mono.)
I picked Cousine as well.
It is my font of choice and I am curious if it would win for me (while trying not to look in the names).
It had some popularity with HN in the past: https://news.ycombinator.com/item?id=14009963
Would love to hear your thoughts or anyone else's.
(Fun aside: I ended up implementing the Ford Johnson algorithm to minimize the number of comparisons, explanation here: https://github.com/decidedlyso/merge-insertion-sort )
For me, it is not sufficient that I can distinguish between the members of problematic sets side-by-side: whenever you see one on its own, there should be no doubt which one it is.
I've made my own pixel font, inspired from ProFont, but it's not usable because it's a pixel font, and it's too big when I zoom it 2x.
For example, the font Input[1] might not be the most aesthetically pleasing, but it is one of the very few non-monospace developer fonts. The website of this font explains the idea behind it in a way that convinced me.
Maybe it could be done by using a wizard/tutorial to narrow down the fonts list.
Also, for really maximizing utility, it'd be cool to add variations of the same font but with different line-heights. I definitely voted against some fonts because they appeared "squished", but maybe a bit bigger line-height would make me prefer it.
(my wife was very happy when I taught her this trick, though at first she was scared she might permanently damage the website; I mean, that it would remove the block also for the other visitors)
Besides that, it would be great if you could hide the names as well, or set some placeholder name. I feel like I might be biased towards my existing font, because after the tournament I ended up with what I use as a daily driver, but maybe there is some unconscious bias that I don't realize, that's why it won.
I suggest everyone just switch to Iosevka, you can thank me later.
From the 'About' page: B612 is an highly legible open source font family, designed and tested to be used on aircraft cockpit screens. ... In 2010, Airbus initiated a research ...
[1]: https://fonts.google.com/specimen/B612+Mono#standard-styles
More fonts besides Google Fonts would be nice.
If I bust the embedded content out of the iframe it works a little better though.
It would be nice if there were different set of fonts so that writers could also use it.
Also this concept of tournament can not only be generalised to other types of fonts, it can be generalised to different things entirely as well. Really like the idea!
I've tried editing the font myself using fontforge, but without any luck...
Thanks again, kind stranger!
I also like coding with proportional fonts. I wish I could find some with coding ligatures.
[I've wondered if VSCode theming would allow for using a regular font for alphanumeric characters, and a special font (like Fira Code) for punctuation characters, so they can be displayed with all their ligatury glory.]
1. I enjoyed looking at
2. Made discerning ambiguous characters when reading code easy. For example: l, 1, 0, O, Z, 2
I ended up creating my own custom build of Iosevka, now I can humble brag and have hipster cred that I have a font that is unique in the world (lol).
By far my favorite coding font, even though Share Tech Mono is looking good too after trying your game/app. Nice work!
Would be nice to allow user to paste in arbitrary code text, to reflect more typical code they're used to seeing (and get it to display ligatures, if applicable). Or possibly allow user to specify a source file from GitHub/GitLab to display.
Is this open source?
Unsurprising, given that as far as anti-aliased fonts go, I long settled on Microsoft's Consolas.
But the game should include some bitmapped fonts like Terminus, which is what I'm using now.
It's so sharp at 2K, and looks befitting of a computer.
I've created this small comparison web page for myself and my team.
Caught a bug, FYI: The font-family line always says the name of the font on the right in both columns. I.e. the left column says the name of the right column.
I'd like to have easier time with parsing snakeCaseFunctionNames()
I would also like to suggest that the side-by-side panes scroll together too, so that the comparison is easier to track.
I also just use the default Vim colourscheme, which also seems a rarity.
I wonder why?
Chrome blocking site as "unsafe" due to certificate error. Over-riding that and OpenDNS blocks it as malware.
Creators may want to investigate.
But really cool idea :)
Inconsolata, for example, is much smaller than DM Mono, but they're both displayed at 16px.
Perhaps consider showing some kind of progress or something...?
(Safari, iPhone)
As is, I ended up with my current reference font. No surprise.
Even though I haven't used linux for coding for roughly a decade
That was actually nicely done. I'll play it more seriously later.
{ "statusCode":400, "error":"Bad Request", "message":"{\"error\":{\"code\":429,\"message\":\"Quota exceeded for quota metric 'Queries' and limit 'Queries per day' of service 'webfonts.googleapis.com' for consumer 'project_number:524817652413'.\",\"errors\":[{\"message\":\"Quota exceeded for quota metric 'Queries' and limit 'Queries per day' of service 'webfonts.googleapis.com' for consumer 'project_number:524817652413'.\",\"domain\":\"global\",\"reason\":\"rateLimitExceeded\"}],\"status\":\"RESOURCE_EXHAUSTED\"}}", "data":{ "error":{ "code":429, "message":"Quota exceeded for quota metric 'Queries' and limit 'Queries per day' of service 'webfonts.googleapis.com' for consumer 'project_number:524817652413'.", "errors":[ { "message":"Quota exceeded for quota metric 'Queries' and limit 'Queries per day' of service 'webfonts.googleapis.com' for consumer 'project_number:524817652413'.", "domain":"global", "reason":"rateLimitExceeded" } ], "status":"RESOURCE_EXHAUSTED" } }, "metadata":{ "request":{ "url":"https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyA0...", "method":"GET", "body":null, "headers":{ "User-Agent":"Retool/2.0 (+https://docs.tryretool.com/docs/apis)", "X-Retool-Forwarded-For":"194.209.182.135" } }, "headers":{ "vary":[ "Origin, X-Origin, Referer" ], "content-type":[ "application/json; charset=UTF-8" ], "date":[ "Wed, 27 Oct 2021 14:22:25 GMT" ], "server":[ "ESF" ], "content-length":[ "520" ], "x-xss-protection":[ "0" ], "x-frame-options":[ "SAMEORIGIN" ], "x-content-type-options":[ "nosniff" ], "alt-svc":[ "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000" ] }, "status":429, "statusText":"Too Many Requests" } }