Add a default encoding for newly created fonts.
Fix an issue with validation of font files.

OS X had a problem with the `hhea` table. This was because the
caretSlopeRise was set to 0. For normal fonts, this should be set to 1
(a vertical caret).
Font writer automatically generates metrics.
Fix style issues.
Fix style issues in write test file.