Skip to content
 
 

Repository files navigation

FontPreview

A 320×170 typography preview application for CardputerZero, built with C++17, LVGL 9.5, SDL2/SDL2_mixer, and FreeType.

The screen has a compact parameter panel on the left and a scrollable, full-height text preview on the right. Interface labels use Noto CJK; on CardputerZero all five font families are loaded from Debian system packages.

Preview options

  • Preview content: Simplified Chinese, Traditional Chinese, Japanese, Korean, English, Portuguese, Czech, Greek, Russian, and Code
  • Fonts: Noto CJK, Go, Inter, DejaVu, and JetBrains Mono
  • Typefaces: Sans, Sans Italic, Serif, Serif Italic, Mono, and Mono Italic
  • Sizes: 8–24 px in 1 px steps, stopping at either boundary; hold Left/Right for rapid adjustment
  • Weights: Light, Regular, and Bold. Light is available for Inter and JetBrains Mono.
  • Colors: Black/White, White/Black, Sepia, Terminal, Solarized, Navy, Amber, and Slate

Controls

CardputerZero Desktop Action
F Up arrow or F Select the previous parameter
X Down arrow or X Select the next parameter
Z Left arrow or Z Previous value
C Right arrow or C Next value
L L Scroll preview up
M M Scroll preview down
Esc Esc Exit

Interface sounds

FontPreview uses four short cues from the CC0 UI SFX Arcade pack. focus marks Up/Down movement between parameter fields, while select confirms a successful Left/Right option change. blocked marks a size boundary or unsupported typeface or weight, and long-press announces entry into rapid size adjustment. Ordinary preview scrolling and every repeated size step stay silent to avoid noisy high-frequency feedback.

Arcade feedback is always enabled when the audio device is available. Audio reinforces the existing visual response and is never the only status signal. The bundled audio is dedicated to the public domain under CC0-1.0; see assets/audio/LICENSE-UISFX-AUDIO.txt.

Fonts

On CardputerZero, the application loads the complete Regular and Bold Noto CJK faces from the system fonts-noto-cjk package:

  • /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
  • /usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
  • /usr/share/fonts/opentype/noto/NotoSerifCJK-Regular.ttc
  • /usr/share/fonts/opentype/noto/NotoSerifCJK-Bold.ttc

The source tree keeps matching copies under assets/fonts/ for the macOS desktop preview only. The CardputerZero Debian package does not install or duplicate these font files.

The application selects the correct regional face inside each collection: JP for Japanese, KR for Korean, SC for Simplified Chinese, and TC for Traditional Chinese. Mono uses the matching regional Noto Sans Mono face already contained in the Sans TTC files, so separate Mono OTF copies are unnecessary.

The fonts are licensed under the SIL Open Font License 1.1. The source asset license is recorded in assets/fonts/LICENSE-NOTO-CJK.txt; installed CardputerZero fonts and their copyright information are managed by Debian's fonts-noto-cjk package.

Go, Inter, DejaVu, and JetBrains Mono are also loaded from their standard Debian system paths. The application package depends on fonts-noto-cjk, fonts-go, fonts-inter, fonts-dejavu-core, fonts-dejavu-extra, fonts-dejavu-mono, and fonts-jetbrains-mono. Inter and JetBrains Mono provide native Light and Light Italic files; the other configured families do not provide a Light face. Unsupported combinations are reported directly in the preview—for example, Inter does not provide Serif or Mono faces. Noto CJK italic selections use FreeType's synthetic italic rendering because Noto CJK does not ship native italic faces.

Character coverage

The Latin, Greek, and Cyrillic previews begin with explicit locale character rows based on Unicode CLDR, followed by natural text or pangrams. The application intentionally does not substitute a fallback font: a missing-glyph box is part of the test result. Character coverage therefore varies with the selected family, making it possible to compare the broad DejaVu coverage with the more specialized Inter, Go, JetBrains Mono, and Noto CJK families.

Build

Configure and build the macOS desktop preview:

cmake --preset darwin-arm64
cmake --build --preset darwin-arm64-dbg
./build/darwin-arm64/Debug/fontpreview

Build the CardputerZero ARM64 Debian package:

cmake --preset cp0-cross
cmake --build --preset cp0-cross-rel
cpack --preset cp0-cross-deb

The package is written to dist/FontPreview_0.4.3_m5stack1_arm64.deb and uses the system font packages listed above without installing duplicate font files.

About

Multilingual font and typeface preview for CardputerZero

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages