Wednesday, December 3, 2014

Highway Fonts

I'm posting more about fonts then I am about programming, it seems.

So, let's say you're making a racing game. You'll probably need a font to accurately represent the signage if you're to have races take place on any highway.

The traditional font recommended by the United States Federal Highway Administration is known as Highway Gothic. Some free "close enough for government work" fonts that approximate it is listed at the bottom of the Wikipedia article, but most are free for personal or hobby use, which isn't good enough licensing for open source games.

However, one font that IS friendly is Red Hat's Overpass font, found in Fontspace's Highway category. It is SIL Open Font License, so you could even use it commercially if you want.

Incidentally, the NEW font (which isn't yet adopted everywhere in the States) is known as Clearview. I have yet to find a free version (open source friendly or not) which approximates it.

Sunday, September 7, 2014

Comic Neue Font

Comic Sans... make the mistake of using it, and find yourself attacked by designers and self-righteous techy folk. There's other reasons for not using it as well: Though Windows and Mac OS X may have it, Linux users do not (MS Core fonts must be installed).

Another big reason is that it isn't a free font, you can't include it in any of your games or apps without paying for it first.

We still need a "playful" non-serious font. For that, we have Comic Neue. It's also a royalty-free, public domain font.


Sunday, May 25, 2014

Mozilla Fira Sans Open Source Font

Fira Sans looks nice. It also comes in monospace, and even has 16 different weights.

Read about it at
http://www.donotlick.com/2014/05/23/try-out-fira-sans-a-free-open-source-typeface-commissioned-by-mozilla/

Preview and download 3.1 at http://dev.carrois.com/en/fira-3-1/#download

Find older versions at https://github.com/mozilla/Fira and https://github.com/mozilla-b2g/moztt (which also has other free fonts)

Saturday, April 19, 2014

Bitcoins, blockchains, and gaming

When the rare great idea occurs to me, on the scale of "I'm surprised nobody has thought of this!" the next thought I have is "Hey, somebody probably already thought of it and did it better. Or, if it hasn't happened yet, it will soon." So I waited it out. And here it is!

It's called ethereum. It takes the basic blockchaining concept pioneered by bitcoin (the idea of which I don't understand enough to feel comfortable elaborating on here. Again, many other people can explain it better than me) and generalizes it enough to be used for almost anything.

Why is this important? I've been interested in self-regulating open source gaming communities. That is, how can a developer release a free open source game that allows the community to find and connect with each other, without having to maintain a central server to host all the games? ... I still don't know actually, but this solves a part of that puzzle. I'm hoping that by the time I figure out that part of the equation that somebody has already solved it too.

Sunday, March 16, 2014

Beaglebone Black setup

I have been wanting to build a simple robot, to roam around the house for some time. I have focused on the brain to start with. A couple of years ago I looked into avr 8-bit microcontroller. The avr chips are easy to write code for and have a lot of features, but they are still just a microcontroller. I wanted something that could run linux and make things like adding wifi easier. Somewhere along the line the Pi came out. I looked at it and found the i/o pins it provided to be limited. After looking some more, I found the Beaglebone Black, which was like the Pi but with a lot more i/o pins.

Excited to find a $45 computer with the features I wanted, I went to order it and found it was out of stock everywhere. After looking around a lot, I found the site adafruit had a sign up for when the Beaglebone Black would be back in stock. I put in my email and 5 days later I order one. A week after that with the cheapest shipping I got my board in the mail.



The Beaglebone Black is about the size of a credit card. The thickness part is the Ethernet port.

With board in hand, I am all ready to see what I have. I hook up the usb cable that came with it and my Ubuntu 12.04 networking manager crashes. After some searches I give up and connect it to my router and power it with a phone charger. Once I find the IP on my router, I just ssh in as root with a blank password. I see it running angstrom linux and uses systemd (more on this later).

A couple of weeks later, I look more into hooking up the usb to Ubuntu and found the solution on adafruit. I just needed to add some udev rules. After adding the udev rules with the script on adafruit, just plugging in the usb boots up the board and adds a eth2 to Ubuntu. Now I can just ssh it the board as
ssh root@192.168.7.2

 At this point, the Beaglebone Black will not be able to access the network without some iptable changes. At this point that is not important to me, I just want to configure the board and I plan to add a wifi usb dongle in the near furture.

Overall, I have been very happy with the Beaglebone Black. I know the Pi has a much larger community, but given the Beaglebone Black is always out of stock I think its community is growing.

Saturday, March 15, 2014

More free fonts!

For some reason, I think that fonts are very important to get right, especially for video game development. The best example I can think of is Team Fortress 2. The game's art design and music effectively sets the mood of the game as a cold-war era future-ish spy movie... thing. And the font used in the game lends to that mood as well. Imagine if they used Arial: it would feel out of place and not contribute to the playful, kooky atmosphere.

So, here I am again, eating up free font lists like this one: http://www.awwwards.com/the-100-greatest-free-fonts-for-2014.html


Linus and XML

Reading this post from Linus Torvalds, I never thought of the git subsystem as a replacement for a file format.

tl;dr:

Linus' project, Subsurface, a SCUBA diving logger, originally used XML. Linus hates XML, and has been looking to replace it. He ended up using the git object database format. With it, he gets efficient deduplication and compression, as well as backups and history.


You might say "But the git object database format isn't a file format, its a bunch of files tied together which makes up the format. Its a database format." And you'd be correct.

The discussion has Linus revealing "As to JSON, it's certainly a better format than XML both for humans and computers, but it ends up sharing a lot of the same issues in the end: putting everything in one file is just not a good idea. There's a reason people end up using simple databases for a lot of things."

There's been several projects that have used git and/or its technologies before. I can think of backup systems, FUSE filesystems for a substitute for ZFS or btrfs. In the comments of Linus' post, one of the devs of Pitivi mentioned they had toyed with using it for that project.

Reading up on git objects and libgit2, it seems that the git subsystem could be a good replacement for text file formats in certain scenarios, provided you're okay with having a good text database, instead of wrapping everything into a single file. It's dependent on the situation. It sure beats the "Just use XML for everything, everywhere" mentality.

Sunday, February 23, 2014

Password Storage Done Right

https://crackstation.net/hashing-security.htm is a great resource on securely storing a user's password. My understanding is this:
  • Use one salt per user, not one salt for all users.
  • The salt should be generated using a secure random method, and its length should be the length of the hashing method.
  • Append or prepend the salt to the password.
  • Hash this value. Use SHA256, SHA512, RipeMD, or WHIRLPOOL. (Call this "Result A")
  • Next, use key-stretching on Result A with PBKDF2 or bcrypt. (Call this "Result B")
  • Finally, add a secret key to Result B, either by:
    • Encrypt the hash with AES
    • Include the key with the result using HMAC
  • The secret key can better be kept secret if it:
    • Isn't hard-coded into the app source
    • Isn't included on the same DB as the passwords
    • Even the above won't protect you in the event that an attacker gets full control of the system. Use an external system specifically for password validation, or use a special hardware device like  YubiHSM.
These are just my distilled notes of the article, it is actually much larger and covers more topics.