Skip to content

2.5.1

Choose a tag to compare

@bolknote bolknote released this 20 Mar 08:13
· 13 commits to main since this release

What's Changed

Bug fixes

  • Fix endmark stripping in font parser — the previous implementation used str_replace which removed endmark characters from the entire glyph line, not just the trailing ones. Now matches the C figlet algorithm: strip trailing spaces, then strip trailing endmarks from the end only.
  • Fix rendering of Latin-1 FLF fonts — fonts like konto.flf and kontoslant.flf use non-ASCII bytes (e.g. acute accent ´, byte 0xB4) as decorative strokes. These bytes are now correctly converted from Latin-1 to UTF-8 via mb_convert_encoding, so they display properly in modern terminals instead of showing �.
  • Add trailing newline to render() output — matches the behavior of the reference C figlet implementation.

New

  • examples/hello_world_by_font.php — a demo script that loads every bundled font and renders a greeting in the language/script the font was made for. Detects language from font metadata (comment header): Elder Futhark runes, Hebrew, Chinese, Morse, Braille, or Latin.

Internal

  • Unified charLength, charAt, charSlice, replaceCharAt to always use mb_* functions (all font data is now UTF-8 regardless of source encoding).
  • Bumped PHPMD ExcessiveClassLength threshold from 1200 to 1250.