glcd_font

FONT library for use with GLCD's

Author Matthew Schinkel - borntechi.com, copyright © 2009, all rights reserved.
Adapted-by
Compiler >=2.4k

Description

Main font library.
API: include as many font library as you want, then include this one.
Define which font you want to use during programm execution, calling
glcd_font_use(font_id). Font lookup (retrieving a char) is done using
glcd_font_lookup(idx)


Sources

http://www.divshare.com/download/11463401-4a9


Notes

Fonts have an ID, unique amongst all font libraries. ID goes from
0x01 to 0xFE (0x00 and 0xFF are reserved for internal usage). Fonts which
are part of jallib distribution have their ID starting from 0x01, 
increasing. There are also "slots" for user-defined libraries, starting from
0xFE, decreasing. This way all jallib IDs are consecutive, so are user-defined.
This leaves room for 253 fonts. Each font library addition involves updating
procedures glcd_font_use() and glcd_font_lookup().



Font name usually includes information about its Width x Height (eg. FONT_5X7).
A font library often declares characters, but can also declares other kind of
stuff (like sprites). 



Example: FONT_9X12_TOP_RIGHT_HORIZONTAL_MY_FONT_NAME



Your lcd will most likely only support one font bit order.



This example is 9x12 (font_top_right_horizontal)
const byte FONT_9x12_0_NONAME[] = {0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00,0x00} -- "!"


-horizontal--->
0 0 0 0 0 0 0 0 0   -- 0x00 0x00
0 0 0 0 0 0 0 0 0   -- 0x00 0x00
0 0 1 0 0 0 0 0 0   -- 0x20 0x00
0 0 1 0 0 0 0 0 0   -- 0x20 0x00
0 0 1 0 0 0 0 0 0   -- 0x20 0x00
0 0 1 0 0 0 0 0 0   -- 0x20 0x00
0 0 1 0 0 0 0 0 0   -- 0x20 0x00
0 0 1 0 0 0 0 0 0   -- 0x20 0x00
0 0 0 0 0 0 0 0 0   -- 0x00 0x00
0 0 1 0 0 0 0 0 0   -- 0x20 0x00
0 0 0 0 0 0 0 0 0   -- 0x00 0x00
0 0 0 0 0 0 0 0 0   -- 0x00 0x00



This example is FONT_9x12_7_NONAME (FONT_BOTTOM_LEFT_VERTICAL)
const byte font_table[] = {0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x2F0C 0x0000 0x0000} -- "!"



0      0      0      0      0      0      0      0      0        ^
0      0      0      0      0      0      0      0      0        |
0      0      1      0      0      0      0      0      0        L
0      0      1      0      0      0      0      0      0        A
0      0      1      0      0      0      0      0      0        C
0      0      1      0      0      0      0      0      0        I
0      0      1      0      0      0      0      0      0        T
0      0      1      0      0      0      0      0      0        R
0      0      0      0      0      0      0      0      0        E
0      0      1      0      0      0      0      0      0        V
0      0      0      0      0      0      0      0      0        |
0      0      0      0      0      0      0      0      0        |
0x0000 0x0000 0x2F0C 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f877a16f877a_glcd_ks0108.jal
18f258018f2580_rtc_ds1302_glcd.jal
18f462018f4620_glcd_touch_stm032qvt_003.jal
18f46k2218f46k22_glcd_touch_stm032qvt_003.jal
18f631018f6310_glcd_ks0108.jal
18f631018f6310_glcd_ks0108_math.jal