Repository navigation
Convert fonts in DMOD_ASSETS_PATHS into .dmvf files - #322
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DMOD_ASSETS_PATHSnow converts fonts as well. TrueType and OpenType fonts (DMOD_FONT_EXTENSIONS, defaultttf otf ttc) are rendered with todmvf into.dmvffiles inDMOD_VIEWS_DIR, next to the views. They are packaged and installed with the views, so a view finds a font by its name..ini: a font is made for one pixel size, so it needs its<font>.ini, read the same way as an image's.[section]is an output<section>.dmvf.size(pixel size, 4 to 127) is required.chars(codepoint ranges) is optional..ini: the font is left out, with a warning naming the missing file.size, a size out of range, and unknown keys..ini._dmod_image_outputsbecame_dmod_asset_outputs(kind source prefix), shared by images and fonts.docs/cmake-functions.mddocuments 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
.iniproduced: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:
.iniwas left out with the warning.size, andsize = 200, each failed configuration with an error naming the file.🤖 Generated with Claude Code