Use of Virtual Fonts

The most efficient way to reduce processor memory consumption in most embedded GUI systems.

  • Very small processor ROM consumption.

  • Extremely small processor RAM consumption.

  • Very small impact on update-speed performance.

  • Integrated locating, look-up, and access management.

  • Easy to implement. Easy to use. Simple maintenance.

  • Enables update of fonts after product release time.

Background

Graphic picture images, fonts with a large number of character symbols, or fonts with large character symbols are often the most memory-consuming objects in a graphical application.

Moving such memory-consuming constant data objects from processor ROM memory to an external storage device, such as a serial EEPROM, a serial flash device, or a disk type device, can give a huge reduction in processor ROM memory consumption.

The method also facilitates update of fonts and graphics after product release time. Makes it easier to support multiple languages.

The RAMTEX Virtual Font features, facilitates and automates this design solution. Supported by all GUI display driver packages.

Advantages with use of Virtual Files. Save processor ROM memory

Virtual memory storage handling:

Get virtually unlimited memory storage for fonts, images, and BMP and PNG pictures

The number of fonts, icons and pictures that can be handled is only limited by the byte size of each external memory device and the number of external memory devices used for Virtual Font storage.

Integrated virtual font locating and look-up handling

The look-up handling for all virtual fonts is integrated with the library.
One virtual font storage image can contain multiple individual fonts and pictures.
One virtual font storage image can be located in multiple memory devices.
One application can use multiple virtual font storage images.
No need for FILE type support in the embedded program application.
No need for any special virtual font look-up considerations at GUI application level.

Optimized data load
Minimum RAM consumption

Virtual font data are fetched directly from the virtual storage image when needed during screen drawing.
A large font symbol or image can be fetched in multiple small parts in the optimal order for the video format used by the given display controller. This means a minimum RAM buffer requirement for temporary data.

This concept results in RAM buffer requirements which are several magnitudes less than would otherwise be required if the application had to load full soft fonts to RAM before use.

Configurable RAM buffer size. The optimal RAM buffer size with respect to speed is equal to the symbol byte size of the most used font. Minimum RAM buffer size can be as low as 6 bytes.

Device-independent storage format

The virtual font storage image format is compiler and processor endian independent.
This ensures full portability between any platform types, for instance between an embedded target system and PC-mode simulation.

During loading and programming, a virtual font storage image is treated as one linear byte array.
This simplifies both downloading and programming of a virtual font device and subsequent fetching of virtual font data.

Memory chip device driver

Any type of data storage device can be used for the virtual font storage image.
Block copying of the virtual font data from the external storage device (EEPROM, flash chip, etc.) to a RAM buffer is simply done with a small customized device driver function. Template device driver functions are included with the library.
The same device driver is used by Virtual Files

Programming with Virtual Fonts

Easy to use

Virtual fonts are used in the same easy way as compiled-in fonts. In fact, from a GUI application programmer's point of view, there is no difference. Just select a font in the normal way and then use it for text or picture output.

Smooth migration path

Virtual fonts and normal compiled-in fonts can coexist seamlessly in the same embedded application.
Virtual fonts may therefore be introduced late in the development process without any impact on the existing GUI application source code. For instance, you can start with normal compiled-in fonts and then later switch to using virtual fonts

Simple to add support for more languages.

Locating most fonts in the external memory storage enables an application to include multiple language-specific fonts without putting extra constraints on processor ROM memory.
This is particularly important when using the large Chinese or Japanese language-specific fonts.

Full PC simulation support

All virtual fonts can be run-time tested on the PC.
The display driver libraries provide support for run-time testing of a GUI application on the PC using ordinary PC compiler tools and the LCD simulation server.
During testing, the virtual font image data is just fetched directly from the file.

Creating Virtual Fonts

Easy to create virtual fonts

The generation of virtual font files is particularly easy.
The GENVF.EXE program included with the library auto-generates virtual fonts by converting existing soft-font files, pictures, images, BMP files, and PNG files into a single set of virtual font files (here called vf.*). The files contain all the information needed for font locating, look-up, and access management.

GENVF Font to Virtual font conversion program

The existing (original) fonts and images may, for instance, have been created with the B&W IconEdit tool or Color IconEdit tool. They can also be standard fonts from the display driver library packages, or fonts taken from the European Font library package, or the Extended Asian font library package.

Virtual Font files

vf.bin

Virtual font image

To be located in (programmed into) the virtual memory device.

vf.c

Virtual font descriptor.

To be included in the compilation project.
Accelerates text size and position calculations in the application.
Contains all locating and look-up information for vfont.bin
Provides fast font selection without initial load time overhead.

vf.h

Virtual font prototypes

To be included via application modules using virtual fonts.

Color format conversion

The GENVF program includes color format conversion from various BMP or PNG file formats to the color data formats used by the display controller / driver libraries:

  • BMP B&W format to library format conversion (with size reduction)
  • BMP color to grey-shade conversion (color format and size compression)
  • BMP palette to RGB conversion (color format expansion)
  • BMP RGB conversion with palette-matching (color format and size compression).
  • PNG B&W format to library format conversion (with size reduction)
  • PNG RGB to library format conversion (color format and size compression).
  • PNG RGBA to library format conversion (transparent color format).
  • PNG color to grey-shade conversion (color format and size compression)