Chinese Dot Matrix Generator

Rasterize Chinese characters into 8×8 to 32×32 dot matrices with selectable scan direction, bit order, threshold and inversion, then export C arrays, hex, binary or decimal font data.

FreeOnline Tool
Loading…

How to Use

Enter text and choose the matrix settings; the font data is generated in real time.

  1. Type one or more characters in the text field. With multiple characters, click a character button to preview that glyph.
  2. Select the matrix size (8×8, 12×12, 16×16, 24×24 or 32×32), scan direction (horizontal by row or vertical by column) and bit order (MSB First or LSB First).
  3. Drag the binarization threshold slider (1–254, default 80). If strokes and background are reversed, check “Invert (flip strokes)”.
  4. Choose an output format (C array, hexadecimal, binary or decimal) to view the current character data and the combined data for all characters.
  5. Hover over a matrix cell to see which byte it belongs to. Use Copy Current Character Data or the Copy button in the combined output section to copy the result.
  6. Load Sample Data fills in “好工具啊”, 16×16, horizontal scan, MSB First, threshold 80 and C array format; Clear removes the input.

Characters are drawn on a browser canvas using locally installed Chinese fonts and then binarized by block-average brightness. Different machines may produce slightly different glyphs, and no text is uploaded.

Features

  • Five matrix sizes: 8×8, 12×12, 16×16, 24×24 and 32×32.
  • Horizontal scan outputs row by row; vertical scan outputs column by column. Each row or column uses ceil(size/8) bytes.
  • With MSB First, the first pixel in a unit maps to bit 7; with LSB First, it maps to bit 0.
  • The binarization threshold ranges from 1 to 254 and uses the average brightness of each RGBA block (BT.601 weights). Whole-matrix inversion is available.
  • Four output formats: C array with Row/Col comments and a uint8_t declaration, hexadecimal, binary and decimal.
  • Encode multiple characters separately, or output one combined font array for all characters.
  • Matrix cells are colored by byte, and hovering shows the byte index and current value.
  • Rasterization and encoding run entirely in the browser.

Use Cases

Building OLED font tables
Generate 16×16 Chinese glyphs for small OLED displays and export C arrays in the scan direction and bit order required by the driver library.
LCD and LED matrix font extraction
Create single-character or combined font data for 12864 LCDs and LED dot matrix panels.
MCU projects and coursework
Get paste-ready font bytes for STM32 or Arduino projects instead of drawing pixels by hand.
Learning font encoding
Switch scan direction, bit order and output format to see how the same glyph maps to different byte sequences.

FAQ

How many bytes does each matrix size produce?
Each scan unit (row or column) uses ceil(size/8) bytes, so the total is size × that value: 8 bytes for 8×8, 24 for 12×12, 32 for 16×16, 72 for 24×24 and 128 for 32×32.
Why does a 12×12 matrix use 2 bytes per row?
Twelve pixels do not divide evenly by 8, so each row or column rounds up to 2 bytes (16 bits). The 4 bits beyond the 12th pixel remain 0.
What is the difference between horizontal and vertical scan?
Horizontal scan outputs row 0 first, then row 1, and so on. Vertical scan outputs column 0 first, then column 1. Match the mode used by your display or font-extraction tool.
Should I choose MSB First or LSB First?
It depends on the driver chip or matrix library. MSB First places the first pixel of a unit at bit 7, while LSB First places it at bit 0. Choosing the wrong one can mirror the glyph or shift its strokes.
What do the threshold and inversion options do?
The threshold decides how bright a block must be to count as lit; the default is 80. Higher values thin the strokes, lower values thicken them. Inversion flips every cell and suits cases where the source is white-on-black but the target panel lights pixels differently.
Can the generated font data be used directly on a microcontroller?
The C array format produces a uint8_t array with Row/Col comments, but LCD and OLED controllers differ in scan direction, bit order and page addressing. Check the panel datasheet, including how padding bits in 12×12 or 24×24 data are handled.