This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C123GH6PGE: How to create 5x7 Font

Part Number: TM4C123GH6PGE
Other Parts Discussed in Thread: BOOSTXL-K350QVG-S1, EK-TM4C1294XL, EK-TM4C123GXL

Hello,

Please tell me how to create 5x7 Font source code. ?

I need a small size font.

for example, 

The example below is like 6x8 Font source code. (  Grlib / fonts (fontfixed6x8.c) )

Regards.

Jame,Shin

//*****************************************************************************

#include <stdint.h>
#include <stdbool.h>
#include "grlib/grlib.h"

//*****************************************************************************
//
// Details of this font:
//     Style: fixed
//     Size: 8 point
//     Bold: no
//     Italic: no
//     Memory usage: 960 bytes
//
//*****************************************************************************

//*****************************************************************************
//
// The uncompressed data for the fixed-point 6x8 font.
//
//*****************************************************************************
static const uint8_t g_pui8FontFixed6x8Data[760] =
{
      8,   6,   0,   0,   0,   0,   0,   0,   8,   6,  32, 130,
      8,   0,   2,   0,   8,   6,  81,  69,   0,   0,   0,   0,
      8,   6,  81,  79, 148, 249,  69,   0,   8,   6,  33, 234,
     28,  43, 194,   0,   8,   6, 195,  33,   8,  66,  97, 128,
      8,   6,  98,  74,  16, 170,  70, 128,   8,   6,  96, 132,
      0,   0,   0,   0,   8,   6,  16, 132,  16,  64, 129,   0,
      8,   6,  64, 129,   4,  16, 132,   0,   8,   6,   0, 138,
    156, 168, 128,   0,   8,   6,   0, 130,  62,  32, 128,   0,
      8,   6,   0,   0,   0,  96, 132,   0,   8,   6,   0,   0,
     62,   0,   0,   0,   8,   6,   0,   0,   0,   1, 134,   0,
      8,   6,   0,  33,   8,  66,   0,   0,   8,   6, 114,  41,
    170, 202,  39,   0,   8,   6,  33, 130,   8,  32, 135,   0,
      8,   6, 114,  32, 132,  33,  15, 128,   8,   6, 248,  66,
      4,  10,  39,   0,   8,   6,  16, 197,  36, 248,  65,   0,
      8,   6, 250,  15,   2,  10,  39,   0,   8,   6,  49,   8,
     60, 138,  39,   0,   8,   6, 248,  33,   8,  65,   4,   0,
      8,   6, 114,  40, 156, 138,  39,   0,   8,   6, 114,  40,
    158,   8,  70,   0,   8,   6,   1, 134,   0,  97, 128,   0,
      8,   6,   1, 134,   0,  96, 132,   0,   8,   6,  16, 132,
     32,  64, 129,   0,   8,   6,   0,  15, 128, 248,   0,   0,
      8,   6,  64, 129,   2,  16, 132,   0,   8,   6, 114,  32,
    132,  32,   2,   0,   8,   6, 114,  32, 154, 170, 167,   0,
      8,   6, 114,  40, 162, 250,  40, 128,   8,   6, 242,  40,
    188, 138,  47,   0,   8,   6, 114,  40,  32, 130,  39,   0,
      8,   6, 226,  72, 162, 138,  78,   0,   8,   6, 250,   8,
     60, 130,  15, 128,   8,   6, 250,   8,  60, 130,   8,   0,
      8,   6, 114,  40,  46, 138,  39, 128,   8,   6, 138,  40,
    190, 138,  40, 128,   8,   6, 112, 130,   8,  32, 135,   0,
      8,   6,  56,  65,   4,  18,  70,   0,   8,   6, 138,  74,
     48, 162,  72, 128,   8,   6, 130,   8,  32, 130,  15, 128,
      8,   6, 139, 106, 170, 138,  40, 128,   8,   6, 138,  44,
    170, 154,  40, 128,   8,   6, 114,  40, 162, 138,  39,   0,
      8,   6, 242,  40, 188, 130,   8,   0,   8,   6, 114,  40,
    162, 170,  70, 128,   8,   6, 242,  40, 188, 162,  72, 128,
      8,   6, 122,   8,  28,   8,  47,   0,   8,   6, 248, 130,
      8,  32, 130,   0,   8,   6, 138,  40, 162, 138,  39,   0,
      8,   6, 138,  40, 162, 137,  66,   0,   8,   6, 138,  40,
    170, 170, 165,   0,   8,   6, 138,  37,   8,  82,  40, 128,
      8,   6, 138,  40, 148,  32, 130,   0,   8,   6, 248,  33,
      8,  66,  15, 128,   8,   6, 113,   4,  16,  65,   7,   0,
      8,   6,   2,   4,   8,  16,  32,   0,   8,   6, 112,  65,
      4,  16,  71,   0,   8,   6,  33,  72, 128,   0,   0,   0,
      8,   6,   0,   0,   0,   0,  15, 128,   8,   6,  64, 129,
      0,   0,   0,   0,   8,   6,   0,   7,   2, 122,  39, 128,
      8,   6, 130,  11,  50, 138,  47,   0,   8,   6,   0,   7,
     32, 130,  39,   0,   8,   6,   8,  38, 166, 138,  39, 128,
      8,   6,   0,   7,  34, 250,   7,   0,   8,   6,  49,  36,
     56,  65,   4,   0,   8,   6,   1, 232, 162, 120,  39,   0,
      8,   6, 130,  11,  50, 138,  40, 128,   8,   6,  32,   6,
      8,  32, 135,   0,   8,   6,  16,   3,   4,  18,  70,   0,
      8,   6, 130,   9,  40, 194, 137,   0,   8,   6,  96, 130,
      8,  32, 135,   0,   8,   6,   0,  13,  42, 170,  40, 128,
      8,   6,   0,  11,  50, 138,  40, 128,   8,   6,   0,   7,
     34, 138,  39,   0,   8,   6,   0,  15,  34, 242,   8,   0,
      8,   6,   0,   6, 166, 120,  32, 128,   8,   6,   0,  11,
     50, 130,   8,   0,   8,   6,   0,   7,  32, 112,  47,   0,
      8,   6,  65,  14,  16,  65,  35,   0,   8,   6,   0,   8,
    162, 138, 102, 128,   8,   6,   0,   8, 162, 137,  66,   0,
      8,   6,   0,   8, 162, 170, 165,   0,   8,   6,   0,   8,
    148,  33,  72, 128,   8,   6,   0,   8, 162, 120,  39,   0,
      8,   6,   0,  15, 132,  33,  15, 128,   8,   6,  16, 130,
     16,  32, 129,   0,   8,   6,  32, 130,   8,  32, 130,   0,
      8,   6,  64, 130,   4,  32, 132,   0,   8,   6,  66, 161,
      0,   0,   0,   0,
};

//*****************************************************************************
//
// The font definition for the fixed-point 6x8 font.
//
//*****************************************************************************
const tFont g_sFontFixed6x8 =
{
    //
    // The format of the font.
    //
    FONT_FMT_UNCOMPRESSED,

    //
    // The maximum width of the font.
    //
    6,

    //
    // The height of the font.
    //
    8,

    //
    // The baseline of the font.
    //
    7,

    //
    // The offset to each character in the font.
    //
    {
           0,    8,   16,   24,   32,   40,   48,   56,
          64,   72,   80,   88,   96,  104,  112,  120,
         128,  136,  144,  152,  160,  168,  176,  184,
         192,  200,  208,  216,  224,  232,  240,  248,
         256,  264,  272,  280,  288,  296,  304,  312,
         320,  328,  336,  344,  352,  360,  368,  376,
         384,  392,  400,  408,  416,  424,  432,  440,
         448,  456,  464,  472,  480,  488,  496,  504,
         512,  520,  528,  536,  544,  552,  560,  568,
         576,  584,  592,  600,  608,  616,  624,  632,
         640,  648,  656,  664,  672,  680,  688,  696,
         704,  712,  720,  728,  736,  744,  752,
    },

    //
    // A pointer to the actual font data
    //
    g_pui8FontFixed6x8Data
};

  • Jame shin said:
    Please tell me how to create 5x7 Font source code. ?

    Is that not - exactly - just what your, "fixed point, 6x8 font" achieves?   (which you've ably & completely presented!)

    Kindly note that the 6x8 nomenclature refers to the embedding of, "One extra (blank) font column & one extra (blank) font row" - to nicely 'encase' the 5x7 font pixel field.   (Minus those 2 blank areas (one column & one row between characters) - the individual font characters would, 'run together' - preventing clear/eased character recognition.)

    Ninty-five font characters are revealed.    Most always these represent the 'Visible' characters - which 'start' at  '0x20'  (that's the space character.)

    Indeed your 'font table' starts (up top) with:  "8,   6,   0,   0,   0,   0,   0,   0."    Moving to your cryptographic chair/position - those 6 '0s' describe 5 pixel (vertical) columns and the enforced 6th (blank) column.   (which again - prevents the individual font pixel characters from 'bleeding into' each other...)    The '8 & 6' are used by the font generator to properly create the '5x7 pixel font'  WITHIN  a '6x8' pixel cell.

    Cryptography informs/advises that: Scanning the, 'Known Character Field for: 'Simple/Minimal Pixel representations'  (- . _ |) or 'Symmetric Pixel representations' (" # H U) reasonably enables one to 'Crack' the individual 'weighting' of each pixel bit w/in each individual font column.    Recall that the individual column values are presented in sequence via the, 'Fixed6x8dData' array - which (again) includes one 'dummy  (blank)' column.

    Tag: 5x7 code ... alive & well ... although (apparently) unrecognized here...

  • Hi cb1,

      I learn so much from your post. I have no clue how to generate a 5x7 font or how any fonts are created until your excellent explanation. 

    Hi Jame,

      All the fonts that come with the TivaWare library will be in <TivaWare_Installation>/grlib/fonts. If you don't find the fonts you want in the library then you will need to either create your own with tips from cb1 or Google search public fonts that you can import to the library.  

  • Hi back, Charles,

    Thank you - your comment is (very) generous.   

    As our poster has (actually) presented the '5x7' font - might it have been that he (really) sought the (smaller) 5x5 Font?     

    And - in that case - crack/young staff have 'found' that (5x5) - which was (and is) employed by a gorgeous 'Siemens 5x5 Led, Multiple Character Matrix.'   (those multi-character, Led Modules - are as much (if not more) a, 'Work of Art' as compared to an 'electronic display'.   (They really POP - their 'downside' - they are 'Multiples of the Price' of equivalent Lcd character modules.)    We have deployed these in aircraft cockpits & various medical devices - where 'Superb Contrast & endless Viewing Angle' - are key (enforced) requirements.

    Several things deserve further mention:

    • Font table which poster presented is marked as, "uncompressed."    Staff here notes that this vendor (also) provides "compressed" font tables - which may drastically reduce the size (thus the memory requirements) - forced upon the application.
    • As my firm developed similar font tables (well prior to ARM) we worked most always w/'compressed fonts' - but unlike this vendor - stored our font data off chip (MCU!)    (i.e. in non-volatile serial memory)   As the MCU 'load time' was an order of magnitude higher then - this eased (actually enabled) the use of the MCU's (far smaller, then) internal memory to contain all of the Program Code.   (which the inclusion of the entire Font Table data (multiple fonts) would simply 'overwhelm!')    My firm (still) prefers to place such Font Table data & Calibration Values - off chip.
    • ASCII Tables usually reserve the lower 32 table entries for Control Codes & similar - which are (rarely) displayed.    (i.e. CR, LF, ESC etc.)
    • There exist (some) variation w/in the various font tables.    Usually they will be highly (yet not completely) consistent.
    • The 96th font entry (usually) serves as a 'Delete' - like the space - all column (or row) entries will be '0s.'
    • Some tables extend to the area above, '0x7F' (delete).   This space (0x80 - 0xFF) often provides 'foreign' characters & special symbols (primarily math based')

    Tag: (Almost) everything you wanted to know about Font Tables (especially those ASCII based).

  • Hello Charles

    Thank you for your reply

    Also,  thank you for Cb1's answer.

    I searched on Google and found the free of charge License, Oled-font-5x7 source code.

    By the way, I'm thinking about how to import.

    Compared to <TivaWare_Installation> / grlib / fonts / fontfixed6x8.c

    There is no offset for each character in the font

    What should I do?

    regards,

    Jame,Shin

    The source I found is below.

    https://github.com/noopkat/oled-font-5x7/blob/master/oled-font-5x7.js

  • Hello Jame,

      Why don't you first get the 6x8 font to display first? If you can get the 6x8 font to properly display then you can look on the display how each character is formed (their bit map) and compared with the 6x8 font table in the fontfixed6x8.c file. As well explained by cb1, a 5x7 font can be implemented/referenced from a 6x8 cell with the sixth column omitted. Get the 6x8 font to display first and change the 6x8 table by removing the sixth column for each character and see how they come out on the display. They may not appear as aesthetic  at first (i.e. characters have not spacing between them). But with some manipulation of the table data, you can get it to appear better. Or import the 5x7 font that you already fount on the web. However, I don't understand what offset you are referring to. I'm not an expert in the font generation. Please understand our support is mainly on using the MCU. As much as I'd like to support you, we cannot possibly understand every application the MCU can be put into. If you can get the 5x7 font to work, please do share with the community. It will be a bookmark for me to reference to others when asked in the future. I'm sure it will benefit many who are looking for the same solution. 

       

  • Jame shin said:
       There is no offset for each character in the font.   (fontfixed6x8.c)    What should I do?   

    May I disagree - just like the MCU's Vector Table (resident w/in the Start-Up file) - there   IS  very much an offset for each character!   (Minus that 'offset' how could the font data (or the vector's location) be determined?)

    You've specified a 'fixed font' - in which all  (visible) characters employ the identical pixel width & height.   Thus - the offset is regular - and determined by the character's 'Distance from the base' (usually 0x20 'the space character').   For example the numeric '0' character (0x30) is '0x10 (16 decimal) distant' from the 'starting' space character.  The offset to any character is that character's distance from the base (space) times the number of fixed values which constitute each font character.   (i.e. if the font is as your initial post revealed: (8,6,0,0,0,0,0,0, 8,6...) then each successive character is 8 memory locations (from its neighbor) or 8 * (character's table value - (minus) 0x20).    (where 'table value' is the number of characters appearing between 'space (0x20)' and the desired character.)   

    Some common 'font table value offsets' are:  '0' (0x30) Offset is 0x10; 'A' (0x41) Offset is 0x21; 'a' (ox61) Offset is 0x41.   Again - the table value offset must be multiplied by the number of 'fixed values' which define each character.   (which would be '8' in the example your initial post presented here.)

    Now such 'font fixed' characters 'suffer' in that the display space allotted to (i) is the same as that allotted to (W)!    Thus such fixed spacing is (both) wasteful & unattractive.   That reality led to the development of 'variable' sized characters - yet placed w/in the (same) font table.   (in such case - the 'W' character is far wider than the 'i'.)   And - as the size of characters is non-constant - the unique 'offset' for each/every character - must be specified...

    Vendor's Charles has duly noted that your questions/concerns have 'moved far' from 'MCU-Centric' - which (really) is outside the design intent of 'most any' MCU based forum.    It is noted that vendor agents have been (very) generous in devoting time & effort in your behalf!     And perhaps too - this humble forum outsider...

    'KISS' dictates that, 'Each of us be 'properly prepared' (prior) to accepting a new task.    You have (often) signaled your 'belief in KISS' - yet  does not your 'reach' often exceed your 'readiness'  (experience & present capability) - which can not always - end well...   Instead - might the 'high detail' you regularly seek (here) -  benefit from  'somewhat less challenging tech tasks'  AND the investigation of 'additional tech resources' - which may be better equipped (and chartered) - to meet your on-going (minimally MCU based) programming, electronic, & display (learning) requirements...

  • Hi cb1,

     LIKE! At first I thought the offset that Jame was talking about was the offset field shown below (0, 8,  16...). But I wasn't sure when I was replying.

    cb1_mobile said:
    The offset to any character is that character's distance from the base (space) times the number of fixed values which constitute each font character.

    I guess for 5x7, the offset will be (0, 7, 14, 21....).

    Cb1, thanks again.

  • Hi Charles,

    Thank you - and again - the amount of 'time/attention' devoted to this poster reveals great patience upon (especially) your part.    Earlier he described himself as a 'beginner' - yet the tasks he's attempting - prove 'FAR from those aimed at beginners!'     And - are only 'barely' MCU-centric - which forces vendor agents 'Away' from their central charter.  (purpose)

    Now - from experience - fonts may be 'creative in their pixel organization' - and sometimes aim to organize & present data in the 'optimal format required by the Display.'    (and/or the display's controller)

    In the case (just above) it must be noted that a '5x7 font' may be, 'Column or Row based.'    The font you've just listed clearly is 'Row based' - thus will be larger than one 'Character based.'    For example - if  'column-based'  each character may be represented by 'just' 5 bytes; if  'row-based' - that representation expands to 7 bytes.   (the use of the blank row/column 'separators' proves dependent upon the character generator which works in concert w/the font table.)

    While the difference proves nominal for 'so small a size font' - users must consider the implications of the, 'Column vs. Row' decision - when larger fonts (20-60+ pixel tall fonts) are employed.   These larger fonts greatly benefit from 'compression techniques' - and your firm imho has done very well in that regard!    (via the extensive number of fonts w/in the Graphic Library)

    My sense is that the offset (really is) '8' - as the comment in the font table specifies.    If '7' was used instead - the fetch of font data would become 'progressively Off' -  especially as the selected character resides 'deeper w/in the font table.'   (the font's 'character generator' (uses) the 'extra dead row' (in this case) to implement a 'proper surround'  (to insure separation) - between adjacent font characters...)

  • I am using the Kentec BOOSTXL-K350QVG-S1 320 x 240 display. It is a very nice display and the library supplied by TI is very useful.

    However I have noticed some characters are not displaying properly (e.g. "<", ">"). After reading the explanation of how the compressed font is encoded I have started modifying the table of the particular font I am using. I'll post some before and after pictures of the display for anyone interested in modifying their own font. 

    I also just wanted to say what a great product TI have made. I've used quite a few microcontrollers over the years and the LaunchPad series of boards (I have an EK-TM4C123GXL and EK-TM4C1294XL) and Code Composer Studio IDE are just awesome. I love how you can program in C and assembly and the way the whole thing is set out is very user friendly (auto-indent saves me a lot of time + many other nice features), and the online training material is of great help for hobbyists like myself. Also making it free of charge is pretty amazing, I remember not too long ago software like this was quite expensive. It still is (e.g. Keil - another great product but beyond reach for most hobbyists).  

    Keep up the great work TI!  

  • Hello Daniel,

    I saw your post well.

    Being helpful, I am also glad.

    I look forward to the results.

    regards,

    Jame,Shin

  • Hello Jame, 

    First I will show how to modify an existing font. Then we can try importing a new font using the utility provided by TI. The image below shows that "<" and ">" are not being rendered properly (on either side of "="). Other fonts I have tried also have this problem:

       

    In the next post I will show how to change the appearance of these characters. 

  • That's a nice job - well done.

    It is hoped that 'Jame' has recognized that  'you've produced & presented the (Far More Attractive) 'Variable Pixel Width' FONT' - not the 'Fixed Width Font' - which made up Jame's 5x7 Font - with which he, 'Launched this thread.'

    To those 'unclear and/or 'In doubt' - look at the 'Capital I and then Capital M' - or their lower case versions - then, 'Vive La Difference!'

    There IS a 'weakness' (my group believes) in vendor's implementation of these fonts - - they EAT Memory!    Long ago - on a planet far away - such Font Data resided, 'OFF MCU (and Program) in a 'more appropriate' Storage Medium!     Having to Load & Re-Load such bulk fonts - leads to Tens/possibly Hundreds - of LOST HOURS.    Such deserves consideration by user's here - does it not?   (REAL, QUAD EEProms - enable, ONE & DONE Font Loading - vastly speeding code up/down loads...)

    I would end w/Staff's advice to Jame - "While Fonts are intriguing - MANY OTHER MCU, Programming, & Electronic Elements - may prove, 'Higher Priority.'   

    Choosing which, 'Tasks to Engage' - proves an especially valuable skill - and is a major 'predictor of success'...

  • Thanks, but TI did the hard work. I just modified functions and font tables lifted from the graphics library. Without further ado, let's look at the example code, which is for the Kentec BOOSTXL-K350QVG-S1 display and EK-TM4C1294XL LaunchPad. First is main.c, followed by a module called LCD.c and finally font.c, which contains the font data and offsets. I have partially formatted the data array so you can see the encoding of each character:  

    //example program to display strings on the Kentec BOOSTXL-K350QVG-S1 320x240 display using the EK-TM4C1294XL LaunchPad
    
    //defines
    
    #define BlueColour  (((ClrBlue & 0x00f80000) >> 8) | ((ClrBlue & 0x0000fc00) >> 5) | ((ClrBlue & 0x000000f8) >> 3))
    #define RedColour   (((ClrRed & 0x00f80000) >> 8) | ((ClrRed & 0x0000fc00) >> 5) | ((ClrRed & 0x000000f8) >> 3))
    #define pageWidth   30
    
    //includes
    
    #include <stdint.h>
    #include <stdbool.h>
    
    #include "inc/hw_types.h"
    #include "inc/hw_memmap.h"
    
    #include "driverlib/debug.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/gpio.h"
    
    #include "grlib/grlib.h"
    #include "Kentec320x240x16_ssd2119_spi.h"
    
    //variables
    
    uint32_t fontColour;
    int16_t xCoordinate;
    int16_t yCoordinate;
    
    extern const uint8_t cmss20bData[2192];
    extern const uint32_t cmss20bOffset[95];
    
    uint8_t const *fontData = cmss20bData;
    uint32_t const *fontOffset = cmss20bOffset;
    
    //functions
    
    void init(void);
    void ClrDisp(void);
    void printString(char*);
    
    ///////////////////////////////////////////////////////////////////////////////
    
    int main(void) {
        init();                                                                    //your function to initialise the display and ports
        ClrDisp();                                                                 //your function to clear the display
    
        fontColour = BlueColour;
        xCoordinate = 0;
        yCoordinate = 0;
        printString("cmss20b font");
    
        fontColour = RedColour;
        xCoordinate = 0;
        yCoordinate += pageWidth;
        printString(" !\"#$%&'()*+,-./");
    
        xCoordinate = 0;
        yCoordinate += pageWidth;
        printString("0123456789:;<=>?@");
    
        xCoordinate = 0;
        yCoordinate += pageWidth;
        printString("ABCDEFGHIJKLMNOP");
    
        xCoordinate = 0;
        yCoordinate += pageWidth;
        printString("QRSTUVWXYZ[\\]^_`");
    
        xCoordinate = 0;
        yCoordinate += pageWidth;
        printString("abcdefghijklmnop");
    
        xCoordinate = 0;
        yCoordinate += pageWidth;
        printString("qrstuvwxyz{|}~");
        
        while (1) {        
        }
    }
    
    void init(void) {
    
    }
    
    void ClrDisp(void) {
    
    }
    

    //defines
    
    //*****************************************************************************
    //
    // Various internal SSD2119 registers name labels
    //
    //*****************************************************************************
    #define SSD2119_DEVICE_CODE_READ_REG  0x00
    #define SSD2119_OSC_START_REG         0x00
    #define SSD2119_OUTPUT_CTRL_REG       0x01
    #define SSD2119_LCD_DRIVE_AC_CTRL_REG 0x02
    #define SSD2119_PWR_CTRL_1_REG        0x03
    #define SSD2119_DISPLAY_CTRL_REG      0x07
    #define SSD2119_FRAME_CYCLE_CTRL_REG  0x0b
    #define SSD2119_PWR_CTRL_2_REG        0x0c
    #define SSD2119_PWR_CTRL_3_REG        0x0d
    #define SSD2119_PWR_CTRL_4_REG        0x0e
    #define SSD2119_GATE_SCAN_START_REG   0x0f
    #define SSD2119_SLEEP_MODE_1_REG      0x10
    #define SSD2119_ENTRY_MODE_REG        0x11
    #define SSD2119_SLEEP_MODE_2_REG      0x12
    #define SSD2119_GEN_IF_CTRL_REG       0x15
    #define SSD2119_PWR_CTRL_5_REG        0x1e
    #define SSD2119_RAM_DATA_REG          0x22
    #define SSD2119_FRAME_FREQ_REG        0x25
    #define SSD2119_ANALOG_SET_REG        0x26
    #define SSD2119_VCOM_OTP_1_REG        0x28
    #define SSD2119_VCOM_OTP_2_REG        0x29
    #define SSD2119_GAMMA_CTRL_1_REG      0x30
    #define SSD2119_GAMMA_CTRL_2_REG      0x31
    #define SSD2119_GAMMA_CTRL_3_REG      0x32
    #define SSD2119_GAMMA_CTRL_4_REG      0x33
    #define SSD2119_GAMMA_CTRL_5_REG      0x34
    #define SSD2119_GAMMA_CTRL_6_REG      0x35
    #define SSD2119_GAMMA_CTRL_7_REG      0x36
    #define SSD2119_GAMMA_CTRL_8_REG      0x37
    #define SSD2119_GAMMA_CTRL_9_REG      0x3a
    #define SSD2119_GAMMA_CTRL_10_REG     0x3b
    #define SSD2119_V_RAM_POS_REG         0x44
    #define SSD2119_H_RAM_START_REG       0x45
    #define SSD2119_H_RAM_END_REG         0x46
    #define SSD2119_X_RAM_ADDR_REG        0x4e
    #define SSD2119_Y_RAM_ADDR_REG        0x4f
    
    #define ENTRY_MODE_DEFAULT      0x6830
    #define MAKE_ENTRY_MODE(x)      ((ENTRY_MODE_DEFAULT & 0xff00) | (x))
    
    #define HORIZ_DIRECTION 0x30
    #define VERT_DIRECTION  0x38
    
    //*****************************************************************************
    //
    // Defines for the pins that are used to communicate with the SSD2119.
    //
    //*****************************************************************************
    
    #define LCD_CS_PERIPH           SYSCTL_PERIPH_GPIOP
    #define LCD_CS_BASE             GPIO_PORTP_BASE
    #define LCD_CS_PIN              GPIO_PIN_3
    
    #define LCD_DC_PERIPH           SYSCTL_PERIPH_GPIOP
    #define LCD_DC_BASE             GPIO_PORTP_BASE
    #define LCD_DC_PIN              GPIO_PIN_4
    
    #define LCD_RST_PERIPH          SYSCTL_PERIPH_GPIOK
    #define LCD_RST_BASE            GPIO_PORTK_BASE
    #define LCD_RST_PIN             GPIO_PIN_6
    
    #define LCD_LED_PERIPH          SYSCTL_PERIPH_GPIOG
    #define LCD_LED_BASE            GPIO_PORTG_BASE
    #define LCD_LED_PIN             GPIO_PIN_1
    
    //*****************************************************************************
    //
    // Defines for the SSI controller and pins that are used to communicate with
    // the SSD2119.
    //
    //*****************************************************************************
    #define LCD_SSI_PERIPH          SYSCTL_PERIPH_SSI3
    #define LCD_SSI_BASE            SSI3_BASE
    
    #define LCD_SSI_GPIO_PERIPH     SYSCTL_PERIPH_GPIOQ
    #define LCD_SSI_GPIO_BASE       GPIO_PORTQ_BASE
    #define LCD_SSI_CLK_CFG         GPIO_PQ0_SSI3CLK
    #define LCD_SSI_TX_CFG          GPIO_PQ2_SSI3XDAT0
    #define LCD_SSI_CLK_PIN         GPIO_PIN_0
    #define LCD_SSI_TX_PIN          GPIO_PIN_2
    
    //includes
    
    #include <stdint.h>
    #include <stdbool.h>
    #include "inc/hw_gpio.h"
    #include "inc/hw_ints.h"
    #include "inc/hw_memmap.h"
    #include "inc/hw_types.h"
    #include "driverlib/ssi.h"
    #include "driverlib/gpio.h"
    #include "driverlib/interrupt.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/timer.h"
    #include "driverlib/rom.h"
    #include "driverlib/pin_map.h"
    #include "grlib/grlib.h"
    #include "drivers/Kentec320x240x16_ssd2119_spi.h"
    
    //variables
    
    extern uint32_t fontColour;
    extern int16_t xCoordinate;
    extern int16_t yCoordinate;
    
    extern uint8_t const *fontData;
    extern uint32_t const *fontOffset;
    
    //functions
    
    void WriteCommandSPI2(uint16_t);
    void WriteDataSPI2(uint16_t);
    void PixelDrawFast(int32_t, int32_t, uint32_t);
    void LineDrawH(int32_t, int32_t, int32_t, uint32_t);
    
    void printString(char*);
    void printCharacter(char);
    
    ///////////////////////////////////////////////////////////////////////////////
    
    void WriteCommandSPI2(uint16_t ui16Data) {
        uint16_t pui16Data[2];
    
        //
        // Write the most significant byte of the data to the bus.
        //
        pui16Data[0] = 0;
    
        //
        // Write the least significant byte of the data to the bus.
        //
        pui16Data[1] = ui16Data;
    
        GPIOPinWrite(LCD_DC_BASE, LCD_DC_PIN, 0);
        GPIOPinWrite(LCD_CS_BASE, LCD_CS_PIN, 0);
    
        SSIDataPut(LCD_SSI_BASE, pui16Data[0]);
        SSIDataPut(LCD_SSI_BASE, pui16Data[1]);
    
        //
        // Wait until SSI0 is done transferring all the data in the transmit FIFO.
        //
        while(SSIBusy(LCD_SSI_BASE)){ }
    
        GPIOPinWrite(LCD_CS_BASE, LCD_CS_PIN, LCD_CS_PIN);
    }
    
    void WriteDataSPI2(uint16_t ui16Data) {
        uint16_t pui16Data[2];
    
        //
        // Write the most significant byte of the data to the bus.
        //
        pui16Data[0] = (ui16Data >> 8);
    
        //
        // Write the least significant byte of the data to the bus.
        //
        pui16Data[1] = ui16Data;
    
        GPIOPinWrite(LCD_DC_BASE, LCD_DC_PIN, LCD_DC_PIN);
        GPIOPinWrite(LCD_CS_BASE, LCD_CS_PIN, 0);
    
        SSIDataPut(LCD_SSI_BASE, pui16Data[0]);
        SSIDataPut(LCD_SSI_BASE, pui16Data[1]);
    
        //
        // Wait until SSI0 is done transferring all the data in the transmit FIFO.
        //
        while(SSIBusy(LCD_SSI_BASE)){ }
    
        GPIOPinWrite(LCD_CS_BASE, LCD_CS_PIN, LCD_CS_PIN);
    }
    
    void PixelDrawFast(int32_t i32X,int32_t i32Y,uint32_t ui32Value) {
        //
        // Set the X address of the display cursor.
        //
        WriteCommandSPI2(SSD2119_X_RAM_ADDR_REG);
        WriteDataSPI2(i32X);
    
        //
        // Set the Y address of the display cursor.
        //
        WriteCommandSPI2(SSD2119_Y_RAM_ADDR_REG);
        WriteDataSPI2(i32Y);
    
        //
        // Write the pixel value.
        //
        WriteCommandSPI2(SSD2119_RAM_DATA_REG);
        WriteDataSPI2(ui32Value);
    }
    
    void LineDrawH(int32_t i32X1, int32_t i32X2, int32_t i32Y, uint32_t ui32Value)
    {
        //
        // Set the cursor increment to left to right, followed by top to bottom.
        //
        WriteCommandSPI2(SSD2119_ENTRY_MODE_REG);
        WriteDataSPI2(MAKE_ENTRY_MODE(HORIZ_DIRECTION));
    
        //
        // Set the starting X address of the display cursor.
        //
        WriteCommandSPI2(SSD2119_X_RAM_ADDR_REG);
        WriteDataSPI2(i32X1);
    
        //
        // Set the Y address of the display cursor.
        //
        WriteCommandSPI2(SSD2119_Y_RAM_ADDR_REG);
        WriteDataSPI2(i32Y);
    
        //
        // Write the data RAM write command.
        //
        WriteCommandSPI2(SSD2119_RAM_DATA_REG);
    
        //
        // Loop through the pixels of this horizontal line.
        //
        while(i32X1++ <= i32X2)
        {
            //
            // Write the pixel value.
            //
            WriteDataSPI2(ui32Value);
        }
    }
    
    
    
    void printString(char* string) {
        while (*(string)) {
            printCharacter(*(string));
            xCoordinate += fontData[fontOffset[*string - 32] + 1];
            string++;
        }
    }
    
    void printCharacter(char z) {
    
        int32_t i32Idx, i32X0, i32Y0, i32Count, i32Off, i32On, i32Bit;
        int32_t i32ClipX1, i32ClipX2;
    
        //
        // Loop through the bytes in the encoded data for this glyph.
        //
        for(i32Idx = 2, i32X0 = 0, i32Bit = 0, i32Y0 = 0; i32Idx < fontData[fontOffset[z - 32]];)
        {
            //The font is compressed with a pixel RLE scheme.
    
            //
            // See if this is a byte that encodes some on and off pixels.
            //
            if(fontData[fontOffset[z - 32] + i32Idx])
            {
                //
                // Extract the number of off pixels.
                //
                i32Off = (fontData[fontOffset[z - 32] + i32Idx] >> 4) & 15;
    
                //
                // Extract the number of on pixels.
                //
                i32On = fontData[fontOffset[z - 32] + i32Idx] & 15;
    
                //
                // Skip past this encoded byte.
                //
                i32Idx++;
            }
    
            //
            // Otherwise, see if this is a repeated on pixel byte.
            //
            else if(fontData[fontOffset[z - 32] + i32Idx + 1] & 0x80)
            {
                //
                // There are no off pixels in this encoding.
                //
                i32Off = 0;
    
                //
                // Extract the number of on pixels.
                //
                i32On = (fontData[fontOffset[z - 32] + i32Idx + 1] & 0x7f) * 8;
    
                //
                // Skip past these two encoded bytes.
                //
                i32Idx += 2;
            }
    
            //
            // Otherwise, this is a repeated off pixel byte.
            //
            else
            {
                //
                // Extract the number of off pixels.
                //
                i32Off = fontData[fontOffset[z - 32] + i32Idx + 1] * 8;
    
                //
                // There are no on pixels in this encoding.
                //
                i32On = 0;
    
                //
                // Skip past these two encoded bytes.
                //
                i32Idx += 2;
            }
    
            //
            // Loop while there are any off pixels.
            //
            while(i32Off)
            {
                //
                // See if there is more than one off pixel that will fit onto
                // the current row.
                //
                if((i32Off > 1) && ((i32X0 + 1) < fontData[fontOffset[z - 32] + 1]))
                {
                    //
                    // Determine the number of off pixels that will fit on this
                    // row.
                    //
                    i32Count = (((i32X0 + i32Off) > fontData[fontOffset[z - 32] + 1]) ?
                            fontData[fontOffset[z - 32] + 1] - i32X0 : i32Off);
    
                    //i32ClipX1 = xCoordinate + i32X0;                                     //Commented out - do not draw off pixels ->
                    //i32ClipX2 = xCoordinate + i32X0 + i32Count - 1;
                    //LineDrawH(i32ClipX1, i32ClipX2, yCoordinate + i32Y0, backgroundfontColour);//<-
    
                    //
                    // Decrement the count of off pixels by the number on this
                    // row.
                    //
                    i32Off -= i32Count;
    
                    //
                    // Increment the X offset by the number of off pixels.
                    //
                    i32X0 += i32Count;
                }
    
                //
                // Otherwise, there is only a single off pixel that can be
                // drawn.
                //
                else
                {
                    //PixelDrawFast(xCoordinate + i32X0, yCoordinate + i32Y0, backgroundfontColour); //Commented out - do not draw off pixels
    
                    //
                    // Decrement the count of off pixels.
                    //
                    i32Off--;
    
                    //
                    // Increment the X offset.
                    //
                    i32X0++;
                }
    
                //
                // See if the X offset has reached the right side of the
                // character glyph.
                //
                if(i32X0 == fontData[fontOffset[z - 32] + 1])
                {
                    //
                    // Increment the Y offset.
                    //
                    i32Y0++;
    
                    //
                    // Reset the X offset to the left side of the character
                    // glyph.
                    //
                    i32X0 = 0;
                }
            }
    
            //
            // Loop while there are any on pixels.
            //
            while(i32On)
            {
                //
                // See if there is more than one on pixel that will fit onto
                // the current row.
                //
                if((i32On > 1) && ((i32X0 + 1) < fontData[fontOffset[z - 32] + 1]))
                {
                    //
                    // Determine the number of on pixels that will fit on this
                    // row.
                    //
                    i32Count = (((i32X0 + i32On) > fontData[fontOffset[z - 32] + 1]) ?
                            fontData[fontOffset[z - 32] + 1] - i32X0 : i32On);
    
                    i32ClipX1 = xCoordinate + i32X0;
    
                    i32ClipX2 = xCoordinate + i32X0 + i32Count - 1;
    
                    LineDrawH(i32ClipX1, i32ClipX2, yCoordinate + i32Y0, fontColour);
    
                    //
                    // Decrement the count of on pixels by the number on this
                    // row.
                    //
                    i32On -= i32Count;
    
                    //
                    // Increment the X offset by the number of on pixels.
                    //
                    i32X0 += i32Count;
                }
    
                //
                // Otherwise, there is only a single on pixel that can be
                // drawn.
                //
                else
                {
                    PixelDrawFast(xCoordinate + i32X0, yCoordinate + i32Y0, fontColour);
    
                    //
                    // Decrement the count of on pixels.
                    //
                    i32On--;
    
                    //
                    // Increment the X offset.
                    //
                    i32X0++;
                }
    
                //
                // See if the X offset has reached the right side of the
                // character glyph.
                //
                if(i32X0 == fontData[fontOffset[z - 32] + 1])
                {
                    //
                    // Increment the Y offset.
                    //
                    i32Y0++;
    
                    //
                    // Reset the X offset to the left side of the character
                    // glyph.
                    //
                    i32X0 = 0;
                }
            }
        }
    }
    
    

    //includes
    
    #include <stdint.h>
    
    //variables
    
    const uint8_t cmss20bData[2192] =
    {
     5,   9,   0,  23,  80, //offset 0 - space
     17,   5, 163,  35,  35,  35,  35, 35,  35,  35,  35,  35, 115,  35,  35, 240, 192, //5 - exclamation
     16,   9, 240,  51,  19,  35,  19, 35,  19,  49,  49,  50,  34,   0,  16,  16, //22 - quotation
     //38 - hash
     42,  18, 240, 240, 210,  49, 194, 49, 193,  50, 178,  50, 178,  50, 178,  49, 111,   1,  47,   1, 114,  49, 193,  50, 127,   1,  47,   1,
     97,  50, 178,  50, 178,  50, 178, 49, 193,  50, 193,  50, 240, 192,
     //80 - dollar
     30,  11,  65, 161, 134,  72,  35, 17,  34,  35,  17,  99,  17, 101, 118, 102, 117,  97,  19,  97,  19,  34,  33,  19,  40,  85, 129,   0,
     6,  32,
     //110 - percent
     47,  21, 240, 132, 130, 102,  99, 83,  35,  82,  99,  35,  66, 115,  35,  50, 131,  35,  35, 131,  35,  34, 166,  34, 240,  50, 240,  50,
     54, 147,  35,  35, 130,  51,  35,114,  67,  35,  98,  83,  35,  83, 102,  98, 132,   0,  11,
     //157 - ampersand
     35,  17, 240, 240, 132, 194,  35,147,  35, 147,  35, 147,  34, 163,  18,  66, 100,  82,  99,  98,  70,  66,  67,  35,  35,  67,  39,  83,
     53, 111,  69,  53,   0,  10, 112,
    
     10,   5, 163,  35,  35,  49,  50,   0,   9,  16,                              //192 - apostrophe
     24,   8,  66,  82,  82,  98,  83,  82,  83,  83,  83,  83,  83,  83,  83,  83,  83,  98,  99,  98,  98, 114, 114,  32, //202 - left parenthesis
     24,   8,   2, 114, 114,  98,  99,  98,  99,  83,  83,  83,  83,  83,  83,  83,  83,  82,  83,  82,  98,  82,  82,  96, //226 - right parenthesis
     23,  11,  51, 131,  82,  19,  18,  35,  17,  19,  69, 101,  67,  17,  19,  34,  19,  18,  83, 131,   0,  15,  96,  //250 - asterix
     21,  16,   0,   6,  98, 226, 226, 226, 226, 226, 226, 142,  46, 130, 226, 226, 226, 226, 226,   0,   7, //273 - plus
     11,   5,   0,   8,  19,  35,  35,  49,  50, 240,  48, // - comma
     9,   8,   0,  10,   6,  38,   0,   9,  32, // - minus
     9,   5,   0,   8,  19,  35,  35, 240, 192, // - period
     24,  10, 113, 130, 130, 129, 130, 130, 129, 130, 130, 114, 130, 130, 114, 130, 129, 130, 130, 129, 130, 130, 129, 144, // - forward slash
     // - 0
     32,  11, 240, 149,  83,  19,  66,  50,  51,  51,  35,  51,  35,  51,  35,  51,  35,  51,  35,  51,  35,  51,  35,  51,  50,  50,  67,  19,  85,   0,   7,  48,
     20,  10, 240, 146,  70, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,  87,   0,   6,  64, // - 1
     22,  11, 240, 148, 103,  50,  52,  34,  67, 131, 131, 115, 131, 115, 114, 130, 130, 137,  41,   0,   7,  16, // - 2
     22,  11, 240, 164,  87,  66,  50, 146, 131, 100, 116, 162, 147, 131, 131,  34,  67,  55,  85,   0,   7,  48, // - 3
     25,  12, 240, 212, 132, 117, 113,  19,  98,  19,  97,  35,  82,  35,  66,  51,  66,  51,  74,  42, 115, 147, 147,   0,   8, // - 4
     22,  11, 240, 135,  71,  67, 131, 131, 134,  87,  67,  35, 131, 131, 131,  34,  67,  55,  85,   0,   7,  48, // - 5
     27,  11, 240, 164, 101,  83, 115, 131,  19,  72,  52,  35,  35,  51,  35,  51,  35,  51,  35,  51,  51,  35,  55,  85,   0,   7,  48, // - 6
     20,  11, 240, 121,  41, 130, 131, 130, 131, 130, 131, 131, 115, 131, 131, 131, 131,   0,   7,  80, // - 7
     28,  11, 240, 149,  87,  51,  51,  35,  51,  35,  51,  55,  85,  82,  50,  51,  51,  35,  51,  35,  51,  35,  51,  55,  85,   0,   7,  48, // - 8
     27,  11, 240, 149,  87,  51,  50,  51,  51,  35,  51,  35,  51,  35,  51,  35,  36,  56,  67,  19, 131, 115,  70, 100,   0,   7,  64, // - 9
     13,   5, 240, 240,  83,  35,  35, 240,  35,  35,  35, 240, 192, // - colon
     15,   5, 240, 240,  83,  35,  35, 240,  35,  35,  35,  49,  50, 240,  48, // - semicolon
     18,   5, 240, 243,  35,  35,  35,  35,  35,  35,  35,  35,  35,  35,  35,  35,  35, 112, // - less than
     13,  16,   0,  16,  14,  46, 240, 240,  78,  46,   0,  14,  32, // - equal
     20,  10,   0,   7,  99, 115, 115, 115, 115, 115, 115,  99, 114, 115, 114, 130, 130,  66,  54, 208, // - greater than
     21,  10, 240,  87,  50,  51, 115, 115,  99,  99, 115,  99, 115, 115, 240,  35, 115, 115,   0,   6, 112, // - question mark
     // - at
     39,  15, 240, 240,  71, 100,  51,  67,  38,  67,  24,  35,  20,  20,  35,  19,  51,  35,  19,  51,  35,  19,  51,  35,  19,  51,  35,  20,  20,  51,  23,  67,
     37, 100,  67, 103,   0,   9, 112,
    
     29,  15, 240, 240,  68, 181, 165, 150, 146,  35, 115,  35, 115,  35, 114,  67,  83,  67,  90,  91,  51,  99,  51,  99,  50, 131,   0,   9,  80, // - A
     28,  13, 240, 184,  90,  51,  67,  51,  82,  51,  67,  51,  67,  57,  73,  67,  67,  51,  83,  35,  83,  35,  68,  42,  57,   0,   8,  80, // - B
     23,  14, 240, 240,  39,  89,  68,  81,  67, 163, 179, 179, 179, 179, 179, 195, 180,  82,  74, 102,   0,   9,  32, // - C
     30,  14, 240, 217,  90,  67,  68,  51,  83,  51,  99,  35,  99,  35,  99,  35,  99,  35,  99,  35,  99,  35,  83,  51,  68,  58,  73,   0,   9,  48, // - D
     20,  12, 240, 154,  42,  35, 147, 147, 147, 153,  57,  51, 147, 147, 147, 154,  42,   0,   7,  96, // - E
     20,  11, 240,
     121,  41,  35, 131, 131, 131, 136,  56,  51, 131, 131, 131,
     131, 131,   0,   7, 112,  27,  14, 240, 240,  39,  90,  52,
     82,  51, 113,  35, 179, 179, 179, 179,  69,  35,  69,  51,
     83,  52,  67,  74, 103,   0,   9,  16,  31,  14, 240, 211,
     99,  35,  99,  35,  99,  35,  99,  35,  99,  35,  99,  44,
     44,  35,  99,  35,  99,  35,  99,  35,  99,  35,  99,  35,
     99,   0,   9,  18,   5, 163,  35,  35,  35,  35,  35,  35,
     35,  35,  35,  35,  35,  35,  35, 240, 192,  21,  10, 240,
     163, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,  49,
     51,  39,  69,   0,   6,  96,  31,  14, 240, 211,  99,  35,
     83,  51,  67,  67,  51,  83,  35,  99,  19, 119, 120, 100,
     35,  83,  67,  67,  67,  67,  83,  51,  99,  35, 114,   0,
     9,  20,  11, 240, 115, 131, 131, 131, 131, 131, 131, 131,
     131, 131, 131, 131, 137,  41,   0,   7,  16,  51,  18, 240,
     240, 100, 132,  37, 101,  37, 101,  37, 101,  35,  18,  66,
     19,  35,  18,  66,  19,  35,  18,  66,  19,  35,  34,  34,
     35,  35,  34,  34,  35,  35,  34,  34,  35,  35,  52,  51,
     35,  52,  51,  35,  52,  51,  35,  66,  67,   0,  11,  64,
     39,  14, 240, 212,  83,  37,  67,  37,  67,  38,  51,  35,
     18,  51,  35,  18,  51,  35,  34,  35,  35,  34,  35,  35,
     50,  19,  35,  50,  19,  35,  54,  35,  69,  35,  69,  35,
     84,   0,   9,  30,  15, 240, 240,  70, 121,  84,  52,  67,
     83,  51, 115,  35, 115,  35, 115,  35, 115,  35, 115,  35,
     115,  51,  83,  68,  52,  89, 119,   0,  10,  25,  13, 240,
     185,  74,  51,  68,  35,  83,  35,  83,  35,  83,  35,  68,
     42,  57,  67, 163, 163, 163, 163,   0,   9,  48,  32,  15,
     240, 240,  70, 121,  84,  52,  67,  83,  51, 115,  35, 115,
     35, 115,  35, 115,  35, 115,  35, 115,  51,  38,  68,  37,
     89, 120, 195, 211,   0,   6,  30,  13, 240, 185,  74,  51,
     68,  35,  83,  35,  83,  35,  68,  42,  56,  83,  35,  83,
     51,  67,  66,  67,  67,  51,  82,  51,  83,   0,   8,  48,
     22,  12, 240, 182,  88,  51,  66,  51, 147, 150, 119, 103,
     148, 147,  33,  99,  34,  83,  41,  86,   0,   8,  20,  15,
     240, 253,  45, 115, 195, 195, 195, 195, 195, 195, 195, 195,
     195, 195, 195,   0,  10,  32,  32,  13, 240, 179,  83,  35,
     83,  35,  83,  35,  83,  35,  83,  35,  83,  35,  83,  35,
     83,  35,  83,  35,  83,  35,  83,  51,  52,  57, 101,   0,
     8,  96,  31,  15, 240, 242, 131,  35, 115,  35,  99,  67,
     83,  67,  82,  83,  67,  99,  51,  99,  50, 115,  35, 131,
     19, 131,  18, 150, 165, 164,   0,  10,  32,  51,  22, 240,
     240, 227,  99,  98,  50,  84,  83,  51,  68,  82,  67,  69,
     66,  67,  51,  18,  66,  82,  50,  34,  51,  83,  34,  35,
     34,  99,  34,  35,  34, 114,  19,  50,  19, 114,  18,  66,
     19, 117,  69, 133,  69, 148,  84, 147,  99,   0,  14,  64,
     29,  15, 240, 244,  83,  67,  67,  99,  51, 100,  19, 134,
     165, 179, 181, 165, 147,  19, 115,  51,  84,  52,  67,  83,
     51, 115,   0,   9,  80,  26,  15, 240, 243, 115,  36,  99,
     51,  83,  83,  51, 100,  20, 115,  19, 149, 165, 179, 195,
     195, 195, 195, 195,   0,  10,  32,  20,  13, 240, 187,  43,
     147, 148, 147, 147, 147, 163, 147, 147, 147, 163, 155,  43,
     0,   8,  48,  23,   7, 117,  37,  35,  67,  67,  67,  67,
     67,  67,  67,  67,  67,  67,  67,  67,  67,  67,  67,  69,
     37,  32,  16,  10, 240,  98,  50,  49,  65,  51,  35,  35,
     35,  35,  35,   0,  17,  96,  23,   7, 117,  37,  67,  67,
     67,  67,  67,  67,  67,  67,  67,  67,  67,  67,  67,  67,
     67,  67,  37,  37,  32,  11,   8, 240,  51,  66,  18,  34,
     49,   0,  16,  32,   7,   5, 163,  35,   0,  10, 112,   9,
     5, 178,  49,  51,  35,  35,   0,   9,  20,  10,   0,   8,
     118,  65,  51, 115, 115,  55,  35,  35,  35,  35,  35,  35,
     55,   0,   6,  64,  26,  12, 240, 147, 147, 147, 147, 147,
     152,  67,  51,  51,  67,  35,  67,  35,  67,  35,  67,  35,
     67,  35,  51,  56,   0,   8,  18,  10,   0,   9,   5,  71,
     35,  65,  35, 115, 115, 116,  49,  55,  69,   0,   6,  80,
     27,  11, 240, 211, 131, 131, 131, 131,  71,  51,  35,  35,
     51,  35,  51,  35,  51,  35,  51,  35,  51,  51,  35,  71,
     0,   7,  16,  20,  11,   0,   9, 117,  83,  34,  51,  51,
     35,  51,  41,  35, 131, 147,  50,  70,   0,   7,  32,  20,
     9, 240, 100,  51,  99,  99,  99,  86,  67,  99,  99,  99,
     99,  99,  99,  99,   0,   6,  32,  24,  11,   0,   9, 104,
     35,  34,  67,  34,  67,  34,  86,  70,  82, 152,  72,  34,
     82,  34,  82,  35,  51,  70, 224,  29,  11, 240, 115, 131,
     131, 131, 131, 131,  20,  52,  35,  35,  51,  35,  51,  35,
     51,  35,  51,  35,  51,  35,  51,  35,  51,   0,   7,  16,
     16,   5, 163,  35,  35, 195,  35,  35,  35,  35,  35,  35,
     35,  35, 240, 192,  21,   8, 240,  67,  83,  83, 240,  99,
     83,  83,  83,  83,  83,  83,  83,  83,  83,  83,  38,  52,
     176,  26,  11, 240, 115, 131, 131, 131, 131, 131,  51,  35,
     35,  51,  19,  70,  86,  87,  67,  35,  51,  50,  51,  51,
     0,   7,  16,  18,   5, 163,  35,  35,  35,  35,  35,  35,
     35,  35,  35,  35,  35,  35,  35, 240, 192,  34,  17,   0,
     14, 115,  20,  36,  52,  36,  35,  35,  51,  51,  35,  51,
     51,  35,  51,  51,  35,  51,  51,  35,  51,  51,  35,  51,
     51,  35,  51,  51,   0,  10, 112,  25,  11,   0,   9,  83,
     20,  52,  35,  35,  51,  35,  51,  35,  51,  35,  51,  35,
     51,  35,  51,  35,  51,   0,   7,  16,  22,  11,   0,   9,
     117,  82,  50,  51,  51,  35,  51,  35,  51,  35,  51,  35,
     51,  55,  85,   0,   7,  48,  26,  12,   0,  10,  67,  20,
     73,  51,  52,  35,  67,  35,  67,  35,  67,  35,  67,  35,
     51,  56,  67, 147, 147, 147, 240,  96,  25,  11,   0,   9,
     115,  19,  56,  36,  35,  35,  51,  35,  51,  35,  51,  35,
     51,  51,  35,  71, 131, 131, 131, 131, 208,  17,   8,   0,
     7,   3,  18,  38,  36,  67,  83,  83,  83,  83,  83, 240,
     240, 240,  17,   9,   0,   8,   6,  34,  50,  34, 117,  86,
     114,  34,  50,  39,  53,   0,   6,  19,   9, 240, 240, 115,
     99,  99,  87,  51,  99,  99,  99,  99,  99,  33,  54,  68,
     0,   6,  25,  11,   0,   9,  83,  51,  35,  51,  35,  51,
     35,  51,  35,  51,  35,  51,  35,  51,  35,  36,  52,  19,
     0,   7,  16,  23,  11,   0,   9,  82,  82,  35,  51,  50,
     50,  66,  50,  67,  19,  82,  18,  98,  18, 101, 115,   0,
     7,  64,  33,  16,   0,  14,   2,  66,  66,  35,  50,  51,
     50,  36,  34,  66,  33,  18,  34,  67,  17,  18,  19,  69,
     18,  19,  84,  21,  99,  52,  99,  52,   0,  10,  64,  22,
     11,   0,   9,  83,  51,  51,  19,  82,  18, 115, 131, 117,
     98,  18,  82,  50,  51,  66,   0,   7,  16,  24,  11,   0,
     9,  82,  82,  35,  51,  50,  50,  67,  19,  82,  19,  85,
     116, 116, 130, 146, 130, 101, 100, 240,  48,  16,  10,   0,
     8, 104, 115,  99,  99, 114, 115,  99,  99, 120,   0,   6,
     64,   9,  13,   0,  14,  91,  43,   0,  16,  64,  11,  24,
     0,  27,  15,   7,  47,   7,   0,  30,  32,  12,   9, 240,
     51,  19,  34,  34,  50,  33,   0,  18,  64,  11,   9, 240,
     67,  33,  39,  33,  35,   0,  18,  48
    };
    
    const uint32_t cmss20bOffset[95] =
    {
     0,    5,   22,   38,   80,  110,  157,  192,
     202,  226,  250,  273,  294,  305,  314,  323,
     347,  379,  399,  421,  443,  468,  490,  517,
     537,  565,  592,  605,  620,  638,  651,  671,
     692,  731,  760,  788,  811,  841,  861,  881,
     908,  939,  957,  978, 1009, 1029, 1080, 1119,
     1149, 1174, 1206, 1236, 1258, 1278, 1310, 1341,
     1392, 1421, 1447, 1467, 1490, 1506, 1529, 1540,
     1547, 1556, 1576, 1602, 1620, 1647, 1667, 1687,
     1711, 1740, 1756, 1777, 1803, 1821, 1855, 1880,
     1902, 1928, 1953, 1970, 1987, 2006, 2031, 2054,
     2087, 2109, 2133, 2149, 2158, 2169, 2181
    };
    

     

    
    

     O.K., that's a lot of code. How does it work? The first few lines of main set the coordinates to the top left corner of the screen and call printString. This is your typical display function that sends the characters that make up the string to printCharacter until the end of the string is reached. 

    printCharacter is where all the action takes place. This function is a stripped down version of the function that displays characters in the graphics library. The function in the library displays fonts in both uncompressed and compressed formats, and enables the user to draw "off" pixels as well as "on" pixels. I deleted the uncompressed format and "off" pixel drawing option, as well as clipping region checks for brevity, and fixed a few typos in the comments.   

    The easiest way to understand it is of course to step through the code after reading the explanation of the RLE compressed font encoding in the TivaWare graphics library manual, but in a nutshell it runs through the bytes from the 2nd byte in the encoding for that particular character (the first byte being the 0th byte) to the last byte in the encoding (the 0th byte gives the total length of the encoding and the 1st byte the width of the character in pixels). If the byte is 0x00 then the following byte gives the number of repeated on or off pixels, otherwise the byte encodes on and/or off pixels. 

    The functions LineDrawH and PixelDrawFast are then called to draw the pixels on the display. Note that the pixels are drawn from left to right and top to bottom. 

    In the next post I'll discuss the changes made to the encodings for "<" and ">" and show the results on the display.  

     

     

     

     

  • Hello Daniel,

    Thank you for your reply

    You used the grlib / fonts / fontcmss20b font.

    I have displayed the grlib / fonts / fontfixed6x8 font in a widget list box.

    The characters you are worried about are displayed “<“ and “>”.

    I have a fixed size horizontally and vertically.

    The reason for using the fixed type is to display line feed control and display many characters in small display resolution (96x64).

    I needed a smaller font size. So I was interested in attempting to change to 5x7 or 5x6 size.

    I'm a user of Keil Tools. And I am uncomfortable not knowing Assemly Language.

    Q1> Why do you want to change to a variable font size with Display Resolution (320 x 240) which is 9 times bigger than me?

           The use of C and Assembly Language is better for CCS than Keil, and seems to have more experience with font specification information. !!

           I would like to see a small font change with your QVGA Display.

    Q2> Daniel previous Post> “I'll post some before and after pictures of the display for anyone interested in modifying their own font.”

           I was interested. Can you help me fix 5x7 or 5x6 if possible?

    regards,

    Jame,Shin

    P.s  :  I wrote my post and saw the post, but there is Daniel's Post. !

              I didn't have Daniel's Post before writing Post.

  • @ Daniel,

    Proceed w/'Caution' my friend...    Otherwise - you too - will be the recipient of a, 'Devil Pumpkin' - which (somehow) remarkably resembles you!   (Up till the time it 'prematurely ages' - and becomes (at least in my case) even more grotesque!)

    @ Jame,

    Posts far past here described 'Siemens Use of a 5x5 Font' - the '5x6' you now propose is non-standard!    Note too - that 'ODD FONT HEIGHT' (in pixels) was 'DELIBERATE!'    Can you 'reason' why?

  • Hello Jame, 

    Interesting, the two compressed fonts I tried have the problem with "<" and ">".

    I would strongly recommend you try to compile and upload the example code I provided. Doesn't matter if you are using Keil. You may need to make changes to the definitions and code depending on the hardware you are using. 

    The reason is because the font tables in the library are generated using the ftrasterize utility and any changes to the tables made by the user have no effect. 

    Also, any new fonts you import will first need to be encoded in either the uncompressed format or (using ftrasterize) the compressed format.

    The ftrasterize executable is located in tools/bin in TivaWare.

    If you don't encode your new font in one of these formats then the display will show garbage (unless you want to write your own display functions). 

     

      

     

  • Hello cb1_mobile, 

    This is inevitable I think. The best I can do now is try to prepare myself for when that day comes. 

  • Hello Daniel,

    Thank you for your reply

    I have displayed the characters < > / & # $ in [Fig-2].

    I also have the same < to i, > to ¿ mark . Fontcmss22b (23x22) seems to be a font problem.

    I compared the source code you modified and the original font file.

    The comparison is the same.

    Q1> What did you try to show by modifying the source code?

    Q2-1> How did you know how to identify special characters in the font source code you distributed?

       //offset 0 – space, //38 - hash , //80 – dollar, //110 – percent, //157 – ampersand, //192 – apostrophe

       //202 - left parenthesis, //226 - right parenthesis , //250 - asterix , //273 – plus, // - comma, // - minus

       // - period, // - forward slash , // - 0 , // - 1 , // - 2 , // - 4, // - 5 , // - 6, // - 7 , // - 8 , // - 9 , // - colon

       // - semicolon, // - less than , // - equal , // - greater than , // - question mark , // - A, // - B , // - C , // - D ,

       // - E

    Q2-2> In the comment “Offset n – description“, offset 0, 38, 80, 110, 157,… How did you know and mark it?

    Q2-3> The section of “//-forward slash” is empty in the comment. Didn't find it?

    Q2-4> There is no indication from alphabet F to Z. Did you take a lot of time to stop?

             I Feel your patience to make a distinction.

    Q3> Why is the following code missing in your source code with reference to [Fig3.]?

            There is the original font Source code

    //*****************************************************************************

    // The font definition for the 22 point Cmss bold font.

    //*****************************************************************************

    const tFont g_sFontCmss22b =

    {

        // The format of the font.

        FONT_FMT_PIXEL_RLE,

        // The maximum width of the font.

        23,

        // The height of the font.

        22, 

        // The baseline of the font.

        17,

    Q4> Original font The comment in the FontCmss22b file “The offset to each character in the font.” What format is the data written in?

    - The end -

     

    Hello Cb1,

           Cb1 Said > Can you 'reason' why?

             A> I am worried about the readability of 5x5 characters. As a result of testing , I finally need a 5x5 font.

                   My friend Cb1, thank you for your interest and support.

    regards,

    Jame,Shin

  • Hello,

    Thank you - do note that 'most always' there are, 'Multiple descender LINES!.'   (rarely just one - as your drawing suggests.)

    Language (likely) 'Got in the way of your understanding' of '5x5 vs. '5x6' Fonts.   

    The reasoning behind the 'Odd Pixel Height of (especially) smaller fonts' is so that there is a 'symmetry' - between the 'upper & bottom halves' of certain characters.   (i.e. 'B, E, F, H, S' and '2, 3, 5, 6, 8 & 9')    They'd look 'strange' (pumpkin-like perhaps) if 'not symmetric' - don't you agree?

    You may benefit by visiting:  'www.LookupTables.com' - ASCII & other character and/or font tables are described...

    Should you 'Forum PM me' - and express the interest - I can likely provide you an 'Attractive Pixel Font Table' for the (relatively rare) 5x5 font.

  • Hi Jame, 

    That's a lot of questions. The answers will come to light when:

    a) I post the "repaired" encoding for "<" and ">" and,

    b) We look at how to display your new font, once you have chosen it.

    I'll post next week, or the week after that at the latest.

       

  • Daniel Milutinovic said:
    That's a lot of questions.

    Young staff noted a (similar) quote from the, 'Titanic's Captain' ... "That's a LOT of WATER!"

    Even a 'small hole' - punched in a Big Dam - may release an onslaught...

  • Hello Daniel,

    I’m Sorry for asking so many questions.

     - The End -

    Hello Cb1,

    Cb1 Said > don't you agree?

                 A> Yes, I agree (Can't Botox injection prescription into the pumpkin ?)

                        I understand Aliasing, I saw that there is anti Aliasing technology.

    I didn't know your PM(forum Project Manager)

    I thought you were a kind and grateful person who shared the knowledge you knew.

    So, you are my star and I am your fan.

    I think once more from your sharp say.

    Even if you are PM it is my friend.

    regards,

    Jame, Shin

  • Hello comrades, 

    I’ll now show how to change the encoding for the characters “<” and “>”. The ASCII code for “<” is 60. We see in fontcmss20b.c (in the graphics library) that the offset for “<” is 620, i.e. the encoding for the 28th (60 – 32) character starts at the 620th element in the data table (I’m calling the 1st entry in a table the 0th element).

    This means that the encoding for “<” starts at

    g_ pui8Cmss20bData[620]. Now

    g_ pui8Cmss20bData[620] = 18.

    This byte is the size byte and tells us that the encoding is 18 bytes long (including the size byte). The next byte gives us the width in pixels, which in this case is 5. The next 16 bytes determine the pixels in the character (see the TivaWare Graphics Library manual, pg 17 - 19). So the original encoding for “<” is:

    18, 5, 240, 243, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 112 

    I’ve replaced this with: 

    0x12, 0x08, 0x00, 0x04, 0x61, 0x62, 0x53, 0x43, 0x43, 0x43, 0x43, 0x63, 0x63, 0x63, 0x63, 0x62, 0x71, 0x90, 

    which is the compressed encoding for the following 18 x 8 character:

    Similarly the original encoding for “>” is

    20, 10,   0,   7, 99, 115, 115, 115, 115, 115, 115, 99, 114, 115, 114, 130, 130, 66, 54, 208, 

    which I have replaced with: 

    0x14, 0x08, 0x00, 0x04, 0x01, 0x72, 0x63, 0x63, 0x63, 0x63, 0x63, 0x43, 0x43, 0x43, 0x43, 0x52, 0x61, 0xF0, 0x10, 0x70, 

    "<" and ">" are now displayed properly:

    Here is the amended code for cmss20bData[2192] (with the original encodings for "<" and ">" commented out):

    const uint8_t cmss20bData[2192] =
    {
          5,   9,   0,  23,  80, //offset 0 - space
         17,   5, 163,  35,  35,  35,  35, 35,  35,  35,  35,  35, 115,  35,  35, 240, 192, //5 - exclamation
         16,   9, 240,  51,  19,  35,  19, 35,  19,  49,  49,  50,  34,   0,  16,  16, //22 - quotation
                                                                                       //38 - hash
         42,  18, 240, 240, 210,  49, 194, 49, 193,  50, 178,  50, 178,  50, 178,  49, 111,   1,  47,   1, 114,  49, 193,  50, 127,   1,  47,   1,
         97,  50, 178,  50, 178,  50, 178, 49, 193,  50, 193,  50, 240, 192,
                                                                                       //80 - dollar
         30,  11,  65, 161, 134,  72,  35, 17,  34,  35,  17,  99,  17, 101, 118, 102, 117,  97,  19,  97,  19,  34,  33,  19,  40,  85, 129,   0,
          6,  32,
                                                                                       //110 - percent
         47,  21, 240, 132, 130, 102,  99, 83,  35,  82,  99,  35,  66, 115,  35,  50, 131,  35,  35, 131,  35,  34, 166,  34, 240,  50, 240,  50,
         54, 147,  35,  35, 130,  51,  35,114,  67,  35,  98,  83,  35,  83, 102,  98, 132,   0,  11,
                                                                                       //157 - ampersand
         35,  17, 240, 240, 132, 194,  35,147,  35, 147,  35, 147,  34, 163,  18,  66, 100,  82,  99,  98,  70,  66,  67,  35,  35,  67,  39,  83,
         53, 111,  69,  53,   0,  10, 112,
    
         10,   5, 163,  35,  35,  49,  50,   0,   9,  16,                              //192 - apostrophe
         24,   8,  66,  82,  82,  98,  83,  82,  83,  83,  83,  83,  83,  83,  83,  83,  83,  98,  99,  98,  98, 114, 114,  32, //202 - left parenthesis
         24,   8,   2, 114, 114,  98,  99,  98,  99,  83,  83,  83,  83,  83,  83,  83,  83,  82,  83,  82,  98,  82,  82,  96, //226 - right parenthesis
         23,  11,  51, 131,  82,  19,  18,  35,  17,  19,  69, 101,  67,  17,  19,  34,  19,  18,  83, 131,   0,  15,  96,  //250 - asterix
         21,  16,   0,   6,  98, 226, 226, 226, 226, 226, 226, 142,  46, 130, 226, 226, 226, 226, 226,   0,   7, //273 - plus
         11,   5,   0,   8,  19,  35,  35,  49,  50, 240,  48, // - comma
          9,   8,   0,  10,   6,  38,   0,   9,  32, // - minus
          9,   5,   0,   8,  19,  35,  35, 240, 192, // - period
         24,  10, 113, 130, 130, 129, 130, 130, 129, 130, 130, 114, 130, 130, 114, 130, 129, 130, 130, 129, 130, 130, 129, 144, // - forward slash
                                                                                                                                // - 0
         32,  11, 240, 149,  83,  19,  66,  50,  51,  51,  35,  51,  35,  51,  35,  51,  35,  51,  35,  51,  35,  51,  35,  51,  50,  50,  67,  19,  85,   0,   7,  48,
         20,  10, 240, 146,  70, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,  87,   0,   6,  64, // - 1
         22,  11, 240, 148, 103,  50,  52,  34,  67, 131, 131, 115, 131, 115, 114, 130, 130, 137,  41,   0,   7,  16, // - 2
         22,  11, 240, 164,  87,  66,  50, 146, 131, 100, 116, 162, 147, 131, 131,  34,  67,  55,  85,   0,   7,  48, // - 3
         25,  12, 240, 212, 132, 117, 113,  19,  98,  19,  97,  35,  82,  35,  66,  51,  66,  51,  74,  42, 115, 147, 147,   0,   8, // - 4
         22,  11, 240, 135,  71,  67, 131, 131, 134,  87,  67,  35, 131, 131, 131,  34,  67,  55,  85,   0,   7,  48, // - 5
         27,  11, 240, 164, 101,  83, 115, 131,  19,  72,  52,  35,  35,  51,  35,  51,  35,  51,  35,  51,  51,  35,  55,  85,   0,   7,  48, // - 6
         20,  11, 240, 121,  41, 130, 131, 130, 131, 130, 131, 131, 115, 131, 131, 131, 131,   0,   7,  80, // - 7
         28,  11, 240, 149,  87,  51,  51,  35,  51,  35,  51,  55,  85,  82,  50,  51,  51,  35,  51,  35,  51,  35,  51,  55,  85,   0,   7,  48, // - 8
         27,  11, 240, 149,  87,  51,  50,  51,  51,  35,  51,  35,  51,  35,  51,  35,  36,  56,  67,  19, 131, 115,  70, 100,   0,   7,  64, // - 9
         13,   5, 240, 240,  83,  35,  35, 240,  35,  35,  35, 240, 192, // - colon
         15,   5, 240, 240,  83,  35,  35, 240,  35,  35,  35,  49,  50, 240,  48, // - semicolon
    //     18,   5, 240, 243,  35,  35,  35,  35,  35,  35,  35,  35,  35,  35,  35,  35,  35, 112, // - <
         0x12, 0x08, 0x00, 0x04, 0x61, 0x62, 0x53, 0x43, 0x43, 0x43, 0x43, 0x63, 0x63, 0x63, 0x63, 0x62, 0x71, 0x90, // - <
         13,  16,   0,  16,  14,  46, 240, 240,  78,  46,   0,  14,  32, // - equal
    //     20,  10,   0,   7,  99, 115, 115, 115, 115, 115, 115,  99, 114, 115, 114, 130, 130,  66,  54, 208, // - >    
         0x14, 0x08, 0x00, 0x04, 0x01, 0x72, 0x63, 0x63, 0x63, 0x63, 0x63, 0x43, 0x43, 0x43, 0x43, 0x52, 0x61, 0xF0, 0x10, 0x70, // - >
         21,  10, 240,  87,  50,  51, 115, 115,  99,  99, 115,  99, 115, 115, 240,  35, 115, 115,   0,   6, 112, // - question mark
                                                                                                                                                      // - at
         39,  15, 240, 240,  71, 100,  51,  67,  38,  67,  24,  35,  20,  20,  35,  19,  51,  35,  19,  51,  35,  19,  51,  35,  19,  51,  35,  20,  20,  51,  23,  67,
         37, 100,  67, 103,   0,   9, 112,
    
         29,  15, 240, 240,  68, 181, 165, 150, 146,  35, 115,  35, 115,  35, 114,  67,  83,  67,  90,  91,  51,  99,  51,  99,  50, 131,   0,   9,  80, // - A
         28,  13, 240, 184,  90,  51,  67,  51,  82,  51,  67,  51,  67,  57,  73,  67,  67,  51,  83,  35,  83,  35,  68,  42,  57,   0,   8,  80, // - B
         23,  14, 240, 240,  39,  89,  68,  81,  67, 163, 179, 179, 179, 179, 179, 195, 180,  82,  74, 102,   0,   9,  32, // - C
         30,  14, 240, 217,  90,  67,  68,  51,  83,  51,  99,  35,  99,  35,  99,  35,  99,  35,  99,  35,  99,  35,  83,  51,  68,  58,  73,   0,   9,  48, // - D
         20,  12, 240, 154,  42,  35, 147, 147, 147, 153,  57,  51, 147, 147, 147, 154,  42,   0,   7,  96, // - E
         20,  11, 240,
        121,  41,  35, 131, 131, 131, 136,  56,  51, 131, 131, 131,
        131, 131,   0,   7, 112,  27,  14, 240, 240,  39,  90,  52,
         82,  51, 113,  35, 179, 179, 179, 179,  69,  35,  69,  51,
         83,  52,  67,  74, 103,   0,   9,  16,  31,  14, 240, 211,
         99,  35,  99,  35,  99,  35,  99,  35,  99,  35,  99,  44,
         44,  35,  99,  35,  99,  35,  99,  35,  99,  35,  99,  35,
         99,   0,   9,  18,   5, 163,  35,  35,  35,  35,  35,  35,
         35,  35,  35,  35,  35,  35,  35, 240, 192,  21,  10, 240,
        163, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,  49,
         51,  39,  69,   0,   6,  96,  31,  14, 240, 211,  99,  35,
         83,  51,  67,  67,  51,  83,  35,  99,  19, 119, 120, 100,
         35,  83,  67,  67,  67,  67,  83,  51,  99,  35, 114,   0,
          9,  20,  11, 240, 115, 131, 131, 131, 131, 131, 131, 131,
        131, 131, 131, 131, 137,  41,   0,   7,  16,  51,  18, 240,
        240, 100, 132,  37, 101,  37, 101,  37, 101,  35,  18,  66,
         19,  35,  18,  66,  19,  35,  18,  66,  19,  35,  34,  34,
         35,  35,  34,  34,  35,  35,  34,  34,  35,  35,  52,  51,
         35,  52,  51,  35,  52,  51,  35,  66,  67,   0,  11,  64,
         39,  14, 240, 212,  83,  37,  67,  37,  67,  38,  51,  35,
         18,  51,  35,  18,  51,  35,  34,  35,  35,  34,  35,  35,
         50,  19,  35,  50,  19,  35,  54,  35,  69,  35,  69,  35,
         84,   0,   9,  30,  15, 240, 240,  70, 121,  84,  52,  67,
         83,  51, 115,  35, 115,  35, 115,  35, 115,  35, 115,  35,
        115,  51,  83,  68,  52,  89, 119,   0,  10,  25,  13, 240,
        185,  74,  51,  68,  35,  83,  35,  83,  35,  83,  35,  68,
         42,  57,  67, 163, 163, 163, 163,   0,   9,  48,  32,  15,
        240, 240,  70, 121,  84,  52,  67,  83,  51, 115,  35, 115,
         35, 115,  35, 115,  35, 115,  35, 115,  51,  38,  68,  37,
         89, 120, 195, 211,   0,   6,  30,  13, 240, 185,  74,  51,
         68,  35,  83,  35,  83,  35,  68,  42,  56,  83,  35,  83,
         51,  67,  66,  67,  67,  51,  82,  51,  83,   0,   8,  48,
         22,  12, 240, 182,  88,  51,  66,  51, 147, 150, 119, 103,
        148, 147,  33,  99,  34,  83,  41,  86,   0,   8,  20,  15,
        240, 253,  45, 115, 195, 195, 195, 195, 195, 195, 195, 195,
        195, 195, 195,   0,  10,  32,  32,  13, 240, 179,  83,  35,
         83,  35,  83,  35,  83,  35,  83,  35,  83,  35,  83,  35,
         83,  35,  83,  35,  83,  35,  83,  51,  52,  57, 101,   0,
          8,  96,  31,  15, 240, 242, 131,  35, 115,  35,  99,  67,
         83,  67,  82,  83,  67,  99,  51,  99,  50, 115,  35, 131,
         19, 131,  18, 150, 165, 164,   0,  10,  32,  51,  22, 240,
        240, 227,  99,  98,  50,  84,  83,  51,  68,  82,  67,  69,
         66,  67,  51,  18,  66,  82,  50,  34,  51,  83,  34,  35,
         34,  99,  34,  35,  34, 114,  19,  50,  19, 114,  18,  66,
         19, 117,  69, 133,  69, 148,  84, 147,  99,   0,  14,  64,
         29,  15, 240, 244,  83,  67,  67,  99,  51, 100,  19, 134,
        165, 179, 181, 165, 147,  19, 115,  51,  84,  52,  67,  83,
         51, 115,   0,   9,  80,  26,  15, 240, 243, 115,  36,  99,
         51,  83,  83,  51, 100,  20, 115,  19, 149, 165, 179, 195,
        195, 195, 195, 195,   0,  10,  32,  20,  13, 240, 187,  43,
        147, 148, 147, 147, 147, 163, 147, 147, 147, 163, 155,  43,
          0,   8,  48,  23,   7, 117,  37,  35,  67,  67,  67,  67,
         67,  67,  67,  67,  67,  67,  67,  67,  67,  67,  67,  69,
         37,  32,  16,  10, 240,  98,  50,  49,  65,  51,  35,  35,
         35,  35,  35,   0,  17,  96,  23,   7, 117,  37,  67,  67,
         67,  67,  67,  67,  67,  67,  67,  67,  67,  67,  67,  67,
         67,  67,  37,  37,  32,  11,   8, 240,  51,  66,  18,  34,
         49,   0,  16,  32,   7,   5, 163,  35,   0,  10, 112,   9,
          5, 178,  49,  51,  35,  35,   0,   9,  20,  10,   0,   8,
        118,  65,  51, 115, 115,  55,  35,  35,  35,  35,  35,  35,
         55,   0,   6,  64,  26,  12, 240, 147, 147, 147, 147, 147,
        152,  67,  51,  51,  67,  35,  67,  35,  67,  35,  67,  35,
         67,  35,  51,  56,   0,   8,  18,  10,   0,   9,   5,  71,
         35,  65,  35, 115, 115, 116,  49,  55,  69,   0,   6,  80,
         27,  11, 240, 211, 131, 131, 131, 131,  71,  51,  35,  35,
         51,  35,  51,  35,  51,  35,  51,  35,  51,  51,  35,  71,
          0,   7,  16,  20,  11,   0,   9, 117,  83,  34,  51,  51,
         35,  51,  41,  35, 131, 147,  50,  70,   0,   7,  32,  20,
          9, 240, 100,  51,  99,  99,  99,  86,  67,  99,  99,  99,
         99,  99,  99,  99,   0,   6,  32,  24,  11,   0,   9, 104,
         35,  34,  67,  34,  67,  34,  86,  70,  82, 152,  72,  34,
         82,  34,  82,  35,  51,  70, 224,  29,  11, 240, 115, 131,
        131, 131, 131, 131,  20,  52,  35,  35,  51,  35,  51,  35,
         51,  35,  51,  35,  51,  35,  51,  35,  51,   0,   7,  16,
         16,   5, 163,  35,  35, 195,  35,  35,  35,  35,  35,  35,
         35,  35, 240, 192,  21,   8, 240,  67,  83,  83, 240,  99,
         83,  83,  83,  83,  83,  83,  83,  83,  83,  83,  38,  52,
        176,  26,  11, 240, 115, 131, 131, 131, 131, 131,  51,  35,
         35,  51,  19,  70,  86,  87,  67,  35,  51,  50,  51,  51,
          0,   7,  16,  18,   5, 163,  35,  35,  35,  35,  35,  35,
         35,  35,  35,  35,  35,  35,  35, 240, 192,  34,  17,   0,
         14, 115,  20,  36,  52,  36,  35,  35,  51,  51,  35,  51,
         51,  35,  51,  51,  35,  51,  51,  35,  51,  51,  35,  51,
         51,  35,  51,  51,   0,  10, 112,  25,  11,   0,   9,  83,
         20,  52,  35,  35,  51,  35,  51,  35,  51,  35,  51,  35,
         51,  35,  51,  35,  51,   0,   7,  16,  22,  11,   0,   9,
        117,  82,  50,  51,  51,  35,  51,  35,  51,  35,  51,  35,
         51,  55,  85,   0,   7,  48,  26,  12,   0,  10,  67,  20,
         73,  51,  52,  35,  67,  35,  67,  35,  67,  35,  67,  35,
         51,  56,  67, 147, 147, 147, 240,  96,  25,  11,   0,   9,
        115,  19,  56,  36,  35,  35,  51,  35,  51,  35,  51,  35,
         51,  51,  35,  71, 131, 131, 131, 131, 208,  17,   8,   0,
          7,   3,  18,  38,  36,  67,  83,  83,  83,  83,  83, 240,
        240, 240,  17,   9,   0,   8,   6,  34,  50,  34, 117,  86,
        114,  34,  50,  39,  53,   0,   6,  19,   9, 240, 240, 115,
         99,  99,  87,  51,  99,  99,  99,  99,  99,  33,  54,  68,
          0,   6,  25,  11,   0,   9,  83,  51,  35,  51,  35,  51,
         35,  51,  35,  51,  35,  51,  35,  51,  35,  36,  52,  19,
          0,   7,  16,  23,  11,   0,   9,  82,  82,  35,  51,  50,
         50,  66,  50,  67,  19,  82,  18,  98,  18, 101, 115,   0,
          7,  64,  33,  16,   0,  14,   2,  66,  66,  35,  50,  51,
         50,  36,  34,  66,  33,  18,  34,  67,  17,  18,  19,  69,
         18,  19,  84,  21,  99,  52,  99,  52,   0,  10,  64,  22,
         11,   0,   9,  83,  51,  51,  19,  82,  18, 115, 131, 117,
         98,  18,  82,  50,  51,  66,   0,   7,  16,  24,  11,   0,
          9,  82,  82,  35,  51,  50,  50,  67,  19,  82,  19,  85,
        116, 116, 130, 146, 130, 101, 100, 240,  48,  16,  10,   0,
          8, 104, 115,  99,  99, 114, 115,  99,  99, 120,   0,   6,
         64,   9,  13,   0,  14,  91,  43,   0,  16,  64,  11,  24,
          0,  27,  15,   7,  47,   7,   0,  30,  32,  12,   9, 240,
         51,  19,  34,  34,  50,  33,   0,  18,  64,  11,   9, 240,
         67,  33,  39,  33,  35,   0,  18,  48
    };

    All that remains now is to show how to add a new font. Which font do you want to add Jame?

  • Thank you for a 'most' caring & detailed explanation.    It is suspected that those, 'Willing/Able to invest the time & effort required' - to fully/properly grasp your contribution - will benefit nicely.

    There is a possible 'typo' or likely 'carry-over' from past font listings, however.

    Daniel Milutinovic said:
    The next byte gives us the width in pixels, which in this case is 5.

    For the font you've illustrated - limiting the characters' width to (just 5) - would produce, 'Odd, narrow characters!'     Your characters however are most attractive - and as you (later) note - are (usually) 7 pixels in width.   (You provided a drawing showing an 18x8 character cell.)

    Now the 'M' & 'W' are usually the 'widest' characters w/in a given font.   May  we ask if those too - top out at 7 pixels in width?    (Staff believes 'No' - as they both appear significantly wider than the 'average width' character.)

    For a 'proper challenge' - poster Jame should 'Stick to his guns' - and request that you ADD his, 'Oft repeated request for a 5x5 Font' - noted by Jame as 'Very  much Needed!'

    Again 'Good Job' - hopefully appreciated by, 'Beyond your Comrade Crüe!'

  • Hello cb1_mobile,

    Thank you, I've learned a great deal from knowledgeable people like yourself and like to give back when I can.

    Please note that the pixel width in the original encoding for "<" is indeed 5, and I never said the characters are usually/top out at 7 pixels in width. 

    I'm not sure why Jame wants a 5x5 font - way too small for my middle-aged eyes and the supplied 6x8 font should fulfil his requirements nicely, as you pointed out at the beginning. 

     

     

  • Hello Daniel,

    Thank you for your time and effort to get the results you want.

    What I needed was a 5x5 font that wanted me to answer questions and get help.

    In the Cmm20b (21 W x 21H) font, the “<“ and “>” marks are out of interest.

    " It’s a beautiful day and I can’t see it  "

    regards,

    Jame, Shin

  • Hello Jame, 

    If you are willing to put in the time and effort then you too will get the results you want. 

    There is no royal road to geometry, or embedded systems

  • Bravo Daniel - 'So well said!'      Yet - might a (near) royal road (unpaved, grass strewn) await, 'Would be Creator's footsteps?'

    When one sets a 'high goal' - likely in an 'unfamiliar area' - a (properly) 'disciplined approach' proves the best pathway!

    You've listed, 'time & effort' - yet might 'more specific actions' prove of great value:

    • Focus - usually - to gain 'real understanding' - a 'broad search' of the subject matter is required.   No two requirements are 'exact' - thus the learning gleaned from 'multiple sources' - often (i.e. always) enables broader & superior insights.   (and may save the developer - days, weeks, months...)
    • KISS - simplicity can not be achieved w/out first determining the 'Constituent Parts.'   (those small (basic) 'pieces' - which when successfully combined - 'best enable' (by FAR) project success!   Has sufficient effort/time (i.e. Focus) been invested in the attempt to identify these crucial, 'key elements of the project?'   
    • Testing & Verification -  once those 'key elements' have been identified - how can their 'operation' be  properly tested?    Note that the 'project' most always will demand the, 'Proper combination of 'key elements' - which have been well-tested & verified!   
    • Measurement - as each 'key element' is identified - there must be a conscious effort to, 'Devise a practical Measurement' - which (alone) truly confirms the element's  accuracy & performance.
    • Integration - only after individual elements have been successfully tested should they be 'combined.'    And - this combination will demand, 'its own measurement' - to insure that the 'joining' has met the project's objective.

    Absent my list (above) is the inherent, 'Matching of Skill/Knowledge/Capability' to the (likely) Demands of the Project.'    Should the 'objective'  greatly exceed 'current capability' - 'intermediate projects' (those which build skills in 'multiple - yet not ALL - of the 'key elements') should be considered.   (really - substituted)     

    And that represents the, 'Essentials of KISS' - the Systematic 'Building of Capability' yet always in a carefully  'controlled, considered & measured' manner...

  • Hello Daniel,

    Did I say burdensome !!

    You are an expert.

    You have not answered the previous question.

     As a result, it seems to be proud of the existing modifications.

    Aesop's fable story.

    Why did the rabbit suggest to the turtle to race?

    regards,

    Jame, Shin

  • Hello,  Daniel and Cb1

    Let's change the question.

    Why did the turtle accept the rabbit's suggest ?

    regards,

    Jame, Shin

  • Jame shin said:
    Why did the turtle accept the rabbit's suggestion (to race)?

    Young staffer 'offers up' her belief:

    • Turtle properly Focused - thus searched & found 'past race reviews & others' who had, 'Raced that course' w/success.    Gleaned 'much needed data & understanding!'
    • Turtle carefully & systematically identified the, 'Key Constituent Parts' of the requirement.   
    • Turtle determined the 'average speed required' to overcome 'rabbit's initial burst' - followed later by hare's (premature) 'siesta.'
    • Turtle invested the time/effort to 'Measure' his speed - and used that 'measure' - to 'properly practice'  thus gaining 'notable' improvement!
    • Turtle's 'Full use of KISS' enabled him to, 'Pass the slumbering rabbit' - and to, (strategically) 'Win the race!'

    Both that 'turtle' - and young staff here - note that question barrage continues - yet, 'Not one (even basic) Constituent Part Identification' has arrived!

    Is it not likely that, 'Rejecting one method' (usually) demands a, 'Superior Alternative' to be described & placed 'in play.'    Yet the track is barren - but for a defeated/discarded 'rabbit's foot' - why is that?

  • Hello  Cb1  &  Daniel,

    Cb1_Said >   for a defeated/discarded 'rabbit's foot' - why is that?

    My Previous Post  >  Why did the rabbit suggest to the turtle to race?

    This is the same as asking Daniel,Milutnovic in the previous post question.

    Now !! View from the perspective of the rabbit and turtle.

    Land rabbits sometimes saw turtles coming from the sea to land.

    In conclusion, it is because of the rabbit's boast and arrogance. So the rabbit's foot is defeated.

    It's not fair.

    Turtles are disadvantageous, but they also have to wake up sleeping rabbits and go together.

    It was Daniel who acted on the above.

    Q> What is justice ?

    regards,

    Jame, Shin

  • Greetings Gentlemen, 

    I am very much enjoying the deep philosophical musings. 

    cb1_mobile, thank you for your invaluable pearls of wisdom

    Jame, we are very close to adding your 5x5 font, closer than you realise. There are two options:

    1) Use a pre-existing 5x5 font, which will require either encoding in the compressed format or a new display function to be written.

    2) Create and encode your own 5x5 font. Creating a font from scratch is an onerous task, but this one is so small you could even do it by hand (draw and encode a few characters each day and you'll have it done in time for New Year's Eve celebrations).

  • Greetings Daniel,

    May I note that our motivated & 'here today' young staff, 'Roll their pretty eyes - upon noting your kind comment.'    (firm's mike picked up, "Dude - he cannot be talking about you!")     So neat to be SO 'appreciated.'    (serving in my own defense - NO Jury would convict me...)

    Now - may (they & I) disagree w/the need to encode the '5x5' - in a compressed format?    (such compression 'may not make sense' - when the font is so small.)   However - you 'hedged that bet' (nicely) by noting the (potential) use of a 'new display function.'    (we prefer the 'clarity enhancing', 'Font Array and  mated/adaptive Character Generator' btw.)     

    It should be noted - MANY Posts earlier -  young staff presented (right here) a likely source for a 'proven effective' 5x5 Font.    (Siemens, 5x5 Led matrix display - which we deployed w/in fighter cockpits)    Small Size, Extreme Legibility plus terrific 'Shock/Vibration specs' - put this display 'on the map.'   (Clients did require 'deep pockets' - device was (& remains) expensive!)

    It is unfortunate that you appear (alone) - to have recognized (perhaps even absorbed) the 'methods/madness' - directed at another - who (still) 'avoids' the basic, 'Identification of Constituent Parts!'     Seeking 'Justice' - rather than 'doing the focused work' - proves (highly) unlikely to yield results!     (inconveniently (almost awkwardly) noted - by that discarded, 'rabbit's foot.')

  • Hello cb1_mobile! 

    When young staff roll their pretty eyes state, rather matter-of-factly:

      

    As you've noted, "M" is quite wide and took up the entire pixel width but the other letters of the (partial) 5x5 font I made up look O.K.:

    All that remains is for Jame to fill in the gaps, if he still has the heart for it:

    const uint8_t font5x5Data[] =
    {
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x12, 0x21, 0x21, 0x14, 0x11, 0x21, 0x11, 0x21, 0x10, //A
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x03, 0x21, 0x21, 0x11, 0x21, 0x11, 0x21, 0x13, 0x20, //D
     0x0B, 0x05, 0x04, 0x11, 0x44, 0x11, 0x10, 0x30, 0x02, 0x02, 0x10, //E
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x01, 0x21, 0x11, 0x21, 0x14, 0x11, 0x21, 0x11, 0x21, //H
     0x0B, 0x05, 0x03, 0x31, 0x41, 0x41, 0x30, 0x01, 0x01, 0x01, 0x20, //I
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x01, 0x33, 0x13, 0x11, 0x12, 0x32, 0x10, 0x10, 0x11, //M
     0x0B, 0x05, 0x01, 0x21, 0x12, 0x11, 0x14, 0x11, 0x12, 0x11, 0x21, //N
     0x0B, 0x05, 0x04, 0x11, 0x21, 0x11, 0x21, 0x11, 0x21, 0x14, 0x10, //O
     0x0B, 0x05, 0x04, 0x11, 0x21, 0x14, 0x12, 0x30, 0x02, 0x10, 0x20, //P
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x04, 0x11, 0x21, 0x14, 0x11, 0x11, 0x21, 0x21, 0x10, //R
     0x0B, 0x05, 0x04, 0x11, 0x44, 0x41, 0x10, 0x01, 0x01, 0x02, 0x10, //S
     0x0B, 0x05, 0x05, 0x21, 0x41, 0x41, 0x10, 0x10, 0x10, 0x11, 0x20, //T
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x0B, 0x05, 0x01, 0x31, 0x11, 0x11, 0x31, 0x41, 0x41, 0x10, 0x10, //Y
     0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    };
    
    const uint32_t font5x5Offset[] =
    {
     0, 11, 22, 33, 44, 55, 66, 77, 88, 99, 110,
     121, 132, 143, 154, 165, 176, 187, 198, 209, 220, 231,
     242, 253, 264, 275, 286, 297, 308, 319, 330, 341, 352,
     363, 374, 385, 396, 407, 418, 429, 440, 451, 462, 473,
     484, 495, 506, 517, 528, 539, 550, 561, 572, 583, 594,
     605, 616, 627, 638
    };
    

     

     

     

  • Daniel Milutinovic said:
    All that remains is for Jame to fill in the gaps...

    Pardon - but perhaps not!    Having worked (rather successfully) w/in the display industry - may we note that (several, perhaps many) of your characters are, 'Just 4 pixels in width?'     They should ALL be: 5 Pixel Tall by 5 Pixel Wide - that is the, 'Normal & Customary'  (thank you UCLA law) font definition requirement.    Should you 'be at all in doubt' - kindly review the 'classic' 5x7 font - you will note that ALL (normal) chars are 5 pixels wide!   (the period & similar would appear 'retarded' if rendered in such width)    It appears that you have created a 'New Hybrid' ... FONT 4-5x5 ... has a 'ring' - does it not?

    This then would allow a, 'Single Pixel Spacing' both (atop & below) and between each character (right & left.)     This achieved via placing the '5x5 Font within a '6x8 character cell.  Do you SEE what's just happened - I've 'locked into the 5x7 format - yours (of course) should employ a 6x6 character cell.    (I've earned (yet another) eye roll.)     (that 6x6 'cell' enables the needed blank - between character rows & individual characters.)    Note too - any 'fixed size' font offers EXTREME PROGRAMMING EASE & SPEED - as compared to fonts of varying width.   (variant width fonts look better - yet 'eat font space' & are much harder to program...)

    It should be noted that the '5 descender characters' prove 'beyond UGLY' (really warrant staff's eye roll) when rendered w/in 5x5 - and in fact - often only the 'CAPS' & Numerals/Punctuation - are employed.

    Please accept this 'feedback' as 'constructive' - you have expended great effort - and surely that has 'flowed' from your initial:

    • Recognition of the necessary constituent parts
    • Methodically building up - those individual pieces
    • Finally 'joining' them together and testing

    Honesty & Modesty are important - yet 'Focused Effort - Accepting Direction & Doing the Work' - also play (some) role - do they not?

  • Hello cb1_mobile, 

    Thanks for the feedback. True, I should have said a font within a 5x5 character cell. It was a rough and ready font I made up on the bus to work to just illustrate how a small font can be added quite easily. Once the process is understood it isn't too hard to create your own small font. 

    The methods I have shown in this thread are, of course, just one way to add a new font. 

    Eventually I'll replace all of the graphics library functions with my own. And while doing this and future projects I'll keep in mind the vital need to: 

    • Recognise the necessary constituent parts
    • Methodically build up those individual pieces, and 
    • Finally join them together and test

    All the while accepting direction and doing the work!

  • Hello Daniel & Cb1,

    Daniel _said> I am very much enjoying the deep philosophical musings.   

    I told the story of rabbits and turtles, It's not a philosophy. It's psychology.

    Psychology is similar to the mental world, but different from the scientific(neuroscience) approach.

    The psychology I define is a scientific approach to human mind and behavior.

    On a psychology basis, each state of mind is asked:

    My Previous Post1 >Why did the rabbit suggest to the turtle to race?

    My thoughts       > In conclusion, it is because of the rabbit's boast and arrogance.

    My Previous Post2 > Why did the turtle accept the rabbit's suggest ?

    My thoughts       > This is because they want to learn and gain wisdom on land that turtles don't know much about.

    My Previous Post3> What is justice ?

    My thoughts       > Turtles are disadvantageous, but they also have to wake up sleeping rabbits and go together.

    The process and procedures are justified?, Is it because I'm getting happiness through someone's pain or misery,

    Are you compromising on the strength or authority of the strong rather than on the weak?, It is necessary to take a look.

    I think this is justice.

    In the forum, Cb1 is acting close to justice. Sometimes it's a shame, but I like him.

    Above [Fig-5] and [Fig-6] do not show any letters. (Attach font file.)

    As a side note, I've included the grlib.lib file after correctly building the Glib folder.

    Q1> What is the problem (5x5 Font ) ?

    regards,

    Jame, Shin

    Tag : Does the rabbit still have no procedural method and process description for running, but does it speak of arrogance and pride?

           Someone is difficult, he makes it on the bus for a while and posts it.

    //*****************************************************************************
    
    #include <stdint.h>
    #include <stdbool.h>
    #include "grlib/grlib.h"
    
    //*****************************************************************************
    //
    // Details of this font:
    //     Style: fixed
    //     Size: 8 point
    //     Bold: no
    //     Italic: no
    //     Memory usage: 960 bytes
    //
    //*****************************************************************************
    
    //*****************************************************************************
    //
    // The uncompressed data for the fixed-point 6x8 font.
    //
    //*****************************************************************************
    #if 0
    static const uint8_t g_pui8FontFixed6x8Data[760] =
    {
          8,   6,   0,   0,   0,   0,   0,   0,   8,   6,  32, 130,
          8,   0,   2,   0,   8,   6,  81,  69,   0,   0,   0,   0,
          8,   6,  81,  79, 148, 249,  69,   0,   8,   6,  33, 234,
         28,  43, 194,   0,   8,   6, 195,  33,   8,  66,  97, 128,
          8,   6,  98,  74,  16, 170,  70, 128,   8,   6,  96, 132,
          0,   0,   0,   0,   8,   6,  16, 132,  16,  64, 129,   0,
          8,   6,  64, 129,   4,  16, 132,   0,   8,   6,   0, 138,
        156, 168, 128,   0,   8,   6,   0, 130,  62,  32, 128,   0,
          8,   6,   0,   0,   0,  96, 132,   0,   8,   6,   0,   0,
         62,   0,   0,   0,   8,   6,   0,   0,   0,   1, 134,   0,
          8,   6,   0,  33,   8,  66,   0,   0,   8,   6, 114,  41,
        170, 202,  39,   0,   8,   6,  33, 130,   8,  32, 135,   0,
          8,   6, 114,  32, 132,  33,  15, 128,   8,   6, 248,  66,
          4,  10,  39,   0,   8,   6,  16, 197,  36, 248,  65,   0,
          8,   6, 250,  15,   2,  10,  39,   0,   8,   6,  49,   8,
         60, 138,  39,   0,   8,   6, 248,  33,   8,  65,   4,   0,
          8,   6, 114,  40, 156, 138,  39,   0,   8,   6, 114,  40,
        158,   8,  70,   0,   8,   6,   1, 134,   0,  97, 128,   0,
          8,   6,   1, 134,   0,  96, 132,   0,   8,   6,  16, 132,
         32,  64, 129,   0,   8,   6,   0,  15, 128, 248,   0,   0,
          8,   6,  64, 129,   2,  16, 132,   0,   8,   6, 114,  32,
        132,  32,   2,   0,   8,   6, 114,  32, 154, 170, 167,   0,
          8,   6, 114,  40, 162, 250,  40, 128,   8,   6, 242,  40,
        188, 138,  47,   0,   8,   6, 114,  40,  32, 130,  39,   0,
          8,   6, 226,  72, 162, 138,  78,   0,   8,   6, 250,   8,
         60, 130,  15, 128,   8,   6, 250,   8,  60, 130,   8,   0,
          8,   6, 114,  40,  46, 138,  39, 128,   8,   6, 138,  40,
        190, 138,  40, 128,   8,   6, 112, 130,   8,  32, 135,   0,
          8,   6,  56,  65,   4,  18,  70,   0,   8,   6, 138,  74,
         48, 162,  72, 128,   8,   6, 130,   8,  32, 130,  15, 128,
          8,   6, 139, 106, 170, 138,  40, 128,   8,   6, 138,  44,
        170, 154,  40, 128,   8,   6, 114,  40, 162, 138,  39,   0,
          8,   6, 242,  40, 188, 130,   8,   0,   8,   6, 114,  40,
        162, 170,  70, 128,   8,   6, 242,  40, 188, 162,  72, 128,
          8,   6, 122,   8,  28,   8,  47,   0,   8,   6, 248, 130,
          8,  32, 130,   0,   8,   6, 138,  40, 162, 138,  39,   0,
          8,   6, 138,  40, 162, 137,  66,   0,   8,   6, 138,  40,
        170, 170, 165,   0,   8,   6, 138,  37,   8,  82,  40, 128,
          8,   6, 138,  40, 148,  32, 130,   0,   8,   6, 248,  33,
          8,  66,  15, 128,   8,   6, 113,   4,  16,  65,   7,   0,
          8,   6,   2,   4,   8,  16,  32,   0,   8,   6, 112,  65,
          4,  16,  71,   0,   8,   6,  33,  72, 128,   0,   0,   0,
          8,   6,   0,   0,   0,   0,  15, 128,   8,   6,  64, 129,
          0,   0,   0,   0,   8,   6,   0,   7,   2, 122,  39, 128,
          8,   6, 130,  11,  50, 138,  47,   0,   8,   6,   0,   7,
         32, 130,  39,   0,   8,   6,   8,  38, 166, 138,  39, 128,
          8,   6,   0,   7,  34, 250,   7,   0,   8,   6,  49,  36,
         56,  65,   4,   0,   8,   6,   1, 232, 162, 120,  39,   0,
          8,   6, 130,  11,  50, 138,  40, 128,   8,   6,  32,   6,
          8,  32, 135,   0,   8,   6,  16,   3,   4,  18,  70,   0,
          8,   6, 130,   9,  40, 194, 137,   0,   8,   6,  96, 130,
          8,  32, 135,   0,   8,   6,   0,  13,  42, 170,  40, 128,
          8,   6,   0,  11,  50, 138,  40, 128,   8,   6,   0,   7,
         34, 138,  39,   0,   8,   6,   0,  15,  34, 242,   8,   0,
          8,   6,   0,   6, 166, 120,  32, 128,   8,   6,   0,  11,
         50, 130,   8,   0,   8,   6,   0,   7,  32, 112,  47,   0,
          8,   6,  65,  14,  16,  65,  35,   0,   8,   6,   0,   8,
        162, 138, 102, 128,   8,   6,   0,   8, 162, 137,  66,   0,
          8,   6,   0,   8, 162, 170, 165,   0,   8,   6,   0,   8,
        148,  33,  72, 128,   8,   6,   0,   8, 162, 120,  39,   0,
          8,   6,   0,  15, 132,  33,  15, 128,   8,   6,  16, 130,
         16,  32, 129,   0,   8,   6,  32, 130,   8,  32, 130,   0,
          8,   6,  64, 130,   4,  32, 132,   0,   8,   6,  66, 161,
          0,   0,   0,   0,
    };
    #endif
    //#if 0
    static const uint8_t g_pui8FontFixed6x8Data[649] =		// Daniel New 5x5 Font Insert
    { 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x12, 0x21, 0x21, 0x14, 0x11, 0x21, 0x11, 0x21, 0x10, //A 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x0B, 0x05, 0x03, 0x21, 0x21, 0x11, 0x21, 0x11, 0x21, 0x13, 0x20, //D 
    0x0B, 0x05, 0x04, 0x11, 0x44, 0x11, 0x10, 0x30, 0x02, 0x02, 0x10, //E 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x01, 0x21, 0x11, 0x21, 0x14, 0x11, 0x21, 0x11, 0x21, //H 
    0x0B, 0x05, 0x03, 0x31, 0x41, 0x41, 0x30, 0x01, 0x01, 0x01, 0x20, //I 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x01, 0x33, 0x13, 0x11, 0x12, 0x32, 0x10, 0x10, 0x11, //M 
    0x0B, 0x05, 0x01, 0x21, 0x12, 0x11, 0x14, 0x11, 0x12, 0x11, 0x21, //N 
    0x0B, 0x05, 0x04, 0x11, 0x21, 0x11, 0x21, 0x11, 0x21, 0x14, 0x10, //O 
    0x0B, 0x05, 0x04, 0x11, 0x21, 0x14, 0x12, 0x30, 0x02, 0x10, 0x20, //P 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x04, 0x11, 0x21, 0x14, 0x11, 0x11, 0x21, 0x21, 0x10, //R 
    0x0B, 0x05, 0x04, 0x11, 0x44, 0x41, 0x10, 0x01, 0x01, 0x02, 0x10, //S 
    0x0B, 0x05, 0x05, 0x21, 0x41, 0x41, 0x10, 0x10, 0x10, 0x11, 0x20, //T 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x0B, 0x05, 0x01, 0x31, 0x11, 0x11, 0x31, 0x41, 0x41, 0x10, 0x10, //Y 
    0x0B, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 
    }; 
    //#endif
    //*****************************************************************************
    //
    // The font definition for the fixed-point 6x8 font.
    //
    //*****************************************************************************
    const tFont g_sFontFixed6x8 =
    {
    	#if 0
        //
        // The format of the font.
        //
        FONT_FMT_UNCOMPRESSED,
    
        //
        // The maximum width of the font.
        //
        6,
    
        //
        // The height of the font.
        //
        8,
    
        //
        // The baseline of the font.
        //
        7,
    
        //
        // The offset to each character in the font.
        //
        {
               0,    8,   16,   24,   32,   40,   48,   56,
              64,   72,   80,   88,   96,  104,  112,  120,
             128,  136,  144,  152,  160,  168,  176,  184,
             192,  200,  208,  216,  224,  232,  240,  248,
             256,  264,  272,  280,  288,  296,  304,  312,
             320,  328,  336,  344,  352,  360,  368,  376,
             384,  392,  400,  408,  416,  424,  432,  440,
             448,  456,  464,  472,  480,  488,  496,  504,
             512,  520,  528,  536,  544,  552,  560,  568,
             576,  584,  592,  600,  608,  616,  624,  632,
             640,  648,  656,  664,  672,  680,  688,  696,
             704,  712,  720,  728,  736,  744,  752,
        },
    	#endif
        //#if 0						// Daniel New 5x5 Font Insert
    	  //
        // The format of the font.
        //
        FONT_FMT_PIXEL_RLE,
    
        //
        // The maximum width of the font.
        //
        5,
    
        //
        // The height of the font.
        //
        5,
    
        //
        // The baseline of the font.
        //
        4,
    
        //
        // The offset to each character in the font.
        //
    		{ 
    		0, 11, 22, 33, 44, 55, 66, 77, 88, 99, 110, 
    		121, 132, 143, 154, 165, 176, 187, 198, 209, 220, 231, 
    		242, 253, 264, 275, 286, 297, 308, 319, 330, 341, 352, 
    		363, 374, 385, 396, 407, 418, 429, 440, 451, 462, 473, 
    		484, 495, 506, 517, 528, 539, 550, 561, 572, 583, 594, 
    		605, 616, 627, 638
    		 },
    	//#endif 
        //
        // A pointer to the actual font data
        //
        g_pui8FontFixed6x8Data
    };
    

     

     

     

     

     

     

  • Hello Friend Cb1,

    In the previous post figure [Fig-6.], The format of the font was changed and tested.

    I changed the font format from FONT_FMT_PIXEL_RLE to FONT_FMT_UNCOMPRESSED.

    But no letters(5x5 Font )  appear.

    What do you think?

    regards,

    Jame, Shin

  • My friend,

    Jame shin said:
    I changed the font format from FONT_FMT_PIXEL_RLE to FONT_FMT_UNCOMPRESSED.

    Is not further information required?

    • by what means had you 'Changed the font format?'    
    • do you believe that simply changing (as above) by itself - proves sufficient?
    • where are your listings of the "key elements' of a 'font design?'    Minus these - we've 'no idea' of your objectives - and how the 'moving parts' go together.

    Past posts from my group provided good detail as to, 'Recommended Methods to Heighten the Odds of a new font's operational success.'    No response to those suggestions arrived - instead (many) 'Turtle & Rabbit sightings' arrived.    (And (pardon) - 'that pair' proves unlikely to produce a font success...)

  • Hello  Cb1 & Charles & Ralph & BP101 & Daniel

    I've started the source post three months ago.

    1. ListBox Wiget & my Project ( Charles & Ralph & Cb1 & BP101)

        https://e2e.ti.com/support/microcontrollers/other/f/908/p/836379/3094034#3094034

    2.Display ( Charles & Ralph )

    https://e2e.ti.com/support/microcontrollers/other/f/908/p/836379/3105104#pi320995=4

    https://e2e.ti.com/support/microcontrollers/other/f/908/t/843503

    3.Font (Cb1 & Daniel )

    https://e2e.ti.com/support/microcontrollers/other/f/908/t/848174

    Charles Said > I will suggest you get the ListBox to work with static message before attempting to take dynamic data entry.

    Introduced me but I'm a MCU beginner.  

    I've been step by step with hope from say of Charles.

    I proceeded with a desperate heart.

    The process has successful resulted in a lot of patience, correction and effort.

    But it's been like a turtle for a long time.

    I came here with your help and support. thank you.

    Thanks also to Daniel for not responding to 5x5 fonts.

    Daniel(rabbit) wake up from  sleep.

    And 6x8 font successfully implemented.

    Tag : Depart to Kiss  

    regards,

    Jame, Shin