source-foundry / Hack

A typeface designed for source code
http://sourcefoundry.org/hack/
Other
16.4k stars 615 forks source link

Slashed zeroes and other alternate glyphs #200

Closed Ulyssys closed 6 years ago

Ulyssys commented 8 years ago

Personally, I find slashed zeroes easier to read and more aesthetically pleasing than dotted ones. I'm not sure if that's the case in general, but I would like to see a version of this with slashed zeroes.

chrissimpkins commented 8 years ago

Thanks for the suggestion. The oval fill in the zero is part of the Hack identity and is unlikely to change in the main font sets. A derivative typeface with different glyph shapes is a possibility down the road. The other approach that we have considered is a way to 'swap' glyphs in the fonts for alternates (both project provided and user contributed) since many/most development text editors do not support OpenType stylistic alternates within a set.

Let's use this thread as an opportunity for anyone with an interest to weigh in on alternate glyphs that would be desirable/appropriate in the sets. This could be very interesting and provide impetus for something that has been an interest of mine for some time.

Ulyssys commented 8 years ago

Sounds good. Should I edit the original issue to repurpose, or...?

chrissimpkins commented 8 years ago

No it's OK. leave as is and let's see if anyone chimes in. I will look into the issue a bit and be in touch.

chrissimpkins commented 8 years ago

Looking into the available tools.

iandoug commented 8 years ago

An off-the-wall suggestion: instead of tinkering with a zero to make it look less like an O, why not use something noticeably different? Or is that too radical? :-)

chrissimpkins commented 8 years ago

@iandoug What do you have in mind?

iandoug commented 8 years ago

@chrissimpkins Every font designer (or hacker) making a font for programming use sits with the problem of how to make the zero different from the O. Same with I and l :-) (and why the heck is github using a font that confuses?...). In fact when I check fonts I type oilOIL01 to see how it comes out.

In reality we're trying to deal with historical bad design ideas. In my early days, I used to wonder why they were using Swedish letter Os in the numbers (slash 0)....

The correct approach would be to go back to the drawing board (at an international level, if necessary) and pick a different shape for the zero (the letter O is much older and in print more). I've tried playing around by hacking fonts to have different shapes...

eg

  1. something more egg-shaped, with a wider base and narrower top
  2. a diamond shape like http://www.fileformat.info/info/unicode/char/2662/index.htm
  3. something that looks like the AIDS ribbon https://www.worldaidsday.org/the-red-ribbon , either this way up or the other way up (I can't remember the name now, there is a glyph or two that are suitable (better than http://www.fileformat.info/info/unicode/char/213d/index.htm )
  4. We could even underline it like what they did with the 1.

The problem (apart from a lack of artistic ability on my part) is that our heads are hard-wired to recognise a zero shape, and throwing a new shape into the mix requires some adjustment.

But I'm just throwing the idea at the internet, and maybe our collective intelligence will come up with a better solution.

iandoug commented 8 years ago

FWIW, I think a diamond as above with a dotted (or oval) centre is a possibility. Or perhaps a triangle with rounded corners http://www.fileformat.info/info/unicode/char/1f6c6/index.htm which is only supported by Symbola at the moment (but will be a pain to 'write' manually). Diamond is easier. The small gamma tends to look like a Y or 8, depending on how the font renders it.

http://www.fileformat.info/info/unicode/char/1f79a/index.htm but wrong shape diamond (should be taller like +2662, not square)

glebd commented 8 years ago

TBH, the filled-in zero in Hack creeps me out. I must be suffering from Trypophobia! fear-of-holes-phobia-trypophobia

I quite like the approach available in the Input font alternates, where zeroes have a more square shape: screen shot 2016-06-10 at 23 27 08

chrissimpkins commented 8 years ago

@iandoug :

The problem (apart from a lack of artistic ability on my part) is that our heads are hard-wired to recognise a zero shape, and throwing a new shape into the mix requires some adjustment.

This is definitely the issue. There is a visual expectation for glyph shapes and extreme deviation in the name of differentiation from others glyphs may solve the initial problem but creates a new one.

chrissimpkins commented 8 years ago

@glebd:

the filled-in zero in Hack creeps me out

It's not for everyone. Some have called it the "Eye of Sauron".

¯\_(ツ)_/¯
iandoug commented 8 years ago

"1. something more egg-shaped, with a wider base and narrower top" .... which brings to mind the French (borrowing from Wikipedia here, referring to "Love" score in tennis):

"It is possible that it derives from the French expression for "the egg" (l'œuf) because an egg looks like the number zero."

The 'rounded rectangle' from Input is interesting, my only concern is how humans will be able to draw it accurately without reverting back to normal oval. I assume Apple does not have a patent on "rounded rectangles".

jwheare commented 8 years ago

Hi, we just switched to Hack on IRCCloud.com as our monospace font thanks to the extended character set available in the web font (good for consistent ASCII art) and the overall quality of the typeface. Many people love it, but the zero is a bit of a point of contention (as well as the curled lowercase i, but staying on topic).

I understand it's part of your identity, but an optional slashed alternate would be fantastic.

tri-nga commented 7 years ago

Hello Since I found this font, I'm using Hack everywhere, It's even default on Neon (Linux). Great. However, I'd like the oval fill to be a bit smaller. I'd like a slashed zero too if you'll provide that in future. ps: I like Monoid numbers, Roboto Mono too. That said, this font is great, I do often look at http://programmingfonts.org for new fonts but, I'm very very happy with Hack. Thank you

Yevgnen commented 7 years ago

Hack's cool and awesome except the zeros ...

screen shot 2017-06-26 at 10 14 07 am
chrissimpkins commented 7 years ago

Fork anyone? Seems to be a popular request.

chrissimpkins commented 7 years ago

@Yevgnen I would wallpaper my home with that design ;) I understand, it's not for everyone.

chrissimpkins commented 7 years ago

Fork anyone? Seems to be a popular request.

If there is not interest out there for a new fork, we can consider a branch to support alternates. Let's see if someone wants to take the initiative to run with it.

iandoug commented 7 years ago

Okay following your request/suggestion I went surfabout. There's a paper here: https://tug.org/TUGboat/tb34-2/tb107bigelow-zero.pdf by Charles Bigelow (one of the designers of the Lucida family, and as such knows what he is talking about much more than me.. :-) ) that discusses the issues and makes for interesting reading.

So I started building the Comprehensive Catalogue of Confusing Characters, aimed at programmers, and focusing on "use these fonts for programming" as well as whatever other fixed-pitch fonts I could find. Result is attached (hopefully). LibreOffice for some reason would not use String Literal font (so it's missing below), and three others were hidden but still worked. Most fonts are freely available, I tried to avoid commercial ones, as well as bitmap rather than ttf/otf.

Along the way came across this site which attempted much the same: https://s9w.github.io/font_compare/

As regards forking, if I had to modify a fork I would probably borrow a slashed zero from one of the free fonts, and then attempt to synchronise the weight with the rest of Hack, than trying to draw one from scratch.

Alternatively you could do like Input Mono does, and offer a selection of alt glyphs that get compiled into the font?....

Anyway here's the list, for purposes of comparison as to what we can do with the zero or the capital O. According to Bigelow's paper, back in the day the programmers wanted to change the O rather than the zero, now we seem to want the reverse. Curious. :-)

If too big then we can remove it and put in a link instead.

Cheers, Ian compare-fonts

Click image twice for BIG view.

chrissimpkins commented 7 years ago

Wow, this is a fantastic analysis @iandoug ! Would you be willing to allow us to add this image to one of our analysis repos in the Source Foundry organization account (or create a new repository) and contributing to the discussion there? I suspect that @burodepeper would be interested in this as we discuss plans for the v3.x releases of the fonts. It's interesting to see all of the approaches that designers have taken to distinguish similar shapes across the various typefaces that you included. I am certain that there will be information included that we can debate and build on in Hack.

As regards forking, if I had to modify a fork I would probably borrow a slashed zero from one of the free fonts, and then attempt to synchronise the weight with the rest of Hack, than trying to draw one from scratch.

We are attempting to make it much simpler to do so. See my comment here https://github.com/chrissimpkins/Hack/issues/35#issuecomment-312663173

The goal for v3.x is to make it as simple as possible for individuals to contribute to Hack and use Hack as an upstream for personal modifications / release to others. Planning and research is underway, work will begin in short order so that you can do this.

iandoug commented 7 years ago

Let me create the new revised version which has a few more (and removed some problematic ones), eventually got all the fonts to display with Calligra (LibreOffice refuses to list some, while AbiWord lists them but the saved file does open with correct fonts in LibreOffice). Exported to PDF from Calligra, will use Gimp to create image from PDF.

iandoug commented 7 years ago

Another off-the-wall idea: the paper I referenced above talks about how a proposal in yesteryear for solving the problem involved a swish through the top of the Cap O. Which tied in with an idea I've been toying with for the letter Q ... the tail is a problem, since it's basically the only Cap that has a descender (apart from some versions of J). The classic Helvetica-style Q with a short dash avoids the descender but you still have this "bit sticking out". So I was thinking about a short horizontal bar INSIDE the Q, near the bottom. That's much tidier, if a bit unconventional (though I have seen similar approaches with a more swashy implementation of the idea).

Then we do the opposite with the letter O ... a short horizontal bar near the top, as mirror-image of the Q.

The paper referenced above also has a nice illustration by Zapf, of a zero that hints at egg-shaped with slightly pointy top like I suggested previously.

chrissimpkins commented 7 years ago

Sounds great. We began to compile a source code corpora across a variety of programming languages. Intent was to examine common idioms/code structure in commonly used programming languages. Perhaps we can use these are source examples with different fonts to examine this issue.

https://github.com/source-foundry/code-corpora

I believe that David (@burodepeper) has at least one repository for analysis / discussion of design issues in the fonts. If not, we can create a new one to use for this. It will be interesting to get feedback on these issues and discuss them in more detail. There are a great deal of interesting issues involved spanning design to the neurocognitive processing of written language. I've come across some literature on the latter in text intended for print. Range of things such as legibility optimization, eye strain/"fatigue", and the like. Over on the Codeface repository we've had contributors suggest that we include characters in our source specimen that are commonly confused in individuals who have dyslexia which is something that I haven't considered in the past. There could be a host of similar issues that could be addressed for individuals who are attempting to code with such a disability, perhaps open up coding as a possibility for them if this is truly disabling.

I am not aware of any such knowledge in source code text and there are associated but different problems involved given that it does not look like any standard written text. Something that would be fascinating to explore in more detail.

chrissimpkins commented 7 years ago

RE: https://github.com/chrissimpkins/Hack/issues/200#issuecomment-312685628

Keep the ideas coming! Let's come up with a structure for discussion and once we have that we will create new issue reports where they can be discussed.

iandoug commented 7 years ago

Revised version of confusing character comparison. Added a few and removed one or two. Also tweaked the characters compared. Click image for big view (then probably click again for full screen, depending on your browser). compare-fonts

chrissimpkins commented 7 years ago

👍 👍 👍

chrissimpkins commented 7 years ago

How are you rendering that? Could use your help in visual rendering testing.

burodepeper commented 7 years ago

I liked how the 8 and 0 were adjacent in the previous version. I had never considered them to be so easily confusable in some typefaces. Anyway, will add some of this info to my analysis docs, if I don't forget.

iandoug commented 7 years ago

Current workflow is create/edit in Calligra, enlarge view to around 1600px across, then do a series of screengrabs which get passed to Gimp and then cut-copy-paste into new image. Bit tedious (11 grabs get combined into 1 long image). Exporting PDF didn't work so well because page size is A4. And somewhere between PDF and Gimp the top few pixels of some rows got cut off. Tried pulling the pages as images with ghostscript but same issues due to pagesize being A4.

Yeah, I was in 3 minds about the order of the first 4 characters. Ideally I need to compare O0 08 8B 8& OQ and but my right hand side was getting too long... already had to reduce some rows from 12pt to 10pt. Maybe must reduce all to 10pt then do the combos listed above.

chrissimpkins commented 7 years ago

You aware of any approach that might be platform independent for execution but would take into account platform specific rendering? Would want to be able to see appearance on current / commonly used versions of OS X/Windows/common Linux distro(s)

iandoug commented 7 years ago

Only thing I can think of is a PDF or ODT with embedded fonts but there might be some licence issues with that approach, unfortunately. Which is why I post images rather than PDFs. Am tweaking the comparison again to do the DO08B Q letters again. Also adding j to il. Will only be done tomorrow. Getting late here now :)

chrissimpkins commented 7 years ago

No worries. Thanks!

iandoug commented 7 years ago

I had actually forgotten about the whole different-OS-show-fonts-differently problem ... been on Linux for so long, and they've sorted the font display issues rather well (as opposed to the old days where they had to duplicate MS bugs in TrueType to get things to display properly). But even "Linux" I think is going to have some differences between machines, depending on which software is being used. I see the PDF that I generate from Calligra has "embedded subsets" of the fonts .... that may be alright to share I guess. Don't want to get anyone into trouble. Let me fix the doc first.

Ulyssys commented 7 years ago

I imagine that fonts, like most other things, can be displayed for sample/comparison purposes under "fair use" laws. A PDF document comparing each should be just fine.

chrissimpkins commented 7 years ago

The platform / renderer / editor combinations have been a headache. Nothing is standardized across platforms so you need to do platform specific editing. Reams of open and closed issue reports for these issues that aren't readily apparent on one's development platform. We have a workaround for Java renderers which are in some editors (JetBrains uses it and has had some very difficult to troubleshoot issues). It would be ideal to create platform specific testing tools that simulate what users will see with platform defaults. This would be broadly useful for font development outside of the Hack project.

iandoug commented 7 years ago

PDF attached. Some rows have some 'funnies', don't know if this is Calligra's PDF export or issues with fonts (or how the subsets got embedded). Anyway PDF lets you zoom in nicely.

compare-fonts.pdf

burodepeper commented 7 years ago

@chrissimpkins Could you do that in a way similar to browserstack.com? Basically visual CI testing. Load up a VM, install typeface, install software, take screenshots.

chrissimpkins commented 7 years ago

@burodepeper don't know of any cross platform rendering tool that would use the native OS font renderer and permit automated capture of the render. there are Linux / Unix tools like the ones we used on Codeface for the specimen shots. Probably ones that do something similar on Windows but don't know what they are.

chrissimpkins commented 7 years ago

browsers will use web fonts which are an extension of the build chain so not sure this would be adequate for the desktop fonts...

burodepeper commented 7 years ago

@chrissimpkins But if you have a VM running, couldn't you just take a screenshot of the actual virtual desktop/window? As in, use the OS screenshot feature. That way, you can make a screenshot of anything.

chrissimpkins commented 7 years ago

good question, don't know the answer. guessing yes that it is possible. don't have a windows vm

burodepeper commented 7 years ago

@chrissimpkins These Windows VMs, intended for testing stuff in horrible browsers, might be worth giving a try.

chrissimpkins commented 7 years ago

@iandoug Ian, I set up the https://github.com/source-foundry/legible repository for this and future discussions about legibility issues in source code text (including Hack specific issues). Hopefully this will prompt some new ideas for future implementation in Hack and serve as a resource for other design/dev teams out there who are considering similar problems in typeface design for source code.

Feel free to PR the image (and if permitted any known resources out there including pdf's that can be shared via a public repository such as this) on that repo and we can decide how best to utilize the repository to investigate / discuss these issues.

cc: @burodepeper

iandoug commented 7 years ago

Okay will upload the PDF there. Have added a few more fonts (basically almost all the ones on your CodeFace list, plus two more on Wikipedia's list. Was reluctant to add the bitmap ones but did anyway for completeness.

Coincidently read a doc today that said the ideal font size is "about" (their word) 11.5 pt. So I switched Hack in Kate from 11pt to 11.5pt but can't say I really noticed the difference :-)

burodepeper commented 7 years ago

@iandoug

Coincidently read a doc today that said the ideal font size is "about" (their word) 11.5 pt.

That's more about the distance you're from your screen than anything else ;) The smallest size at which a font (on a screen) looks closest as to how it was intended to look is probably either 11 or 13.

chrissimpkins commented 7 years ago

Will plan to split out all open and closed legibility issues from this repo to there for more detailed conversations and to preserve the information in a more easily searchable form. My thought is that we can use IR's with glyph name (unicode code point ) vs. glyph name (unicode code point) as titles of the IR's. PR's for anything that we feel warrants addition to the "library" of reference material such as your image in this thread.

Will try to provide additional starting structure to the repository with a template for OP discussion starters sometime this week. Feel free to help sculpt how the project works via PR.

chrissimpkins commented 7 years ago

Also, ideally could develop a systematic approach to font renders as David has brought up in this thread. While it would not address platform specific issues (and this new repo is intentionally not for that), it might be ideal to develop a systematic way to evaluate font rendering for this type of discussion.

chrissimpkins commented 7 years ago

@Ulyssys Grant, sorry that we hijacked your IR! Trying to find an approach that helps us to discuss and prioritize suggestions such as yours. I still like the idea of a fork for the slashed glyph and this could come from us if no one else takes the reins first. Let us get the machine running with the changes planned for the v3.0 release and then we will discuss again.

chrissimpkins commented 7 years ago

And when I say a slashed zero, I of course mean a very sexy slashed zero glyph. 😄

chrissimpkins commented 7 years ago

The zero vs. uppercase O legibility discussion thread is now available:

https://github.com/source-foundry/legible/issues/4