Skip to content

Convert fonts in DMOD_ASSETS_PATHS into .dmvf files - #322

Merged
JohnAmadis merged 1 commit into
developfrom
feature/assets-fonts
Oct 4, 2026
Merged

JohnAmadis merged 1 commit into
developfrom
feature/assets-fonts

Conversation

@JohnAmadis

Copy link
Copy Markdown
Contributor

Summary

DMOD_ASSETS_PATHS now converts fonts as well. TrueType and OpenType fonts (DMOD_FONT_EXTENSIONS, default ttf otf ttc) are rendered with todmvf into .dmvf files in DMOD_VIEWS_DIR, next to the views. They are packaged and installed with the views, so a view finds a font by its name.

  • Tool download: todmvf is downloaded with dmf-get at configure time, only when there are fonts.
  • Sizes come from an .ini: a font is made for one pixel size, so it needs its <font>.ini, read the same way as an image's.
    • Each [section] is an output <section>.dmvf.
    • size (pixel size, 4 to 127) is required.
    • chars (codepoint ranges) is optional.
    • Keys before any section apply to every output.
    ; Roboto-Regular.ttf.ini
    [sans-16]
    size = 16
    
    [title]
    size  = 24
    chars = 0x20-0x7E
  • No .ini: the font is left out, with a warning naming the missing file.
  • Configuration errors: a section without size, a size out of range, and unknown keys.
  • Rebuilds: each output depends on the font and its .ini.

_dmod_image_outputs became _dmod_asset_outputs(kind source prefix), shared by images and fonts. docs/cmake-functions.md documents fonts.

Requirements

todmvf must be released, since dmod downloads it with dmf-get. Until then a project with fonts gets the warning "Fonts will not be converted" and still builds.

Testing

Tested on the example module from #320 with a local manifest pointing at the todmvf build. Roboto-Regular.ttf with a two-section .ini produced:

  • sans-16.dmvf (21255 B, the same file as todmvf's own output);
  • title.dmvf (ASCII only, 24 px).

The views and images were built alongside, as before. Also checked:

  • Roboto-Bold.ttf without an .ini was left out with the warning.
  • A section without size, and size = 200, each failed configuration with an error naming the file.

🤖 Generated with Claude Code

TrueType / OpenType fonts (DMOD_FONT_EXTENSIONS, default ttf otf ttc) are
rendered with todmvf, downloaded with dmf-get only when there are fonts,
into DMOD_VIEWS_DIR next to the views. A font is made for one pixel size,
so it needs its <font>.ini: each section an output <section>.dmvf with
its size (required) and chars; a font without one is left out with a
warning. The .ini reading is shared with the images.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JohnAmadis JohnAmadis self-assigned this Oct 4, 2026
@JohnAmadis
JohnAmadis merged commit 00ede92 into develop Oct 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant