icu_tool

v0.3.0 - 2026-07-09

v0.3.0 Jul 10 2026 at 06:31 UTC

๐Ÿ”– Version Tag

  • ๐Ÿš€ New Features:
    • โœจ mirx image format support โ€” icu now decodes and encodes mirx FLAT images (all pixel formats: RGB565 / RGB565Swapped / RGB888 / RGBA8888 / BGRA8888 / XRGB8888) plus mirx CHUNK files with VECTOR / FONT chunks. icu convert -F mirx produces mirx output; icu info reports per-chunk metadata (op_count, glyph_count, source_size, bit_depth).
    • โœจ TTF/OTF/TTC font parsing via ttf-parser โ€” icu info on a TTF reports family, style, units_per_em, ascender, descender, line_height, glyph_count. Glyph outlines collect into mirx::PathCmd (MoveTo / LineTo / QuadTo / CubicTo / Close) with 24.8 fixed coordinates.
    • โœจ icu bake-font CLI โ€” bakes a TTF/OTF into a mirx FONT chunk (SDF or grayscale atlas). Pipeline: ttf-parser outline โ†’ mirui scanline coverage โ†’ Euclidean distance transform โ†’ 4/8-bit quantization (SDF) or packed coverage (gray). Supports --charset / --charset-file / --size / --bit-depth / --spread / --format sdf|gray.
    • โœจ icu merge-fonts CLI โ€” merges multiple single-font .mirx files into one multi-FONT-chunk bundle for MultiFontProvider size-based selection at runtime.
    • โœจ SVG import/export โ€” icu info / icu show / icu convert accept SVG. Import uses usvg (resolves <defs>, <use>, <symbol>, transform lists, style inheritance, gradients/clip-paths/masks). Export emits <path> / <rect> / <line> / <g> with fill, fill-opacity, fill-rule, stroke, stroke-width, stroke-linecap, stroke-linejoin, transform. icu convert test.svg -F mirx produces a VECTOR chunk.
    • โœจ MiData::PATH / FONT / INDEXED variants โ€” MiData carries structured data alongside the flat RGBA preview. PATH(SceneData) wraps mirx::Scene; FONT(FontData) is an enum (Mirx(mirx::Font) | FreeType(FreeTypeFontData)); INDEXED(IndexedImageData) carries palette + per-pixel indexes + bpp.
    • โœจ Font/path/indexed viewer panels in the GUI โ€” ImageItem carries the original MiData; central panel dispatches on variant. FONT shows metadata + preview-text input + rendered atlas; PATH shows a scene op tree; INDEXED shows a palette grid whose entries drive an IndexHoverOverlay.
    • โœจ SDF โ†’ Gray downsample โ€” sdf_to_gray_font samples an SDF atlas at a target pixel size and packs coverage into an 8-bit grayscale font, no re-bake from TTF needed.
    • โœจ Postprocess overlay framework โ€” ImageOverlay trait + OverlayStack composite with alpha blending and dirty-flag cache. IndexHoverOverlay highlights palette-indexed pixels; QualityOverlay renders a quantization-error heat map; DiffOverlay drives the diff display.
    • โœจ LVGL indexed decode โ€” I1/I2/I4/I8 color formats decode to MiData::INDEXED with palette + indexes + bpp extracted before the generic RGBA conversion.
    • โœจ ColorFormat unification โ€” icu_lib::endecoder::ColorFormat is the universal enum; LVGL and mirx each From their own wire format. EncoderParams.color_format is now icu_lib::ColorFormat.
  • ๐Ÿ”ง Improvements:
    • ๐Ÿงน Diff display routed through OverlayStack + DiffOverlay. ImageDiffResult still feeds diff_panel pixel list / min-max range.
    • ๐Ÿงน icu_lib re-exports mirx and image crates.
    • ๐Ÿงน MiData + all variants derive Clone + PartialEq.

๐Ÿ“ฆ Dependencies

  • โž• ttf-parser = "0.25" (icu_lib)
  • โž• usvg = { version = "0.47", default-features = false } (icu_lib; no fontdb, no text shaping โ€” +~510KB binary)
  • โž• mirx = "0.41" + mirui = { version = "0.41", default-features = false } + critical-section = { version = "1", features = ["std"] } (icu_lib)