Feb 2023

  • Updated QuickPrint a few times (1.0.3 -> 1.0.6). The most significant changes are:
    • Vertical alignment modes. Eases switching fonts on the same line (for example, by placing them relative to their baseline metrics).
    • Auxiliary Data tables for each font. Allows setting scale values and changing vertical metrics on a per-font basis. Can be helpful when using LÖVE ImageFonts, which do not have valid baseline / ascent / descent metrics.
  • I continued working on the formatted text stuff from January. I dropped the line-based parser for now, as the tag-based parser is so much more valuable for the interesting text layouts it can deliver. As mentioned last month, it’s similar in design and purpose to richtext.  I’m feeling confident about a release sometime in March. Features include:
    • Font groups allow for [b]Bold[/b] and [i]Italic[/i] face selection tags
    • Shapes: underline, strikethrough, background (highlight)
    • Text and associated shapes may have independent colors
    • Custom paragraph styles, allowing implementations of indented bullet list items, etc.
    • Support for tweaking the wrap-limit on a per-wrapline basis
  • I also plan to release a simple INI-like config file parser called KEVN. This started as a joke, but might actually turn out to be useful. (Or maybe not.) It should be out in March as well, if I decide to finish it.

 

Here’s a pic of the formatted text library in action.

 

Here’s the string used to generate this chunk of text:

local text = [[
Arbitrary text colors: [color red]One [color green]Two [color blue] Three

Faces: Regular, [b]Bold[/b], [i]Italic[/i], [b][i]Bold-Italic[/b][/i].

Superscript: y = x[font sup]2[/font] + 1

Subscript: Foo[font sub]bar.[/font]

Shapes: [ul]Underline[/ul], [s]Strikethrough[/s], [bg gray][color black]Background[/color][/bg]

Horizontal separator:

[para aux_hori_sep]

List Items:
[*]Bang
[**]Bam

Alignment: (left, right, center, justify)
[align left]The five boxing wizards jump quickly.

[align center]The five boxing wizards jump quickly.

[align right]The five boxing wizards jump quickly.

[align justify]We need an extra long bunch of text for justify to actually show up okay there we go]]

 

Now, there is a significant amount of boring setup code necessary to make this work as I present it here. The library user has to load fonts, set up font groups, define color tables, make paragraph styles and word styles, and so on. My current plan is to make a core library with just the basics, and also distribute a template with everything ready to go. Time will tell if that’s practical or not.