# glcd_font

FONT library for use with GLCD's

Author | Matthew Schinkel - borntechi.com, copyright © 2009..2022, all rights reserved.
Adapted-by | Rob Jansen
Compiler | 2.5r6

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

- `var byte glcd_font_current_bit_direction_`
- `var byte glcd_font_current_id_`
- `const bit GLCD_FONT_USAGE = true`
- `var byte glcd_font_current_byte_per_char_`
- `var byte glcd_font_current_width_`
- `var byte glcd_font_current_height_`

### Procedures

- `glcd_font_use(byte in font_id)`

### Functions

- `glcd_font_lookup(word in idx) return byte`

## API details

### Global variables/contants

- `var byte glcd_font_current_bit_direction_`

  No documentation found

- `var byte glcd_font_current_id_`

  No documentation found

- `const bit GLCD_FONT_USAGE = true`

      flag: do we use font & chars related features ?

- `var byte glcd_font_current_byte_per_char_`

  No documentation found

- `var byte glcd_font_current_width_`

  No documentation found

- `var byte glcd_font_current_height_`

  No documentation found

### Procedures

- `glcd_font_use(byte in font_id)`

  No documentation found

### Functions

- `glcd_font_lookup(word in idx) return byte`

  No documentation found

## Related samples

Here are the list of samples which use this library:

16f1825 | 16f1825_dcf77_decoder_ssd1306.jal
16f1825 | 16f1825_glcd_ssd1306_font.jal
16f1825 | 16f1825_gps_neo_6m_ssd1306_clock.jal
16f1825 | 16f1825_philips_rc_decoder_ssd1306.jal
16f1825 | 16f1825_nec_rc_decoder_ssd1306.jal
16f1829 | 16f1829_glcd_ks0108.jal
16f18857 | 16f18857_glcd_ssd1306_font_graphics.jal
16f877a | 16f877a_glcd_ks0108.jal
18f2580 | 18f2580_rtc_ds1302_glcd.jal
18f4550 | 18f4550_glcd_nokia_5110_image.jal
18f4550 | 18f4550_glcd_nokia_5110_gfx.jal
18f4550 | 18f4550_glcd_nokia_5110_pixel.jal
18f4550 | 18f4550_glcd_nokia_5110_font.jal
18f4550 | 18f4550_glcd_nokia_5110_sprite.jal
18f6310 | 18f6310_glcd_ks0108.jal
18f6310 | 18f6310_glcd_ks0108_math.jal