Hongmu Notes

C language font array export

Organize the modulo results into a usable form for the source code, copy and add the variable name.
100% Browser local processing 0 Data upload

💡 Modulo settings

Dot matrix preview (each bright spot corresponds to a pixel, which can be directly compared with the screen display effect)

💡 Instructions for use

  • Select the size first and then enter the text: Chinese commonly uses sixteen by sixteen, numbers and letters can be eight by eight or eight by sixteen, and the module size determines how big the window should be.
  • The results of row-by-row modulo and column-by-column modulo are not interchangeable: the former corresponds to the drive for row-by-row scanning, and the latter corresponds to column-by-column scanning. Confirm the driving method before pasting the code.
  • The byte order needs to be compared with the driver code: the data obtained by low-end first and high-end first are mirror images of each other. The phenomenon is that the entire pattern is flipped horizontally or vertically.
  • If the screen display is inverted, just invert each byte bit by bit, and then generate a comparison confirmation after switching the negative code and the positive code.
  • Characters with more complex strokes tend to stick together at small sizes, so you can increase the size or simplify the text; a low threshold will make the strokes thicker, and a high threshold will cause them to break.
  • The dot matrix view is provided at the top of the page, which is consistent with the output zero-one matrix and can be directly used to check the screen display effect.

Organize the modulo results into a usable form for the source code, copy and add the variable name.

After pasting the code

Fill in the variable declaration and length to ensure that the number and size of elements match.

Put the array into a read-only data area to avoid occupying writable memory.

Indexing convention

Agree on the indexing method with the display function, such as which byte corresponds to which row.

When displaying multiple words, create a separate array for each word and output it in sequence.

memory experience

Read-only data plus constant modification can save considerable memory usage.

The length of the array is expressed by macro definition, and only one point is changed when changing the size.

Commenting habits

Note the font, size, scanning method and bit order.

When changing screens or handing over, this information can quickly determine whether the font needs to be redone.

Maintenance recommendations

The fonts are put into independent files and stored separately from the business codes.

The fonts generated in batches are named uniformly to facilitate retrieval and replacement.

Writing the modulo parameters into comments can save a lot of troubleshooting time when changing screens or handovers.

📖 Glossary

Bitmap font
Each character is represented as bright spot data arranged in rows and columns, corresponding bit by bit to a light on the screen, for the controller to scan and display row by row or column by column.
Take a mold
The process of converting the dot matrix pattern into a byte sequence usable by the controller is completely different from the data obtained by rows and columns.
Modulo by row
Reading in horizontal order, with each line represented by one byte, is the most common modulo method.
Modulo column
Read in vertical order, with each column represented by one byte. It is common in vertically scanned screens and some font formats.
Endianness
The correspondence between the eight bits in a byte and the eight columns or rows of the screen: low-order bit first or high-order bit first, must be consistent with the driver code.
Font width and height
The number of dot matrix rows and columns occupied by a single character. Chinese characters are usually sixteen by sixteen, and numbers and letters are usually eight by sixteen or five by seven.
Yin code and Yang code
The one that lights up is a positive code, and the one that turns off is a negative code; the data of the same display pattern under the two conventions are exactly opposite.
Scanning method
The order in which the driver lights up the screen row by row or column by column, and the modulo-taking direction needs to match the scanning direction, otherwise the display will be misaligned or rotated.
font
The pre-stored lattice data set can be used directly by the controller to look up the table, which can save real-time calculations.
point spacing
The blank rows and columns in the font window are used to prevent adjacent character strokes from being pasted together and making it difficult to distinguish.

🔗 All keywords and tutorials

Keywords page of the tool12a

Return to tool home page

❓ FAQ

Can an array be placed in a read-only area?
Can. The font does not need to be modified during runtime. Adding constant modifications saves memory.
How to organize multi-word display?
After each word is generated, an array is constructed, and when displayed, the data is output in sequence or spliced into one screen of data.