Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Font not suitable to distinguish l and 1

 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Small l and 1 look almost identical in code-blocks. Is this a javaranch-issue or a firefox-linux? There should be a more coderfriendly font, because I used 'l' in my example, and it looked like 1 all over the place. Of course, in longer identifiers like 'long' it's easy distinguishable.

Example:

can you read that? Yes, if I increase the font, I see a small difference at the top.
My shell uses a font, where small L ist printed like that:

The font-dialog says, the name is 'monospace' which sounds very generic.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're right, the glyphs look the same in the font used in Firefox on this MacBook. But the "ones" are red, and the "ells" are black, so it's not all that hard for me to tell the difference.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can go into your browser settings and change the default font for monospace.

Eric
 
paul wheaton
Trailboss
Pie
Posts: 21473
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A famous obfuscator trick:



The second one has twice as many "els" as the first.

 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eric Pascarello wrote:You can go into your browser settings and change the default font for monospace.


Does not work (Javaranch looks the same as before) for me, and might reduce the redabiltity of everything else. Did you try it?
A famous obfuscator trick:


famous!
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found
* 12lLiI| Andale_Mono
* 12lLiI| DejaVuSansMono
* 12lLiI| FreeMono
* 12lLiI| LiberationMono-Regular
* 12lLiI| TlwgMono

as to be seen here: http://home.arcor.de/hirnstrom/images/mono-fonts.html (if you happen to have those fonts too ) on my system, and specified Andale Mono for monospaced-fonts in the settings - without much success. Other Webpages now look different - not a nice font, imho, but the l/1 is done right. The others look nearly the same, and seem to differ in size and bold/not bold, while defined the same way (size=14).
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, added an image, so it makes sense.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic