FORGE KUI / docs

Pages, images, fonts and paths

Choose embedded or file-based pages and keep resources working outside the project folder.

Version 3.61.7

Choose page loading first

loadHTML takes a string; loadFile loads a file. Lessons such as settings embed HTML/CSS in a generated header, so those pages are not read separately at runtime. File-based loading requires shipping the pages and external resources together.

Edit an embedded page

In the settings project, edit the source files rather than the generated output.

  1. Edit settings.zh.html / settings.en.html or app.css.
  2. Rebuild so CMake reads the files and refreshes generated_page.h.
  3. Close the old window and run the new build/Release/settings_lab.exe.
  4. Check --english as well; do not edit the generated header in build/.

Keep resource locations predictable

Define folders for images, fonts, pages and extensions. Resolve paths from an application-known root rather than a terminal’s working directory. Test relative paths in a minimal file-loaded page; an embedded string has no page-file folder you can assume.

Missing resources

Use the symptom to narrow the cause before editing.

Missing resources
SymptomCheck and action
Blank imageCheck the delivered file, path, format and element dimensions.
Different typographyCheck fonts, files, weights and fallback on the target machine.
Works only in the IDELaunch from another working directory and remove repository-path or developer-PATH dependencies.

Verify the actual delivery

Copy resources and runtime to a fresh folder and check language, icons, fonts, images and optional extensions. Store user data separately from embedded installation assets.