Display of Large font numeric parameters in the Instrument Software

Source: Internet
Author: User

Title: Display and processing of Large font value parameters in the Instrument Software

Author: favory. Peng (2010/5/11)

 

A large number of digital fonts are usually used in a monitor or other medical instruments to make the display of measurement parameters more conspicuous, these digital dot matrix fonts usually occupy a lot of storage space. When resources in the embedded system are very tight, it will be a great deal of overhead (this may not be a big problem ), however, when displaying these large measurement parameters, it is very inefficient to draw them to the display area of the screen parameters. To solve this problem, I will tell you a simple method for compressing storage and quick display of dot matrix font.

The dot matrix of the number "8" is used as an example:

We can use the method of storing lines to break down and store this dot matrix. A byte represents a segment line (within 128 points). bit7 indicates whether the content of this segment is black or white (0/1) and the foreground is the background, followed by 7 bit6 ~ Bit0 stores the number of consecutive points and the length of line segments;

Because the dot matrix structure of numbers is relatively simple, this simple compression storage method will greatly reduce the storage space of large dot matrix libraries.

In addition, when we use this storage structure for dot matrix display, it will greatly improve the display efficiency. We can use the method of drawing lines to display the dot matrix font, in most controller commands on the LCD screen, horizontal line (display consecutive) Rendering is optimized, saving at least the time required to send the display address.

Lattice font Structure Definition

Byte1: dot matrix ID (0-horizontal, 1-vertical)

Byte2: number of characters

Byte3: first character encoding

Byte4: dot matrix character height

Byte5: dot matrix character width

Byte6 ~ Byte10: Reserved Bit

Byte11 ~ Byte50: character dot matrix index table (two bytes indicate the starting position of a character dot matrix and 20 characters are supported)

Byte51 ~ Byte n: character dot matrix data segment

Dot Matrix character display function processing process

1. Calculate the character lattice index location based on the first character encoding

2. Read the character dot matrix index information and read the character dot matrix data

3. Determine the first place. If the foreground draws a straight line based on the number of bytes, And the Y + 1, x returns after the width of the full character

Note: In some video storage partition platforms, You need to optimize the draw line function to determine the display partition information. If there is a shard junction, draw lines in two segments;

 

Note: although this technology is not high, this ideal is good and I hope it will be helpful to friends who have similar applications ....

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.