Lewis-Clayton/dcled_ruby — pull request #7 by tiredpixel (2013-10-17 22:24:45+00:00)
Title: Fonts

This pull request introduces a `Font` class and definitions files for creating, assembling, and utilising a font in both screen and dcled output formats. The process is designed to make it easier to create fonts by copying a provided font template file `fonts/ascii.yml.example` and constructing the font visually using `*` and `.` characters. This also allows multiple fonts to be supported, simply by instantiating from a different font file.

The approach also allows for fonts to be designed and contributed to independently of underlying code or other fonts work. It is hoped that this will greatly encourage pixelings to complete or create fonts, as all that is required is to copy `fonts/ascii.yml.example` to a new file in that directory, and work through the file editing the supplied base characters. Completion of any such file should provide coverage for the full basic ASCII set (code points `32` to `126` inclusive).

The existing code in `dcled_ruby.rb` is not changed by this pull request; however, it could be updated to use the `Font` class and definitions files as detailed in the commit messages. The existing work on defining a default font in `dcled_ruby.rb` has been extracted and ported to a font definition file `fonts/default.yml`. It should be noted that any character outside of the ASCII range specified will not have been ported. (If desired, however, a font definition file could be extended beyond basic ASCII.)

This code is offered under the MIT License pending https://github.com/Lewis-Clayton/dcled_ruby/issues/6; if a different license is selected for the project, I'm willing to consider such.

Peace, tiredpixel