Several examples (FontAwesomeExample, FontBravuraExample) need to display unicode characters and there is a class in those examples that should be extracted.
Solution
Extract the UnicodeFontViewer from the example programs and replace the example program usage with the new viewer.
Notes
Here's the UnicodeFontViewer in action:
A few tweaks were added to the initial class that was extracted, but a few more would be worth adding eventually:
The class should probably be moved into Elements (or the new conceptual Rudiments)
Should use al_get_font_ranges to get information so that user will know where reasonable ranges are in the font. That way they aren't paging through the ~16 million possible pages (with uint32_t having 4,294,967,295 possible character glyphs and 256 glyphs per page).
Might add some page numbers or pagination numbering feature (goto_page(num), for example)
Might add a larger "detail view" with a larger rendering of the glyph, along with the bounding box data and line-height, ascent, etc data drawn as red and/or blue lines.
Should add "centered" or "fill" rendering options for glyphs, for example...
Here's an example where the Bravura font characters draw on top of the numbers:
...this particular typeface uses glyph in a way that is different from typical word typography (it's anchor points are used to position glyphs on a music staff).
In situations like this, the user might prefer to view the glyphs such that they can see the full glyph. Adding a toggleable option to view the glyphs positioned differently in the grid might be nice. One of the toggleable options might have the glyph completely centered - could use al_get_ustr_dimensions() and get the data needed to render the glyph centered in its grid cell.
Problem
Several examples (
FontAwesomeExample
,FontBravuraExample
) need to display unicode characters and there is a class in those examples that should be extracted.Solution
Extract the
UnicodeFontViewer
from the example programs and replace the example program usage with the new viewer.Notes
Here's the
UnicodeFontViewer
in action:A few tweaks were added to the initial class that was extracted, but a few more would be worth adding eventually:
Elements
(or the new conceptualRudiments
)al_get_font_ranges
to get information so that user will know where reasonable ranges are in the font. That way they aren't paging through the ~16 million possible pages (withuint32_t
having 4,294,967,295 possible character glyphs and 256 glyphs per page).goto_page(num)
, for example)Here's an example where the Bravura font characters draw on top of the numbers:
...this particular typeface uses glyph in a way that is different from typical word typography (it's anchor points are used to position glyphs on a music staff).
In situations like this, the user might prefer to view the glyphs such that they can see the full glyph. Adding a toggleable option to view the glyphs positioned differently in the grid might be nice. One of the toggleable options might have the glyph completely centered - could use
al_get_ustr_dimensions()
and get the data needed to render the glyph centered in its grid cell.