← Back to all sparks
B

bittermelon

ANALYTICS
Velocity0.0

bittermelon is growing from binary bitmaps toward greyscale and color glyphs

r-packagebitmap-fontsgreyscaletypographycranbreaking-changes
Current state
The package manipulates bitmap fonts and bitmaps in R, and the recent direction is widening what a glyph can be. v2.3.1 adds greyscale font support by reading the experimental yaff levels property into pixmap glyphs with alpha derived from the level fraction, and makes writing a multi-colored glyph an error rather than silently clamping it. Earlier releases built out the same surface: bm_extract(), an interactive pixel picker, data frame coercion, and format support for other packages' bitmap types.
Where it's heading
Two things are converging. The representation is moving beyond one-bit glyphs — pixmaps, color, and now greyscale levels with transparency — while the API gets stricter about the boundary between them, refusing to quietly downcast a color glyph on write. Separately, the package has been shedding weight: the embedded monobit copy was removed once it outgrew CRAN size limits, pushing format breadth onto a user-installed dependency.
Prediction
Expect further greyscale and color work now that levels parsing exists — most likely writing that format rather than only reading it, since the write path is where the current release chose to draw a hard error instead.

Recent moves

  1. 4mo ago

    Greyscale font reading arrives; color glyphs no longer clamp silently

    read_yaff() gains the experimental levels property, returning greyscale glyphs as pixmaps with transparency from the level fraction, while write_hex() and write_yaff() now error on multi-colored glyphs instead of clamping. It widens what a glyph can represent and makes the lossy path explicit at the same time.

    View source ↗
  2. 6mo ago

    Bitmap extraction and a supported-format predicate

    Adds bm_extract() for pulling out part of a bitmap and is_supported_bitmap() for testing whether an object is one of the handled formats. Small additions that make the package easier to build on top of.

    View source ↗
  3. 1y ago

    Data frame coercion and an interactive pixel picker

    Bitmaps and pixmaps gain as.data.frame() methods returning per-pixel coordinates, plus bm_pixel_picker() for reading coordinates and values by clicking. It opens the data to ordinary R workflows rather than keeping it behind package-specific accessors.

    View source ↗
  4. 2y ago

    Embedded monobit removed; broader format support now needs a manual install

    The bundled monobit copy is dropped because it outgrew CRAN package size limits, so reading and writing formats beyond .hex and .yaff requires installing monobit separately. A real break for existing users, forced by packaging constraints rather than chosen.

    View source ↗
  5. 2y ago

    Combining-character test fixed after a Unicode package change

    Updates is_combining_character() to survive a behavioural change in the Unicode package. Upstream maintenance with no visible effect.

    View source ↗
  6. 3y ago

    Hex fonts can be read selectively by code point

    read_hex() gains a ucp argument to read only specified Unicode code points, and two code-point helpers become vectorized. Useful on large fonts where reading everything is wasteful.

    View source ↗