---
title: "JIT bitmap text rendering for microcontrollers"
description: "Proportionally spaced, kerned bitmap text on the RP2350 renders fast enough to race the beam by JIT-compiling each string into ARM Cortex-M33 code."
url: "https://swe.quest/articles/jit-bitmap-text-rendering-for-microcontrollers-b2c91e4d8888665c"
canonical: "https://linebender.org/blog/jit-bitmap-text/"
source: "Linebender"
published: "2026-11-07"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 13
tags: ["compilers","performance","hardware","algorithms"]
---

# JIT bitmap text rendering for microcontrollers

A post on [Linebender](https://swe.quest/sources/linebender.md), published 2026-11-07, 13 min read, Deep dive. Original: [https://linebender.org/blog/jit-bitmap-text/](https://linebender.org/blog/jit-bitmap-text/)

## Summary

Proportionally spaced, kerned bitmap text on the RP2350 renders fast enough to race the beam by JIT-compiling each string into ARM Cortex-M33 code. The generated code extracts glyph rows from a tightly packed font bitmap into a 1bpp scanline buffer, and a second pass expands that buffer to RGB565. The font is packed so glyphs never straddle 32-bit words and overlapping glyphs share pixels. The JIT costs about 23 cycles per glyph, and generated code runs at roughly 3 cycles per glyph row. The whole text demo uses about 2.6% of one core, and kerning uses a two-byte-per-glyph "dot product" of left/right bitvectors evaluated with AND plus popcount.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Compilers](https://swe.quest/tags/compilers.md) (Compilers & runtimes)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Hardware](https://swe.quest/tags/hardware.md) (Infrastructure)
- [Algorithms](https://swe.quest/tags/algorithms.md) (Architecture & design)

## Prerequisites

- ARM assembly
- microcontroller graphics
- bitmap fonts
- JIT compilation basics ([easy posts on Compilers](https://swe.quest/tags/compilers.md?difficulty=easy))

## Keywords

RP2350, vic-2350, symbolasm, Cortex-M33, HSTX, DVI, kerning, dvhstx

## Related posts

- [Ruby 3.2’s YJIT is Production-Ready](https://swe.quest/articles/ruby-3-2-s-yjit-is-production-ready-05f17a68a56ea05c.md): Shopify Engineering · 2023-01-17 · Easy · 10 min read · Ruby, Compilers, Runtimes & VMs, Performance engineering, Rust
  YJIT, Shopify's JIT compiler for CRuby, became production-ready in Ruby 3.2 after a port from C99 to Rust and a cut in memory overhead to about a third of Ruby 3.1 levels.
- [Try Out YJIT for Faster Rubying](https://swe.quest/articles/try-out-yjit-for-faster-rubying-6105453188fbb741.md): Shopify Engineering · 2021-10-15 · Medium · 7 min read · Ruby, Compilers, Runtimes & VMs, Performance engineering
  YJIT, Shopify's just-in-time compiler built into CRuby and slated for Ruby 3.1, compiles frequently used Ruby code to native machine code, speeding up a simple Rails benchmark by 20% or more and a real Shopify web service by about 6% on canary traffic.
- [Leveraging Rust and the GPU to render user interfaces at 120 FPS](https://swe.quest/articles/leveraging-rust-and-the-gpu-to-render-user-interfaces-at-120-fps-8175e9071db5a167.md): Zed · 2023-03-07 · Hard · 16 min read · Performance engineering, Rust, Frontend, Hardware, Developer tools
  Zed's GPUI framework hits 120 FPS by rendering the editor UI like a video game: rather than a general-purpose 2D vector renderer (Pathfinder proved too slow), it uses dedicated GPU shaders for a small set of primitives such as rectangles, shadows, text, icons and images, all described as data on the CPU and drawn with instanced rendering.
- [YJIT: Building a New JIT Compiler for CRuby](https://swe.quest/articles/yjit-building-a-new-jit-compiler-for-cruby-51c5ee3c390b2164.md): Shopify Engineering · 2021-10-14 · Easy · 6 min read · Compilers, Ruby, Runtimes & VMs, Performance engineering
  YJIT is a new JIT compiler built inside CRuby by Shopify and GitHub engineers, based on Basic Block Versioning, and aimed at real-world workloads like Rails where the GCC-based MJIT has struggled.
- [Optimizing WebKit & Safari for Speedometer 3.0](https://swe.quest/articles/optimizing-webkit-safari-for-speedometer-3-0-a9a8d1c62cb906f4.md): WebKit · 2024-04-10 · Hard · 11 min read · Browsers, Web performance, Runtimes & VMs, Memory management, Performance engineering
  WebKit's Speedometer 3.0 work spans JavaScriptCore, DOM, style, layout, rendering and Safari itself, with measured gains for each change.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
