From 95bcec668def747ed77c38fe17f893c0d029bbbc Mon Sep 17 00:00:00 2001 From: Nils Faerber Date: Tue, 31 Jul 2012 23:42:03 +0200 Subject: [PATCH] Add MetaWatch Fonts package, LcdDisplay and start demo --- ui/Fonts.c | 1826 +++++++++++++++++++++++++++++++++++++++++++++++ ui/Fonts.h | 121 ++++ ui/LcdDisplay.c | 73 ++ ui/LcdDisplay.h | 9 + ui/Makefile.am | 2 +- ui/oswald-ui.c | 79 +- 6 files changed, 2088 insertions(+), 22 deletions(-) create mode 100644 ui/Fonts.c create mode 100644 ui/Fonts.h create mode 100644 ui/LcdDisplay.c create mode 100644 ui/LcdDisplay.h diff --git a/ui/Fonts.c b/ui/Fonts.c new file mode 100644 index 0000000..ac8c73d --- /dev/null +++ b/ui/Fonts.c @@ -0,0 +1,1826 @@ +//============================================================================== +// Copyright 2011 Meta Watch Ltd. - http://www.MetaWatch.org/ +// +// Licensed under the Meta Watch License, Version 1.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.MetaWatch.org/licenses/license-1.0.html +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//============================================================================== + +#include +#include "Fonts.h" + +/*! The number of printable characters in the font tables */ +#define PRINTABLE_CHARACTERS ( 94 ) + +const unsigned char MetaWatch5table[PRINTABLE_CHARACTERS][5]; +const unsigned char MetaWatch7table[PRINTABLE_CHARACTERS][7]; +const unsigned int MetaWatch16table[PRINTABLE_CHARACTERS][16]; +const unsigned int MetaWatchTimeTable[TOTAL_TIME_CHARACTERS][19]; + +const unsigned char MetaWatch5width[PRINTABLE_CHARACTERS]; +const unsigned char MetaWatch7width[PRINTABLE_CHARACTERS]; +const unsigned char MetaWatch16width[PRINTABLE_CHARACTERS]; +const unsigned char MetaWatchTimeWidth[TOTAL_TIME_CHARACTERS]; + +/*! Font Structure + * + * \param Type is the enumerated type of font + * \param Height + * \param Spacing is the horizontal spacing that should be inserted when + * drawing characters + */ +typedef struct +{ + etFontType Type; + unsigned char Height; + unsigned char Spacing; +} tFont; + +static tFont CurrentFont; + +void SetFont(etFontType Type) +{ + switch (Type) + { + case MetaWatch5: + CurrentFont.Type = Type; + CurrentFont.Height = 5; + CurrentFont.Spacing = 1; + break; + + case MetaWatch7: + CurrentFont.Type = Type; + CurrentFont.Height = 7; + CurrentFont.Spacing = 1; + break; + + case MetaWatch16: + CurrentFont.Type = Type; + CurrentFont.Height = 16; + CurrentFont.Spacing = 1; + break; + + case MetaWatchTime: + CurrentFont.Type = Type; + CurrentFont.Height = 19; + CurrentFont.Spacing = 1; + break; + + default: + printf("Undefined Font Selected\r\n"); + break; + } +} + +unsigned char MapDigitToIndex(unsigned char Digit) +{ + /* default is a space (the first printable character) */ + return (Digit < 10 ? Digit + 0x10 : 0); +} + + +unsigned char GetCharacterWidth(unsigned char Character) +{ + unsigned char index = MapCharacterToIndex(Character); + unsigned char Width = 0; + + switch (CurrentFont.Type) + { + case MetaWatch5: Width = MetaWatch5width[index]; break; + case MetaWatch7: Width = MetaWatch7width[index]; break; + case MetaWatch16: Width = MetaWatch16width[index]; break; + case MetaWatchTime: Width = MetaWatchTimeWidth[index]; break; + default : + break; + } + + return Width; + +} + +unsigned char GetCharacterHeight(void) +{ + return CurrentFont.Height; +} + +void SetFontSpacing(unsigned char Spacing) +{ + CurrentFont.Spacing = Spacing; +} + +unsigned char GetFontSpacing(void) +{ + return CurrentFont.Spacing; +} + +unsigned char MapCharacterToIndex(unsigned char CharIn) +{ + unsigned char Result = 0; + + switch (CurrentFont.Type) + { + case MetaWatchTime: + Result = CharIn; + break; + + default : + // space = 0x20 and 0x7f = delete character + if ( (CharIn >= 0x20) && (CharIn < 0x7f) ) + { + Result = CharIn - 0x20; + } + break; + } + + return Result; + +} + + +void GetCharacterBitmap(unsigned char Character,unsigned int * pBitmap) +{ + unsigned char index = MapCharacterToIndex(Character); + + unsigned char row; + for (row = 0; row < CurrentFont.Height; row++ ) + { + switch (CurrentFont.Type) + { + case MetaWatch5: + pBitmap[row] = (unsigned int)MetaWatch5table[index][row]; + break; + + case MetaWatch7: + pBitmap[row] = (unsigned int)MetaWatch7table[index][row]; + break; + + case MetaWatch16: + pBitmap[row] = MetaWatch16table[index][row]; + break; + + case MetaWatchTime: + pBitmap[row] = MetaWatchTimeTable[index][row]; + break; + + default: + break; + } + + } + +} + +const unsigned char MetaWatch5table[PRINTABLE_CHARACTERS][5] = +{ + /* character 0x20 (' '): (width = 2) */ + 0x00, 0x00, 0x00, 0x00, 0x00, + + /* character 0x21 ('!'): (width=1) */ + 0x01, 0x01, 0x01, 0x00, 0x01, + + /* character 0x22 ('"'): (width=3) */ + 0x05, 0x05, 0x00, 0x00, 0x00, + + /* character 0x23 ('#'): (width=5) */ + 0x0A, 0x1F, 0x0A, 0x1F, 0x0A, + + /* character 0x24 ('$'): (width=3) */ + 0x00, 0x00, 0x00, 0x00, 0x00, + + /* character 0x25 ('%'): (width=3) */ + 0x00, 0x00, 0x00, 0x00, 0x00, + + /* character 0x26 ('&'): (width=5) */ + 0x02, 0x05, 0x16, 0x09, 0x1E, + + /* character 0x27 ('''): (width=1) */ + 0x01, 0x01, 0x00, 0x00, 0x00, + + /* character 0x28 ('('): (width=2) */ + 0x02, 0x01, 0x01, 0x01, 0x02, + + /* character 0x29 (')'): (width=2) */ + 0x01, 0x02, 0x02, 0x02, 0x01, + + /* character 0x2A ('*'): (width=5) */ + 0x0A, 0x04, 0x1F, 0x04, 0x0A, + + /* character 0x2B ('+'): (width=5) */ + 0x04, 0x04, 0x1F, 0x04, 0x04, + + /* character 0x2C (','): (width=1) */ + 0x00, 0x00, 0x00, 0x01, 0x01, + + /* character 0x2D ('-'): (width=3) */ + 0x00, 0x00, 0x07, 0x00, 0x00, + + /* character 0x2E ('.'): (width=1) */ + 0x00, 0x00, 0x00, 0x00, 0x01, + + /* character 0x2F ('/'): (width=5) */ + 0x10, 0x08, 0x04, 0x02, 0x01, + + /* character 0x30 ('0'): (width=4) */ + 0x06, 0x09, 0x09, 0x09, 0x06, + + /* character 0x31 ('1'): (width=3) */ + 0x03, 0x02, 0x02, 0x02, 0x07, + + /* character 0x32 ('2'): (width=4) */ + 0x06, 0x09, 0x04, 0x02, 0x0F, + + /* character 0x33 ('3'): (width=4) */ + 0x0F, 0x08, 0x06, 0x08, 0x07, + + /* character 0x34 ('4'): (width=4) */ + 0x04, 0x06, 0x05, 0x0F, 0x04, + + /* character 0x35 ('5'): (width=4) */ + 0x0F, 0x01, 0x0F, 0x08, 0x07, + + /* character 0x36 ('6'): (width=4) */ + 0x06, 0x01, 0x07, 0x09, 0x06, + + /* character 0x37 ('7'): (width=4) */ + 0x0F, 0x08, 0x04, 0x02, 0x02, + + /* character 0x38 ('8'): (width=4) */ + 0x06, 0x09, 0x06, 0x09, 0x06, + + /* character 0x39 ('9'): (width=4) */ + 0x06, 0x09, 0x0E, 0x08, 0x06, + + /* character 0x3A (':'): (width=1) */ + 0x00, 0x01, 0x00, 0x01, 0x00, + + /* character 0x3B (';'): (width=2) */ + 0x00, 0x02, 0x00, 0x02, 0x01, + + /* character 0x3C ('<'): (width=3) */ + 0x04, 0x02, 0x01, 0x02, 0x04, + + /* character 0x3D ('='): (width=4) */ + 0x00, 0x0F, 0x00, 0x0F, 0x00, + + /* character 0x3E ('>'): (width=3) */ + 0x01, 0x02, 0x04, 0x02, 0x01, + + /* character 0x3F ('?'): (width=3) */ + 0x03, 0x04, 0x02, 0x00, 0x02, + + /* character 0x40 ('@'): (width=3) */ + 0x00, 0x00, 0x00, 0x00, 0x00, + + /* character 0x41 ('A'): (width=5) */ + 0x04, 0x04, 0x0A, 0x0E, 0x11, + + /* character 0x42 ('B'): (width=4) */ + 0x07, 0x09, 0x07, 0x09, 0x07, + + /* character 0x43 ('C'): (width=4) */ + 0x06, 0x09, 0x01, 0x09, 0x06, + + /* character 0x44 ('D'): (width=4) */ + 0x07, 0x09, 0x09, 0x09, 0x07, + + /* character 0x45 ('E'): (width=4) */ + 0x0F, 0x01, 0x07, 0x01, 0x0F, + + /* character 0x46 ('F'): (width=4) */ + 0x0F, 0x01, 0x07, 0x01, 0x01, + + /* character 0x47 ('G'): (width=4) */ + 0x06, 0x01, 0x0D, 0x09, 0x06, + + /* character 0x48 ('H'): (width=4) */ + 0x09, 0x09, 0x0F, 0x09, 0x09, + + /* character 0x49 ('I'): (width=3) */ + 0x07, 0x02, 0x02, 0x02, 0x07, + + /* character 0x4A ('J'): (width=4) */ + 0x08, 0x08, 0x08, 0x09, 0x06, + + /* character 0x4B ('K'): (width=4) */ + 0x09, 0x05, 0x03, 0x05, 0x09, + + /* character 0x4C ('L'): (width=4) */ + 0x01, 0x01, 0x01, 0x01, 0x0F, + + /* character 0x4D ('M'): (width=5) */ + 0x11, 0x1B, 0x15, 0x11, 0x11, + + /* character 0x4E ('N'): (width=5) */ + 0x11, 0x13, 0x15, 0x19, 0x11, + + /* character 0x4F ('O'): (width=4) */ + 0x06, 0x09, 0x09, 0x09, 0x06, + + /* character 0x50 ('P'): (width=4) */ + 0x07, 0x09, 0x07, 0x01, 0x01, + + /* character 0x51 ('Q'): (width=5) */ + 0x06, 0x09, 0x09, 0x09, 0x1E, + + /* character 0x52 ('R'): (width=4) */ + 0x07, 0x09, 0x07, 0x09, 0x09, + + /* character 0x53 ('S'): (width=4) */ + 0x0E, 0x01, 0x06, 0x08, 0x07, + + /* character 0x54 ('T'): (width=3) */ + 0x07, 0x02, 0x02, 0x02, 0x02, + + /* character 0x55 ('U'): (width=4) */ + 0x09, 0x09, 0x09, 0x09, 0x06, + + /* character 0x56 ('V'): (width=5) */ + 0x11, 0x0A, 0x0A, 0x04, 0x04, + + /* character 0x57 ('W'): (width=5) */ + 0x15, 0x15, 0x0A, 0x0A, 0x0A, + + /* character 0x58 ('X'): (width=4) */ + 0x09, 0x09, 0x06, 0x09, 0x09, + + /* character 0x59 ('Y'): (width=5) */ + 0x11, 0x0A, 0x04, 0x04, 0x04, + + /* character 0x5A ('Z'): (width=4) */ + 0x0F, 0x04, 0x02, 0x01, 0x0F, + + /* character 0x5B ('['): (width=2) */ + 0x03, 0x01, 0x01, 0x01, 0x03, + + /* character 0x5C ('\'): (width=5) */ + 0x01, 0x02, 0x04, 0x08, 0x10, + + /* character 0x5D (']'): (width=2) */ + 0x03, 0x02, 0x02, 0x02, 0x03, + + /* character 0x5E ('^'): (width=5) */ + 0x04, 0x0A, 0x11, 0x00, 0x00, + + /* character 0x5F ('_'): (width=4) */ + 0x00, 0x00, 0x00, 0x00, 0x0F, + + /* character 0x60 ('`'): (width=1) */ + 0x01, 0x01, 0x00, 0x00, 0x00, + + /* character 0x61 ('a'): (width=5) */ + 0x04, 0x04, 0x0A, 0x0E, 0x11, + + /* character 0x62 ('b'): (width=4) */ + 0x07, 0x09, 0x07, 0x09, 0x07, + + /* character 0x63 ('c'): (width=4) */ + 0x06, 0x09, 0x01, 0x09, 0x06, + + /* character 0x64 ('d'): (width=4) */ + 0x07, 0x09, 0x09, 0x09, 0x07, + + /* character 0x65 ('e'): (width=4) */ + 0x0F, 0x01, 0x07, 0x01, 0x0F, + + /* character 0x66 ('f'): (width=4) */ + 0x0F, 0x01, 0x07, 0x01, 0x01, + + /* character 0x67 ('g'): (width=4) */ + 0x06, 0x01, 0x0D, 0x09, 0x06, + + /* character 0x68 ('h'): (width=4) */ + 0x09, 0x09, 0x0F, 0x09, 0x09, + + /* character 0x69 ('i'): (width=3) */ + 0x07, 0x02, 0x02, 0x02, 0x07, + + /* character 0x6A ('j'): (width=4) */ + 0x08, 0x08, 0x08, 0x09, 0x06, + + /* character 0x6B ('k'): (width=4) */ + 0x09, 0x05, 0x03, 0x05, 0x09, + + /* character 0x6C ('l'): (width=4) */ + 0x01, 0x01, 0x01, 0x01, 0x0F, + + /* character 0x6D ('m'): (width=5) */ + 0x11, 0x1B, 0x15, 0x11, 0x11, + + /* character 0x6E ('n'): (width=5) */ + 0x11, 0x13, 0x15, 0x19, 0x11, + + /* character 0x6F ('o'): (width=4) */ + 0x06, 0x09, 0x09, 0x09, 0x06, + + /* character 0x70 ('p'): (width=4) */ + 0x07, 0x09, 0x07, 0x01, 0x01, + + /* character 0x71 ('q'): (width=5) */ + 0x06, 0x09, 0x09, 0x09, 0x1E, + + /* character 0x72 ('r'): (width=4) */ + 0x07, 0x09, 0x07, 0x09, 0x09, + + /* character 0x73 ('s'): (width=4) */ + 0x0E, 0x01, 0x06, 0x08, 0x07, + + /* character 0x74 ('t'): (width=3) */ + 0x07, 0x02, 0x02, 0x02, 0x02, + + /* character 0x75 ('u'): (width=4) */ + 0x09, 0x09, 0x09, 0x09, 0x06, + + /* character 0x76 ('v'): (width=5) */ + 0x11, 0x0A, 0x0A, 0x04, 0x04, + + /* character 0x77 ('w'): (width=5) */ + 0x15, 0x15, 0x0A, 0x0A, 0x0A, + + /* character 0x78 ('x'): (width=4) */ + 0x09, 0x09, 0x06, 0x09, 0x09, + + /* character 0x79 ('y'): (width=5) */ + 0x11, 0x0A, 0x04, 0x04, 0x04, + + /* character 0x7A ('z'): (width=4) */ + 0x0F, 0x04, 0x02, 0x01, 0x0F, + + /* character 0x7B ('{'): (width=3) */ + 0x00, 0x00, 0x00, 0x00, 0x00, + + /* character 0x7C ('|'): (width=1) */ + 0x01, 0x01, 0x01, 0x01, 0x01, + + /* character 0x7D ('}'): (width=3) */ + 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +const unsigned char MetaWatch5width[PRINTABLE_CHARACTERS] = +{ +/* width char hexcode */ +/* ===== ==== ======= */ + 2, /* ' ' 20 */ + 1, /* ! 21 */ + 3, /* " 22 */ + 5, /* # 23 */ + 3, /* $ 24 */ + 3, /* % 25 */ + 5, /* & 26 */ + 1, /* ' 27 */ + 2, /* ( 28 */ + 2, /* ) 29 */ + 5, /* * 2A */ + 5, /* + 2B */ + 1, /* , 2C */ + 3, /* - 2D */ + 1, /* . 2E */ + 5, /* / 2F */ + 4, /* 0 30 */ + 3, /* 1 31 */ + 4, /* 2 32 */ + 4, /* 3 33 */ + 4, /* 4 34 */ + 4, /* 5 35 */ + 4, /* 6 36 */ + 4, /* 7 37 */ + 4, /* 8 38 */ + 4, /* 9 39 */ + 1, /* : 3A */ + 2, /* ; 3B */ + 3, /* < 3C */ + 4, /* = 3D */ + 3, /* > 3E */ + 3, /* ? 3F */ + 3, /* @ 40 */ + 5, /* A 41 */ + 4, /* B 42 */ + 4, /* C 43 */ + 4, /* D 44 */ + 4, /* E 45 */ + 4, /* F 46 */ + 4, /* G 47 */ + 4, /* H 48 */ + 3, /* I 49 */ + 4, /* J 4A */ + 4, /* K 4B */ + 4, /* L 4C */ + 5, /* M 4D */ + 5, /* N 4E */ + 4, /* O 4F */ + 4, /* P 50 */ + 5, /* Q 51 */ + 4, /* R 52 */ + 4, /* S 53 */ + 3, /* T 54 */ + 4, /* U 55 */ + 5, /* V 56 */ + 5, /* W 57 */ + 4, /* X 58 */ + 5, /* Y 59 */ + 4, /* Z 5A */ + 2, /* [ 5B */ + 5, /* \ 5C */ + 2, /* ] 5D */ + 5, /* ^ 5E */ + 4, /* _ 5F */ + 1, /* ` 60 */ + 5, /* a 61 */ + 4, /* b 62 */ + 4, /* c 63 */ + 4, /* d 64 */ + 4, /* e 65 */ + 4, /* f 66 */ + 4, /* g 67 */ + 4, /* h 68 */ + 3, /* i 69 */ + 4, /* j 6A */ + 4, /* k 6B */ + 4, /* l 6C */ + 5, /* m 6D */ + 5, /* n 6E */ + 4, /* o 6F */ + 4, /* p 70 */ + 5, /* q 71 */ + 4, /* r 72 */ + 4, /* s 73 */ + 3, /* t 74 */ + 4, /* u 75 */ + 5, /* v 76 */ + 5, /* w 77 */ + 4, /* x 78 */ + 5, /* y 79 */ + 4, /* z 7A */ + 3, /* { 7B */ + 1, /* | 7C */ + 3, /* } 7D */ +}; + +const unsigned char MetaWatch7table[PRINTABLE_CHARACTERS][7] = +{ + + /* character 0x20 (' '): (width = 2) */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + /* character 0x21 ('!'): (width=1) */ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, + + /* character 0x22 ('"'): (width=3) */ + 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, + + /* character 0x23 ('#'): (width=7) */ + 0x00, 0x28, 0x7E, 0x14, 0x3F, 0x0A, 0x00, + + /* character 0x24 ('$'): (width=5) */ + 0x04, 0x1E, 0x05, 0x0E, 0x14, 0x0F, 0x04, + + /* character 0x25 ('%'): (width=7) */ + 0x42, 0x25, 0x15, 0x2A, 0x54, 0x52, 0x21, + + /* character 0x26 ('&'): (width=5) */ + 0x02, 0x05, 0x05, 0x02, 0x15, 0x09, 0x16, + + /* character 0x27 ('''): (width=3) */ + 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, + + /* character 0x28 ('('): (width=3) */ + 0x04, 0x02, 0x01, 0x01, 0x01, 0x02, 0x04, + + /* character 0x29 (')'): (width=3) */ + 0x01, 0x02, 0x04, 0x04, 0x04, 0x02, 0x01, + + /* character 0x2A ('*'): (width=7) */ + 0x08, 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x08, + + /* character 0x2B ('+'): (width=5) */ + 0x00, 0x04, 0x04, 0x1F, 0x04, 0x04, 0x00, + + /* character 0x2C (','): (width=1) */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, + + /* character 0x2D ('-'): (width=4) */ + 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, + + /* character 0x2E ('.'): (width=1) */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + + /* character 0x2F ('/'): (width=4) */ + 0x08, 0x08, 0x04, 0x06, 0x02, 0x01, 0x01, + + /* character 0x30 ('0'): (width=4) */ + 0x06, 0x09, 0x09, 0x09, 0x09, 0x09, 0x06, + + /* character 0x31 ('1'): (width=2) */ + 0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, + + /* character 0x32 ('2'): (width=4) */ + 0x06, 0x09, 0x08, 0x04, 0x02, 0x01, 0x0F, + + /* character 0x33 ('3'): (width=4) */ + 0x06, 0x09, 0x08, 0x06, 0x08, 0x09, 0x06, + + /* character 0x34 ('4'): (width=5) */ + 0x04, 0x04, 0x0A, 0x09, 0x1F, 0x08, 0x08, + + /* character 0x35 ('5'): (width=4) */ + 0x0F, 0x01, 0x07, 0x08, 0x08, 0x09, 0x06, + + /* character 0x36 ('6'): (width=4) */ + 0x06, 0x01, 0x07, 0x09, 0x09, 0x09, 0x06, + + /* character 0x37 ('7'): (width=4) */ + 0x0F, 0x08, 0x04, 0x04, 0x02, 0x02, 0x02, + + /* character 0x38 ('8'): (width=4) */ + 0x06, 0x09, 0x09, 0x06, 0x09, 0x09, 0x06, + + /* character 0x39 ('9'): (width=4) */ + 0x06, 0x09, 0x09, 0x09, 0x0E, 0x08, 0x06, + + /* character 0x3A (':'): (width=1) */ + 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, + + /* character 0x3B (';'): (width=1) */ + 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, + + /* character 0x3C ('<'): (width=3) */ + 0x00, 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + + /* character 0x3D ('='): (width=4) */ + 0x00, 0x00, 0x0F, 0x00, 0x0F, 0x00, 0x00, + + /* character 0x3E ('>'): (width=3) */ + 0x00, 0x01, 0x02, 0x04, 0x02, 0x01, 0x00, + + /* character 0x3F ('?'): (width=4) */ + 0x07, 0x08, 0x04, 0x02, 0x02, 0x00, 0x02, + + /* character 0x40 ('@'): (width=7) */ + 0x3C, 0x42, 0x59, 0x55, 0x39, 0x02, 0x3C, + + /* character 0x41 ('A'): (width=7) */ + 0x08, 0x08, 0x14, 0x14, 0x3E, 0x22, 0x41, + + /* character 0x42 ('B'): (width=5) */ + 0x0F, 0x11, 0x11, 0x0F, 0x11, 0x11, 0x0F, + + /* character 0x43 ('C'): (width=5) */ + 0x0C, 0x12, 0x01, 0x01, 0x01, 0x12, 0x0C, + + /* character 0x44 ('D'): (width=5) */ + 0x07, 0x09, 0x11, 0x11, 0x11, 0x09, 0x07, + + /* character 0x45 ('E'): (width=4) */ + 0x0F, 0x01, 0x01, 0x07, 0x01, 0x01, 0x0F, + + /* character 0x46 ('F'): (width=4) */ + 0x0F, 0x01, 0x01, 0x07, 0x01, 0x01, 0x01, + + /* character 0x47 ('G'): (width=6) */ + 0x0C, 0x12, 0x01, 0x39, 0x21, 0x12, 0x0C, + + /* character 0x48 ('H'): (width=5) */ + 0x11, 0x11, 0x11, 0x1F, 0x11, 0x11, 0x11, + + /* character 0x49 ('I'): (width=3) */ + 0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07, + + /* character 0x4A ('J'): (width=5) */ + 0x10, 0x10, 0x10, 0x10, 0x10, 0x11, 0x0E, + + /* character 0x4B ('K'): (width=5) */ + 0x11, 0x09, 0x05, 0x03, 0x05, 0x09, 0x11, + + /* character 0x4C ('L'): (width=4) */ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0F, + + /* character 0x4D ('M'): (width=7) */ + 0x41, 0x63, 0x63, 0x55, 0x55, 0x49, 0x49, + + /* character 0x4E ('N'): (width=6) */ + 0x21, 0x23, 0x25, 0x2D, 0x29, 0x31, 0x21, + + /* character 0x4F ('O'): (width=6) */ + 0x0C, 0x12, 0x21, 0x21, 0x21, 0x12, 0x0C, + + /* character 0x50 ('P'): (width=4) */ + 0x07, 0x09, 0x09, 0x07, 0x01, 0x01, 0x01, + + /* character 0x51 ('Q'): (width=7) */ + 0x0C, 0x12, 0x21, 0x21, 0x21, 0x12, 0x6C, + + /* character 0x52 ('R'): (width=5) */ + 0x0F, 0x11, 0x11, 0x0F, 0x09, 0x11, 0x11, + + /* character 0x53 ('S'): (width=4) */ + 0x06, 0x09, 0x01, 0x06, 0x08, 0x09, 0x06, + + /* character 0x54 ('T'): (width=5) */ + 0x1F, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + + /* character 0x55 ('U'): (width=5) */ + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0E, + + /* character 0x56 ('V'): (width=7) */ + 0x41, 0x22, 0x22, 0x14, 0x14, 0x08, 0x08, + + /* character 0x57 ('W'): (width=7) */ + 0x49, 0x49, 0x49, 0x55, 0x55, 0x22, 0x22, + + /* character 0x58 ('X'): (width=5) */ + 0x11, 0x1B, 0x0A, 0x04, 0x0A, 0x1B, 0x11, + + /* character 0x59 ('Y'): (width=7) */ + 0x41, 0x22, 0x14, 0x08, 0x08, 0x08, 0x08, + + /* character 0x5A ('Z'): (width=5) */ + 0x1F, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1F, + + /* character 0x5B ('['): (width=3) */ + 0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07, + + /* character 0x5C ('\'): (width=4) */ + 0x01, 0x01, 0x02, 0x06, 0x04, 0x08, 0x08, + + /* character 0x5D (']'): (width=3) */ + 0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x07, + + /* character 0x5E ('^'): (width=5) */ + 0x04, 0x0A, 0x11, 0x00, 0x00, 0x00, 0x00, + + /* character 0x5F ('_'): (width=5) */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, + + /* character 0x60 ('`'): (width=1) */ + 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + + /* character 0x61 ('a'): (width=7) */ + 0x08, 0x08, 0x14, 0x14, 0x3E, 0x22, 0x41, + + /* character 0x62 ('b'): (width=5) */ + 0x0F, 0x11, 0x11, 0x0F, 0x11, 0x11, 0x0F, + + /* character 0x63 ('c'): (width=5) */ + 0x0C, 0x12, 0x01, 0x01, 0x01, 0x12, 0x0C, + + /* character 0x64 ('d'): (width=5) */ + 0x07, 0x09, 0x11, 0x11, 0x11, 0x09, 0x07, + + /* character 0x65 ('e'): (width=4) */ + 0x0F, 0x01, 0x01, 0x07, 0x01, 0x01, 0x0F, + + /* character 0x66 ('f'): (width=4) */ + 0x0F, 0x01, 0x01, 0x07, 0x01, 0x01, 0x01, + + /* character 0x67 ('g'): (width=6) */ + 0x0C, 0x12, 0x01, 0x39, 0x21, 0x12, 0x0C, + + /* character 0x68 ('h'): (width=5) */ + 0x11, 0x11, 0x11, 0x1F, 0x11, 0x11, 0x11, + + /* character 0x69 ('i'): (width=3) */ + 0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07, + + /* character 0x6A ('j'): (width=5) */ + 0x10, 0x10, 0x10, 0x10, 0x10, 0x11, 0x0E, + + /* character 0x6B ('k'): (width=5) */ + 0x11, 0x09, 0x05, 0x03, 0x05, 0x09, 0x11, + + /* character 0x6C ('l'): (width=4) */ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0F, + + /* character 0x6D ('m'): (width=7) */ + 0x41, 0x63, 0x63, 0x55, 0x55, 0x49, 0x49, + + /* character 0x6E ('n'): (width=6) */ + 0x21, 0x23, 0x25, 0x2D, 0x29, 0x31, 0x21, + + /* character 0x6F ('o'): (width=6) */ + 0x0C, 0x12, 0x21, 0x21, 0x21, 0x12, 0x0C, + + /* character 0x70 ('p'): (width=4) */ + 0x07, 0x09, 0x09, 0x07, 0x01, 0x01, 0x01, + + /* character 0x71 ('q'): (width=7) */ + 0x0C, 0x12, 0x21, 0x21, 0x21, 0x12, 0x6C, + + /* character 0x72 ('r'): (width=5) */ + 0x0F, 0x11, 0x11, 0x0F, 0x09, 0x11, 0x11, + + /* character 0x73 ('s'): (width=4) */ + 0x06, 0x09, 0x01, 0x06, 0x08, 0x09, 0x06, + + /* character 0x74 ('t'): (width=5) */ + 0x1F, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + + /* character 0x75 ('u'): (width=5) */ + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0E, + + /* character 0x76 ('v'): (width=7) */ + 0x41, 0x22, 0x22, 0x14, 0x14, 0x08, 0x08, + + /* character 0x77 ('w'): (width=7) */ + 0x49, 0x49, 0x49, 0x55, 0x55, 0x22, 0x22, + + /* character 0x78 ('x'): (width=5) */ + 0x11, 0x1B, 0x0A, 0x04, 0x0A, 0x1B, 0x11, + + /* character 0x79 ('y'): (width=7) */ + 0x41, 0x22, 0x14, 0x08, 0x08, 0x08, 0x08, + + /* character 0x7A ('z'): (width=5) */ + 0x1F, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1F, + + /* character 0x7B ('{'): (width=3) */ + 0x04, 0x02, 0x01, 0x01, 0x01, 0x02, 0x04, + + /* character 0x7C ('|'): (width=1) */ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + + /* character 0x7D ('}'): (width=3) */ + 0x01, 0x02, 0x04, 0x04, 0x04, 0x02, 0x01, + +}; + +const unsigned char MetaWatch7width[PRINTABLE_CHARACTERS] = { +/* width char hexcode */ +/* ===== ==== ======= */ + 2, /* ' ' 20 */ + 1, /* ! 21 */ + 3, /* " 22 */ + 7, /* # 23 */ + 5, /* $ 24 */ + 7, /* % 25 */ + 5, /* & 26 */ + 3, /* ' 27 */ + 3, /* ( 28 */ + 3, /* ) 29 */ + 7, /* * 2A */ + 5, /* + 2B */ + 1, /* , 2C */ + 4, /* - 2D */ + 1, /* . 2E */ + 4, /* / 2F */ + 4, /* 0 30 */ + 2, /* 1 31 */ + 4, /* 2 32 */ + 4, /* 3 33 */ + 5, /* 4 34 */ + 4, /* 5 35 */ + 4, /* 6 36 */ + 4, /* 7 37 */ + 4, /* 8 38 */ + 4, /* 9 39 */ + 1, /* : 3A */ + 1, /* ; 3B */ + 3, /* < 3C */ + 4, /* = 3D */ + 3, /* > 3E */ + 4, /* ? 3F */ + 7, /* @ 40 */ + 7, /* A 41 */ + 5, /* B 42 */ + 5, /* C 43 */ + 5, /* D 44 */ + 4, /* E 45 */ + 4, /* F 46 */ + 6, /* G 47 */ + 5, /* H 48 */ + 3, /* I 49 */ + 5, /* J 4A */ + 5, /* K 4B */ + 4, /* L 4C */ + 7, /* M 4D */ + 6, /* N 4E */ + 6, /* O 4F */ + 4, /* P 50 */ + 7, /* Q 51 */ + 5, /* R 52 */ + 4, /* S 53 */ + 5, /* T 54 */ + 5, /* U 55 */ + 7, /* V 56 */ + 7, /* W 57 */ + 5, /* X 58 */ + 7, /* Y 59 */ + 5, /* Z 5A */ + 3, /* [ 5B */ + 4, /* \ 5C */ + 3, /* ] 5D */ + 5, /* ^ 5E */ + 5, /* _ 5F */ + 1, /* ` 60 */ + 7, /* a 61 */ + 5, /* b 62 */ + 5, /* c 63 */ + 5, /* d 64 */ + 4, /* e 65 */ + 4, /* f 66 */ + 6, /* g 67 */ + 5, /* h 68 */ + 3, /* i 69 */ + 5, /* j 6A */ + 5, /* k 6B */ + 4, /* l 6C */ + 7, /* m 6D */ + 6, /* n 6E */ + 6, /* o 6F */ + 4, /* p 70 */ + 7, /* q 71 */ + 5, /* r 72 */ + 4, /* s 73 */ + 5, /* t 74 */ + 5, /* u 75 */ + 7, /* v 76 */ + 7, /* w 77 */ + 5, /* x 78 */ + 7, /* y 79 */ + 5, /* z 7A */ + 3, /* { 7B */ + 1, /* | 7C */ + 3, /* } 7D */ +}; + + +const unsigned int MetaWatch16table[PRINTABLE_CHARACTERS][16] = +{ + /* character 0x20 (' '): (width=4) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + + /* character 0x21 ('!'): (width=2) */ + 0x0000, 0x0000, 0x0003, 0x0003, + 0x0003, 0x0003, 0x0003, 0x0003, + 0x0003, 0x0003, 0x0000, 0x0003, + 0x0003, 0x0000, 0x0000, 0x0000, + + /* character 0x22 ('"'): (width=5) */ + 0x0000, 0x0012, 0x001B, 0x001B, + 0x0009, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + + /* character 0x23 ('#'): (width=12) */ + 0x0000, 0x0000, 0x0000, 0x0110, + 0x0198, 0x0FFE, 0x07FF, 0x0198, + 0x0198, 0x0FFE, 0x07FF, 0x0198, + 0x0088, 0x0000, 0x0000, 0x0000, + + /* character 0x24 ('$'): (width=6) */ + 0x000C, 0x000C, 0x001E, 0x003F, + 0x0033, 0x0003, 0x0007, 0x001E, + 0x0038, 0x0030, 0x0033, 0x003F, + 0x001E, 0x000C, 0x000C, 0x0000, + + /* character 0x25 ('%'): (width=10) */ + 0x0000, 0x020E, 0x031F, 0x039B, + 0x01DF, 0x00EE, 0x0070, 0x0038, + 0x01DC, 0x03EE, 0x0367, 0x03E3, + 0x01C1, 0x0000, 0x0000, 0x0000, + + /* character 0x26 ('&'): (width=10) */ + 0x0000, 0x0000, 0x001C, 0x003E, + 0x0036, 0x003E, 0x001C, 0x01BE, + 0x01F7, 0x00E3, 0x01F7, 0x03BE, + 0x031C, 0x0000, 0x0000, 0x0000, + + /* character 0x27 ('''): (width=2) */ + 0x0000, 0x0002, 0x0003, 0x0003, + 0x0001, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + + /* character 0x28 ('('): (width=4) */ + 0x0008, 0x0004, 0x0006, 0x0006, + 0x0003, 0x0003, 0x0003, 0x0003, + 0x0003, 0x0003, 0x0003, 0x0006, + 0x0006, 0x0004, 0x0008, 0x0000, + + /* character 0x29 (')'): (width=4) */ + 0x0001, 0x0002, 0x0006, 0x0006, + 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x0006, + 0x0006, 0x0002, 0x0001, 0x0000, + + /* character 0x2A ('*'): (width=8) */ + 0x0000, 0x0000, 0x0018, 0x0018, + 0x00DB, 0x00FF, 0x003C, 0x00FF, + 0x00DB, 0x0018, 0x0018, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + + /* character 0x2B ('+'): (width=8) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0018, 0x0018, 0x0018, 0x00FF, + 0x00FF, 0x0018, 0x0018, 0x0018, + 0x0000, 0x0000, 0x0000, 0x0000, + + /* character 0x2C (','): (width=2) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0002, + 0x0003, 0x0003, 0x0001, 0x0000, + + /* character 0x2D ('-'): (width=8) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x00FF, + 0x00FF, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + + /* character 0x2E ('.'): (width=2) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0003, + 0x0003, 0x0000, 0x0000, 0x0000, + + /* character 0x2F ('/'): (width=6) */ + 0x0000, 0x0000, 0x0000, 0x0030, + 0x0030, 0x0018, 0x0018, 0x000C, + 0x000C, 0x0006, 0x0006, 0x0003, + 0x0003, 0x0000, 0x0000, 0x0000, + + /* character 0x30 ('0'): (width=7) */ + 0x0000, 0x0000, 0x001C, 0x003E, + 0x0036, 0x0063, 0x0063, 0x0063, + 0x0063, 0x0063, 0x0036, 0x003E, + 0x001C, 0x0000, 0x0000, 0x0000, + + /* character 0x31 ('1'): (width=3) */ + 0x0000, 0x0000, 0x0006, 0x0007, + 0x0007, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0000, 0x0000, 0x0000, + + /* character 0x32 ('2'): (width=6) */ + 0x0000, 0x0000, 0x001E, 0x003F, + 0x0033, 0x0030, 0x0038, 0x001C, + 0x000E, 0x0007, 0x0003, 0x003F, + 0x003F, 0x0000, 0x0000, 0x0000, + + /* character 0x33 ('3'): (width=6) */ + 0x0000, 0x0000, 0x001E, 0x003F, + 0x0033, 0x0030, 0x001C, 0x003C, + 0x0030, 0x0030, 0x0033, 0x003F, + 0x001E, 0x0000, 0x0000, 0x0000, + + /* character 0x34 ('4'): (width=7) */ + 0x0000, 0x0000, 0x000C, 0x000C, + 0x000C, 0x0036, 0x0036, 0x0033, + 0x007F, 0x007F, 0x0030, 0x0030, + 0x0030, 0x0000, 0x0000, 0x0000, + + /* character 0x35 ('5'): (width=6) */ + 0x0000, 0x0000, 0x003F, 0x003F, + 0x0003, 0x0003, 0x001F, 0x003F, + 0x0030, 0x0030, 0x0033, 0x003F, + 0x001E, 0x0000, 0x0000, 0x0000, + + /* character 0x36 ('6'): (width=6) */ + 0x0000, 0x0000, 0x000C, 0x000E, + 0x0006, 0x0003, 0x001F, 0x003F, + 0x0033, 0x0033, 0x0033, 0x001F, + 0x001E, 0x0000, 0x0000, 0x0000, + + /* character 0x37 ('7'): (width=6) */ + 0x0000, 0x0000, 0x003F, 0x003F, + 0x0030, 0x0030, 0x0018, 0x0018, + 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x0000, 0x0000, 0x0000, + + /* character 0x38 ('8'): (width=6) */ + 0x0000, 0x0000, 0x001E, 0x003F, + 0x0033, 0x0033, 0x003F, 0x001E, + 0x0033, 0x0033, 0x0033, 0x003F, + 0x001E, 0x0000, 0x0000, 0x0000, + + /* character 0x39 ('9'): (width=6) */ + 0x0000, 0x0000, 0x001E, 0x003F, + 0x0033, 0x0033, 0x0033, 0x003F, + 0x003E, 0x0030, 0x0018, 0x001C, + 0x000C, 0x0000, 0x0000, 0x0000, + + /* character 0x3A (':'): (width=2) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0003, 0x0003, 0x0000, + 0x0000, 0x0003, 0x0003, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + + /* character 0x3B (';'): (width=2) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0003, 0x0003, 0x0000, + 0x0002, 0x0003, 0x0003, 0x0001, + 0x0000, 0x0000, 0x0000, 0x0000, + + /* character 0x3C ('<'): (width=8) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x00C0, 0x00F0, 0x003C, 0x000F, + 0x003C, 0x00F0, 0x00C0, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + + /* character 0x3D ('='): (width=7) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x007F, 0x007F, + 0x0000, 0x007F, 0x007F, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + + /* character 0x3E ('>'): (width=8) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0003, 0x000F, 0x003C, 0x00F0, + 0x003C, 0x000F, 0x0003, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + + /* character 0x3F ('?'): (width=6) */ + 0x0000, 0x0000, 0x001E, 0x003F, + 0x0033, 0x0030, 0x0018, 0x001C, + 0x000C, 0x000C, 0x0000, 0x000C, + 0x000C, 0x0000, 0x0000, 0x0000, + + /* character 0x40 ('@'): (width=11) */ + 0x0000, 0x0000, 0x01F8, 0x03FE, + 0x0706, 0x06F3, 0x06FB, 0x06DB, + 0x07FB, 0x03F3, 0x0006, 0x01FE, + 0x00F8, 0x0000, 0x0000, 0x0000, + + /* character 0x41 ('A'): (width=9) */ + 0x0000, 0x0000, 0x0010, 0x0010, + 0x0038, 0x0038, 0x006C, 0x006C, + 0x00C6, 0x00C6, 0x01FF, 0x0183, + 0x0183, 0x0000, 0x0000, 0x0000, + + /* character 0x42 ('B'): (width=7) */ + 0x0000, 0x0000, 0x003F, 0x007F, + 0x0063, 0x0063, 0x003F, 0x007F, + 0x0063, 0x0063, 0x0063, 0x007F, + 0x003F, 0x0000, 0x0000, 0x0000, + + /* character 0x43 ('C'): (width=7) */ + 0x0000, 0x0000, 0x003E, 0x007F, + 0x0063, 0x0003, 0x0003, 0x0003, + 0x0003, 0x0003, 0x0063, 0x007F, + 0x003E, 0x0000, 0x0000, 0x0000, + + /* character 0x44 ('D'): (width=7) */ + 0x0000, 0x0000, 0x003F, 0x007F, + 0x0063, 0x0063, 0x0063, 0x0063, + 0x0063, 0x0063, 0x0063, 0x007F, + 0x003F, 0x0000, 0x0000, 0x0000, + + /* character 0x45 ('E'): (width=7) */ + 0x0000, 0x0000, 0x007F, 0x007F, + 0x0003, 0x0003, 0x001F, 0x001F, + 0x0003, 0x0003, 0x0003, 0x007F, + 0x007F, 0x0000, 0x0000, 0x0000, + + /* character 0x46 ('F'): (width=6) */ + 0x0000, 0x0000, 0x003F, 0x003F, + 0x0003, 0x0003, 0x003F, 0x003F, + 0x0003, 0x0003, 0x0003, 0x0003, + 0x0003, 0x0000, 0x0000, 0x0000, + + /* character 0x47 ('G'): (width=7) */ + 0x0000, 0x0000, 0x003E, 0x007F, + 0x0063, 0x0003, 0x0003, 0x007B, + 0x007B, 0x0063, 0x0063, 0x007F, + 0x003E, 0x0000, 0x0000, 0x0000, + + /* character 0x48 ('H'): (width=7) */ + 0x0000, 0x0000, 0x0063, 0x0063, + 0x0063, 0x0063, 0x007F, 0x007F, + 0x0063, 0x0063, 0x0063, 0x0063, + 0x0063, 0x0000, 0x0000, 0x0000, + + /* character 0x49 ('I'): (width=4) */ + 0x0000, 0x0000, 0x000F, 0x000F, + 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0006, 0x0006, 0x000F, + 0x000F, 0x0000, 0x0000, 0x0000, + + /* character 0x4A ('J'): (width=6) */ + 0x0000, 0x0000, 0x0030, 0x0030, + 0x0030, 0x0030, 0x0030, 0x0030, + 0x0030, 0x0030, 0x0033, 0x003F, + 0x001E, 0x0000, 0x0000, 0x0000, + + /* character 0x4B ('K'): (width=7) */ + 0x0000, 0x0000, 0x0063, 0x0073, + 0x003B, 0x001F, 0x000F, 0x0007, + 0x000F, 0x001F, 0x003B, 0x0073, + 0x0063, 0x0000, 0x0000, 0x0000, + + /* character 0x4C ('L'): (width=6) */ + 0x0000, 0x0000, 0x0003, 0x0003, + 0x0003, 0x0003, 0x0003, 0x0003, + 0x0003, 0x0003, 0x0003, 0x003F, + 0x003F, 0x0000, 0x0000, 0x0000, + + /* character 0x4D ('M'): (width=11) */ + 0x0000, 0x0000, 0x0401, 0x0603, + 0x0707, 0x078F, 0x07DF, 0x06FB, + 0x0673, 0x0623, 0x0603, 0x0603, + 0x0603, 0x0000, 0x0000, 0x0000, + + /* character 0x4E ('N'): (width=9) */ + 0x0000, 0x0000, 0x0181, 0x0183, + 0x0187, 0x018F, 0x019F, 0x01BB, + 0x01F3, 0x01E3, 0x01C3, 0x0183, + 0x0103, 0x0000, 0x0000, 0x0000, + + /* character 0x4F ('O'): (width=7) */ + 0x0000, 0x0000, 0x003E, 0x007F, + 0x0063, 0x0063, 0x0063, 0x0063, + 0x0063, 0x0063, 0x0063, 0x007F, + 0x003E, 0x0000, 0x0000, 0x0000, + + /* character 0x50 ('P'): (width=7) */ + 0x0000, 0x0000, 0x003F, 0x007F, + 0x0063, 0x0063, 0x0063, 0x007F, + 0x003F, 0x0003, 0x0003, 0x0003, + 0x0003, 0x0000, 0x0000, 0x0000, + + /* character 0x51 ('Q'): (width=8) */ + 0x0000, 0x0000, 0x003E, 0x007F, + 0x0063, 0x0063, 0x0063, 0x0063, + 0x0063, 0x0063, 0x0063, 0x007F, + 0x003E, 0x00F0, 0x0060, 0x0000, + + /* character 0x52 ('R'): (width=7) */ + 0x0000, 0x0000, 0x003F, 0x007F, + 0x0063, 0x0063, 0x0063, 0x003F, + 0x007F, 0x0063, 0x0063, 0x0063, + 0x0063, 0x0000, 0x0000, 0x0000, + + /* character 0x53 ('S'): (width=6) */ + 0x0000, 0x0000, 0x001E, 0x003F, + 0x0033, 0x0003, 0x0007, 0x001E, + 0x0038, 0x0030, 0x0033, 0x003F, + 0x001E, 0x0000, 0x0000, 0x0000, + + /* character 0x54 ('T'): (width=6) */ + 0x0000, 0x0000, 0x003F, 0x003F, + 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x0000, 0x0000, 0x0000, + + /* character 0x55 ('U'): (width=7) */ + 0x0000, 0x0000, 0x0063, 0x0063, + 0x0063, 0x0063, 0x0063, 0x0063, + 0x0063, 0x0063, 0x0063, 0x007F, + 0x003E, 0x0000, 0x0000, 0x0000, + + /* character 0x56 ('V'): (width=7) */ + 0x0000, 0x0000, 0x0063, 0x0063, + 0x0063, 0x0036, 0x0036, 0x0036, + 0x001C, 0x001C, 0x001C, 0x0008, + 0x0008, 0x0000, 0x0000, 0x0000, + + /* character 0x57 ('W'): (width=11) */ + 0x0000, 0x0000, 0x0603, 0x0623, + 0x0623, 0x0376, 0x0376, 0x0376, + 0x01DC, 0x01DC, 0x01DC, 0x0088, + 0x0088, 0x0000, 0x0000, 0x0000, + + /* character 0x58 ('X'): (width=7) */ + 0x0000, 0x0000, 0x0063, 0x0063, + 0x0036, 0x0036, 0x001C, 0x001C, + 0x001C, 0x0036, 0x0036, 0x0063, + 0x0063, 0x0000, 0x0000, 0x0000, + + /* character 0x59 ('Y'): (width=8) */ + 0x0000, 0x0000, 0x00C3, 0x00C3, + 0x0066, 0x0066, 0x003C, 0x003C, + 0x0018, 0x0018, 0x0018, 0x0018, + 0x0018, 0x0000, 0x0000, 0x0000, + + /* character 0x5A ('Z'): (width=7) */ + 0x0000, 0x0000, 0x007F, 0x007F, + 0x0030, 0x0030, 0x0018, 0x0018, + 0x000C, 0x000E, 0x0006, 0x007F, + 0x007F, 0x0000, 0x0000, 0x0000, + + /* character 0x5B ('['): (width=4) */ + 0x000F, 0x000F, 0x0003, 0x0003, + 0x0003, 0x0003, 0x0003, 0x0003, + 0x0003, 0x0003, 0x0003, 0x0003, + 0x0003, 0x000F, 0x000F, 0x0000, + + /* character 0x5C ('\'): (width=6) */ + 0x0000, 0x0000, 0x0000, 0x0003, + 0x0003, 0x0006, 0x0006, 0x000C, + 0x000C, 0x0018, 0x0018, 0x0030, + 0x0030, 0x0000, 0x0000, 0x0000, + + /* character 0x5D (']'): (width=4) */ + 0x000F, 0x000F, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000F, 0x000F, 0x0000, + + /* character 0x5E ('^'): (width=7) */ + 0x0000, 0x0000, 0x0000, 0x0008, + 0x0008, 0x001C, 0x001C, 0x0036, + 0x0036, 0x0063, 0x0063, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + + /* character 0x5F ('_'): (width=9) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x01FF, 0x0000, 0x0000, 0x0000, + + /* character 0x60 ('`'): (width=3) */ + 0x0000, 0x0000, 0x0000, 0x0001, + 0x0003, 0x0006, 0x0004, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + + /* character 0x61 ('a'): (width=6) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x001E, 0x003F, 0x0030, + 0x003E, 0x003F, 0x0033, 0x003F, + 0x003E, 0x0000, 0x0000, 0x0000, + + /* character 0x62 ('b'): (width=6) */ + 0x0000, 0x0000, 0x0003, 0x0003, + 0x0003, 0x001F, 0x003F, 0x0033, + 0x0033, 0x0033, 0x0033, 0x003F, + 0x001F, 0x0000, 0x0000, 0x0000, + + /* character 0x63 ('c'): (width=6) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x001E, 0x003F, 0x0033, + 0x0003, 0x0003, 0x0033, 0x003F, + 0x001E, 0x0000, 0x0000, 0x0000, + + /* character 0x64 ('d'): (width=6) */ + 0x0000, 0x0000, 0x0030, 0x0030, + 0x0030, 0x003E, 0x003F, 0x0033, + 0x0033, 0x0033, 0x0033, 0x003F, + 0x003E, 0x0000, 0x0000, 0x0000, + + /* character 0x65 ('e'): (width=6) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x001E, 0x003F, 0x0033, + 0x003F, 0x003F, 0x0003, 0x003F, + 0x001E, 0x0000, 0x0000, 0x0000, + + /* character 0x66 ('f'): (width=4) */ + 0x0000, 0x0000, 0x000C, 0x000E, + 0x0006, 0x000F, 0x000F, 0x0006, + 0x0006, 0x0006, 0x0006, 0x0006, + 0x0006, 0x0000, 0x0000, 0x0000, + + /* character 0x67 ('g'): (width=6) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x003E, 0x003F, 0x0033, + 0x0033, 0x0033, 0x0033, 0x003F, + 0x003E, 0x0030, 0x003E, 0x001C, + + /* character 0x68 ('h'): (width=6) */ + 0x0000, 0x0000, 0x0003, 0x0003, + 0x0003, 0x001F, 0x003F, 0x0033, + 0x0033, 0x0033, 0x0033, 0x0033, + 0x0033, 0x0000, 0x0000, 0x0000, + + /* character 0x69 ('i'): (width=2) */ + 0x0000, 0x0000, 0x0003, 0x0003, + 0x0000, 0x0003, 0x0003, 0x0003, + 0x0003, 0x0003, 0x0003, 0x0003, + 0x0003, 0x0000, 0x0000, 0x0000, + + /* character 0x6A ('j'): (width=5) */ + 0x0000, 0x0000, 0x0018, 0x0018, + 0x0000, 0x0018, 0x0018, 0x0018, + 0x0018, 0x0018, 0x0018, 0x0018, + 0x0018, 0x0018, 0x001F, 0x000E, + + /* character 0x6B ('k'): (width=6) */ + 0x0000, 0x0000, 0x0003, 0x0003, + 0x0003, 0x0033, 0x003B, 0x001F, + 0x000F, 0x000F, 0x001F, 0x003B, + 0x0033, 0x0000, 0x0000, 0x0000, + + /* character 0x6C ('l'): (width=2) */ + 0x0000, 0x0000, 0x0003, 0x0003, + 0x0003, 0x0003, 0x0003, 0x0003, + 0x0003, 0x0003, 0x0003, 0x0003, + 0x0003, 0x0000, 0x0000, 0x0000, + + /* character 0x6D ('m'): (width=10) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x01DB, 0x03FF, 0x0377, + 0x0333, 0x0333, 0x0333, 0x0333, + 0x0333, 0x0000, 0x0000, 0x0000, + + /* character 0x6E ('n'): (width=6) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x001B, 0x003F, 0x0037, + 0x0033, 0x0033, 0x0033, 0x0033, + 0x0033, 0x0000, 0x0000, 0x0000, + + /* character 0x6F ('o'): (width=6) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x001E, 0x003F, 0x0033, + 0x0033, 0x0033, 0x0033, 0x003F, + 0x001E, 0x0000, 0x0000, 0x0000, + + /* character 0x70 ('p'): (width=6) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x001F, 0x003F, 0x0033, + 0x0033, 0x0033, 0x0033, 0x001F, + 0x001F, 0x0003, 0x0003, 0x0003, + + /* character 0x71 ('q'): (width=6) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x003E, 0x003F, 0x0033, + 0x0033, 0x0033, 0x0033, 0x003E, + 0x003E, 0x0030, 0x0030, 0x0030, + + /* character 0x72 ('r'): (width=5) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x001B, 0x001F, 0x0007, + 0x0003, 0x0003, 0x0003, 0x0003, + 0x0003, 0x0000, 0x0000, 0x0000, + + /* character 0x73 ('s'): (width=5) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x000E, 0x001F, 0x0003, + 0x000F, 0x001E, 0x0018, 0x001F, + 0x000E, 0x0000, 0x0000, 0x0000, + + /* character 0x74 ('t'): (width=4) */ + 0x0000, 0x0000, 0x0004, 0x0006, + 0x0006, 0x000F, 0x000F, 0x0006, + 0x0006, 0x0006, 0x0006, 0x000E, + 0x000C, 0x0000, 0x0000, 0x0000, + + /* character 0x75 ('u'): (width=6) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0033, 0x0033, 0x0033, + 0x0033, 0x0033, 0x0033, 0x003F, + 0x003E, 0x0000, 0x0000, 0x0000, + + /* character 0x76 ('v'): (width=7) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0063, 0x0063, 0x0036, + 0x0036, 0x001C, 0x001C, 0x0008, + 0x0008, 0x0000, 0x0000, 0x0000, + + /* character 0x77 ('w'): (width=11) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0623, 0x0623, 0x0376, + 0x0376, 0x01DC, 0x01DC, 0x0088, + 0x0088, 0x0000, 0x0000, 0x0000, + + /* character 0x78 ('x'): (width=7) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0063, 0x0077, 0x003E, + 0x001C, 0x001C, 0x003E, 0x0077, + 0x0063, 0x0000, 0x0000, 0x0000, + + /* character 0x79 ('y'): (width=6) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0033, 0x0033, 0x0033, + 0x0033, 0x0033, 0x0033, 0x003F, + 0x003E, 0x0030, 0x003E, 0x001C, + + /* character 0x7A ('z'): (width=6) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x003F, 0x003F, 0x0030, + 0x0018, 0x000C, 0x0006, 0x003F, + 0x003F, 0x0000, 0x0000, 0x0000, + + /* character 0x7B ('{'): (width=4) */ + 0x0008, 0x0004, 0x0006, 0x0006, + 0x0003, 0x0003, 0x0003, 0x0003, + 0x0003, 0x0003, 0x0003, 0x0006, + 0x0006, 0x0004, 0x0008, 0x0000, + + /* character 0x7C ('|'): (width=2) */ + 0x0000, 0x0003, 0x0003, 0x0003, + 0x0003, 0x0003, 0x0000, 0x0000, + 0x0003, 0x0003, 0x0003, 0x0003, + 0x0003, 0x0000, 0x0000, 0x0000, + + /* character 0x7D ('}'): (width=4) */ + 0x0001, 0x0002, 0x0006, 0x0006, + 0x000C, 0x000C, 0x000C, 0x000C, + 0x000C, 0x000C, 0x000C, 0x0006, + 0x0006, 0x0002, 0x0001, 0x0000, + +}; + +const unsigned char MetaWatch16width[PRINTABLE_CHARACTERS] = +{ +/* width char hexcode */ +/* ===== ==== ======= */ + 4, /* ' ' 20 */ + 2, /* ! 21 */ + 5, /* " 22 */ + 12, /* # 23 */ + 6, /* $ 24 */ + 10, /* % 25 */ + 10, /* & 26 */ + 2, /* ' 27 */ + 4, /* ( 28 */ + 4, /* ) 29 */ + 8, /* * 2A */ + 8, /* + 2B */ + 2, /* , 2C */ + 8, /* - 2D */ + 2, /* . 2E */ + 6, /* / 2F */ + 7, /* 0 30 */ + 3, /* 1 31 */ + 6, /* 2 32 */ + 6, /* 3 33 */ + 7, /* 4 34 */ + 6, /* 5 35 */ + 6, /* 6 36 */ + 6, /* 7 37 */ + 6, /* 8 38 */ + 6, /* 9 39 */ + 2, /* : 3A */ + 2, /* ; 3B */ + 8, /* < 3C */ + 7, /* = 3D */ + 8, /* > 3E */ + 6, /* ? 3F */ + 11, /* @ 40 */ + 9, /* A 41 */ + 7, /* B 42 */ + 7, /* C 43 */ + 7, /* D 44 */ + 7, /* E 45 */ + 6, /* F 46 */ + 7, /* G 47 */ + 7, /* H 48 */ + 4, /* I 49 */ + 6, /* J 4A */ + 7, /* K 4B */ + 6, /* L 4C */ + 11, /* M 4D */ + 9, /* N 4E */ + 7, /* O 4F */ + 7, /* P 50 */ + 8, /* Q 51 */ + 7, /* R 52 */ + 6, /* S 53 */ + 6, /* T 54 */ + 7, /* U 55 */ + 7, /* V 56 */ + 11, /* W 57 */ + 7, /* X 58 */ + 8, /* Y 59 */ + 7, /* Z 5A */ + 4, /* [ 5B */ + 6, /* \ 5C */ + 4, /* ] 5D */ + 7, /* ^ 5E */ + 9, /* _ 5F */ + 3, /* ` 60 */ + 6, /* a 61 */ + 6, /* b 62 */ + 6, /* c 63 */ + 6, /* d 64 */ + 6, /* e 65 */ + 4, /* f 66 */ + 6, /* g 67 */ + 6, /* h 68 */ + 2, /* i 69 */ + 5, /* j 6A */ + 6, /* k 6B */ + 2, /* l 6C */ + 10, /* m 6D */ + 6, /* n 6E */ + 6, /* o 6F */ + 6, /* p 70 */ + 6, /* q 71 */ + 5, /* r 72 */ + 5, /* s 73 */ + 4, /* t 74 */ + 6, /* u 75 */ + 7, /* v 76 */ + 11, /* w 77 */ + 7, /* x 78 */ + 6, /* y 79 */ + 6, /* z 7A */ + 4, /* { 7B */ + 2, /* | 7C */ + 4, /* } 7D */ +}; + +/******************************************************************************/ +const unsigned int MetaWatchTimeTable[TOTAL_TIME_CHARACTERS][19] = +{ + /* character 0x30 ('0'): (width=11, offset=0) */ + 0x01FC, 0x03FE, 0x07FF, 0x07FF, + 0x078F, 0x078F, 0x078F, 0x078F, + 0x078F, 0x078F, 0x078F, 0x078F, + 0x078F, 0x078F, 0x078F, 0x07FF, + 0x07FF, 0x03FE, 0x01FC, + + /* character 0x31 ('1'): (width=11, offset=38) */ + 0x01C0, 0x01E0, 0x01F8, 0x01F8, + 0x01F8, 0x01F8, 0x01E0, 0x01E0, + 0x01E0, 0x01E0, 0x01E0, 0x01E0, + 0x01E0, 0x01E0, 0x01E0, 0x01E0, + 0x01E0, 0x01E0, 0x01E0, + + /* character 0x32 ('2'): (width=11, offset=76) */ + 0x01FC, 0x03FE, 0x07FF, 0x07FF, + 0x078F, 0x078F, 0x0780, 0x07C0, + 0x07E0, 0x03F0, 0x01F8, 0x00FC, + 0x007E, 0x003F, 0x001F, 0x07FF, + 0x07FF, 0x07FF, 0x07FF, + + /* character 0x33 ('3'): (width=11, offset=114) */ + 0x01FC, 0x03FE, 0x07FF, 0x07FF, + 0x078F, 0x078F, 0x0780, 0x07C0, + 0x03F0, 0x01F0, 0x03F0, 0x07C0, + 0x0780, 0x078F, 0x078F, 0x07FF, + 0x07FF, 0x03FE, 0x01FC, + + /* character 0x34 ('4'): (width=11, offset=152) */ + 0x003C, 0x07BC, 0x07BC, 0x079E, + 0x079E, 0x078F, 0x078F, 0x07FF, + 0x07FF, 0x07FF, 0x07FF, 0x0780, + 0x0780, 0x0780, 0x0780, 0x0780, + 0x0780, 0x0780, 0x0780, + + /* character 0x35 ('5'): (width=11, offset=190) */ + 0x07FF, 0x07FF, 0x07FF, 0x07FF, + 0x000F, 0x000F, 0x000F, 0x03FF, + 0x07FF, 0x07FF, 0x07FF, 0x0780, + 0x0780, 0x0780, 0x07C0, 0x07FF, + 0x03FF, 0x03FF, 0x00FF, + + /* character 0x36 ('6'): (width=11, offset=228) */ + 0x01F0, 0x01FC, 0x01FE, 0x01FE, + 0x001F, 0x000F, 0x000F, 0x01FF, + 0x03FF, 0x07FF, 0x07FF, 0x078F, + 0x078F, 0x078F, 0x078F, 0x07FF, + 0x07FF, 0x03FE, 0x01FC, + + /* character 0x37 ('7'): (width=11, offset=266) */ + 0x07FF, 0x07FF, 0x07FF, 0x07FF, + 0x0780, 0x07C0, 0x03C0, 0x03E0, + 0x01E0, 0x01F0, 0x00F0, 0x00F8, + 0x0078, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0078, + + /* character 0x38 ('8'): (width=11, offset=304) */ + 0x01FC, 0x03FE, 0x07FF, 0x07FF, + 0x078F, 0x078F, 0x078F, 0x07FF, + 0x07FF, 0x03FE, 0x07FF, 0x078F, + 0x078F, 0x078F, 0x078F, 0x07FF, + 0x07FF, 0x03FE, 0x01FC, + + /* character 0x39 ('9'): (width=11, offset=342) */ + 0x01FC, 0x03FE, 0x07FF, 0x07FF, + 0x078F, 0x078F, 0x078F, 0x078F, + 0x07FF, 0x07FF, 0x07FE, 0x07FC, + 0x0780, 0x0780, 0x07C0, 0x03FC, + 0x03FC, 0x01FC, 0x007C, + + /* character 0x3A (':'): (width=4, offset=380) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0006, 0x000F, 0x000F, 0x0006, + 0x0000, 0x0000, 0x0000, 0x0006, + 0x000F, 0x000F, 0x0006, 0x0000, + 0x0000, 0x0000, 0x0000, + + /* character 0x3B (';'): (width=11, offset=418) */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, +}; + +const unsigned char MetaWatchTimeWidth[TOTAL_TIME_CHARACTERS] = +{ +/* width char hexcode */ +/* ===== ==== ======= */ + 11, /* 0 30 */ + 11, /* 1 31 */ + 11, /* 2 32 */ + 11, /* 3 33 */ + 11, /* 4 34 */ + 11, /* 5 35 */ + 11, /* 6 36 */ + 11, /* 7 37 */ + 11, /* 8 38 */ + 11, /* 9 39 */ + 4, /* : 3A */ + 11, /* ' ' 3B */ +}; + +/******************************************************************************/ + +const unsigned char MetaWatchMonospaced10[PRINTABLE_CHARACTERS][10] = +{ + 0x00,0x00,0x10,0x38,0x38,0x10,0x10,0x00,0x10,0x00, + 0x00,0x00,0x6C,0x6C,0x24,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x28,0x7C,0x28,0x28,0x7C,0x28,0x00, + 0x00,0x00,0x10,0x70,0x08,0x30,0x40,0x38,0x20,0x00, + 0x00,0x00,0x4C,0x4C,0x20,0x10,0x08,0x64,0x64,0x00, + 0x00,0x00,0x08,0x14,0x14,0x08,0x54,0x24,0x58,0x00, + 0x00,0x00,0x18,0x18,0x10,0x08,0x00,0x00,0x00,0x00, + 0x00,0x00,0x10,0x08,0x08,0x08,0x08,0x08,0x10,0x00, + 0x00,0x00,0x10,0x20,0x20,0x20,0x20,0x20,0x10,0x00, + 0x00,0x00,0x92,0x54,0x38,0xFE,0x38,0x54,0x92,0x00, + 0x00,0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x10,0x08, + 0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00, + 0x00,0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x00,0x00, + 0x00,0x00,0x38,0x44,0x64,0x54,0x4C,0x44,0x38,0x00, + 0x00,0x00,0x10,0x18,0x10,0x10,0x10,0x10,0x38,0x00, + 0x00,0x00,0x38,0x44,0x40,0x30,0x08,0x04,0x7C,0x00, + 0x00,0x00,0x38,0x44,0x40,0x38,0x40,0x44,0x38,0x00, + 0x00,0x00,0x20,0x30,0x28,0x24,0x7C,0x20,0x20,0x00, + 0x00,0x00,0x7C,0x04,0x04,0x3C,0x40,0x44,0x38,0x00, + 0x00,0x00,0x30,0x08,0x04,0x3C,0x44,0x44,0x38,0x00, + 0x00,0x00,0x7C,0x40,0x20,0x10,0x08,0x08,0x08,0x00, + 0x00,0x00,0x38,0x44,0x44,0x38,0x44,0x44,0x38,0x00, + 0x00,0x00,0x38,0x44,0x44,0x78,0x40,0x20,0x18,0x00, + 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x00, + 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x10, + 0x00,0x00,0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x00, + 0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x7C,0x00,0x00, + 0x00,0x00,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x00, + 0x00,0x00,0x38,0x44,0x40,0x30,0x10,0x00,0x10,0x00, + 0x00,0x00,0x38,0x44,0x74,0x54,0x74,0x04,0x38,0x00, + 0x00,0x00,0x38,0x44,0x44,0x44,0x7C,0x44,0x44,0x00, + 0x00,0x00,0x3C,0x44,0x44,0x3C,0x44,0x44,0x3C,0x00, + 0x00,0x00,0x38,0x44,0x04,0x04,0x04,0x44,0x38,0x00, + 0x00,0x00,0x3C,0x44,0x44,0x44,0x44,0x44,0x3C,0x00, + 0x00,0x00,0x7C,0x04,0x04,0x3C,0x04,0x04,0x7C,0x00, + 0x00,0x00,0x7C,0x04,0x04,0x3C,0x04,0x04,0x04,0x00, + 0x00,0x00,0x38,0x44,0x04,0x74,0x44,0x44,0x78,0x00, + 0x00,0x00,0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x00, + 0x00,0x00,0x38,0x10,0x10,0x10,0x10,0x10,0x38,0x00, + 0x00,0x00,0x40,0x40,0x40,0x40,0x44,0x44,0x38,0x00, + 0x00,0x00,0x44,0x24,0x14,0x0C,0x14,0x24,0x44,0x00, + 0x00,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x7C,0x00, + 0x00,0x00,0x44,0x6C,0x54,0x44,0x44,0x44,0x44,0x00, + 0x00,0x00,0x44,0x4C,0x54,0x64,0x44,0x44,0x44,0x00, + 0x00,0x00,0x38,0x44,0x44,0x44,0x44,0x44,0x38,0x00, + 0x00,0x00,0x3C,0x44,0x44,0x3C,0x04,0x04,0x04,0x00, + 0x00,0x00,0x38,0x44,0x44,0x44,0x54,0x24,0x58,0x00, + 0x00,0x00,0x3C,0x44,0x44,0x3C,0x24,0x44,0x44,0x00, + 0x00,0x00,0x38,0x44,0x04,0x38,0x40,0x44,0x38,0x00, + 0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x00, + 0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x44,0x38,0x00, + 0x00,0x00,0x44,0x44,0x44,0x44,0x44,0x28,0x10,0x00, + 0x00,0x00,0x44,0x44,0x54,0x54,0x54,0x54,0x28,0x00, + 0x00,0x00,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x00, + 0x00,0x00,0x44,0x44,0x44,0x28,0x10,0x10,0x10,0x00, + 0x00,0x00,0x7C,0x40,0x20,0x10,0x08,0x04,0x7C,0x00, + 0x00,0x00,0x38,0x08,0x08,0x08,0x08,0x08,0x38,0x00, + 0x00,0x00,0x00,0x04,0x08,0x10,0x20,0x40,0x00,0x00, + 0x00,0x00,0x38,0x20,0x20,0x20,0x20,0x20,0x38,0x00, + 0x00,0x00,0x10,0x28,0x44,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00, + 0x00,0x18,0x18,0x08,0x10,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x38,0x40,0x78,0x44,0x78,0x00, + 0x00,0x00,0x04,0x04,0x3C,0x44,0x44,0x44,0x3C,0x00, + 0x00,0x00,0x00,0x00,0x38,0x44,0x04,0x44,0x38,0x00, + 0x00,0x00,0x40,0x40,0x78,0x44,0x44,0x44,0x78,0x00, + 0x00,0x00,0x00,0x00,0x38,0x44,0x3C,0x04,0x38,0x00, + 0x00,0x00,0x60,0x10,0x10,0x78,0x10,0x10,0x10,0x00, + 0x00,0x00,0x00,0x78,0x44,0x44,0x78,0x40,0x38,0x00, + 0x00,0x00,0x08,0x08,0x38,0x48,0x48,0x48,0x48,0x00, + 0x00,0x00,0x10,0x00,0x10,0x10,0x10,0x10,0x10,0x00, + 0x00,0x00,0x40,0x00,0x60,0x40,0x40,0x40,0x48,0x30, + 0x00,0x00,0x08,0x08,0x48,0x28,0x18,0x28,0x48,0x00, + 0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00, + 0x00,0x00,0x00,0x00,0x2C,0x54,0x54,0x44,0x44,0x00, + 0x00,0x00,0x00,0x00,0x38,0x48,0x48,0x48,0x48,0x00, + 0x00,0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x38,0x00, + 0x00,0x00,0x00,0x00,0x3C,0x44,0x44,0x3C,0x04,0x04, + 0x00,0x00,0x00,0x00,0x78,0x44,0x44,0x78,0x40,0x40, + 0x00,0x00,0x00,0x00,0x34,0x48,0x08,0x08,0x1C,0x00, + 0x00,0x00,0x00,0x00,0x38,0x04,0x38,0x40,0x38,0x00, + 0x00,0x00,0x00,0x10,0x78,0x10,0x10,0x50,0x20,0x00, + 0x00,0x00,0x00,0x00,0x48,0x48,0x48,0x68,0x50,0x00, + 0x00,0x00,0x00,0x00,0x44,0x44,0x44,0x28,0x10,0x00, + 0x00,0x00,0x00,0x00,0x44,0x44,0x54,0x7C,0x28,0x00, + 0x00,0x00,0x00,0x00,0x44,0x28,0x10,0x28,0x44,0x00, + 0x00,0x00,0x00,0x00,0x48,0x48,0x48,0x70,0x40,0x70, + 0x00,0x00,0x00,0x00,0x78,0x40,0x30,0x08,0x78,0x00, + 0x00,0x00,0x30,0x08,0x08,0x0C,0x08,0x08,0x30,0x00, + 0x00,0x00,0x10,0x10,0x10,0x00,0x10,0x10,0x10,0x00, + 0x00,0x00,0x18,0x20,0x20,0x60,0x20,0x20,0x18,0x00, + 0x00,0x00,0x00,0x50,0x28,0x00,0x00,0x00,0x00,0x00, +}; + diff --git a/ui/Fonts.h b/ui/Fonts.h new file mode 100644 index 0000000..42576c0 --- /dev/null +++ b/ui/Fonts.h @@ -0,0 +1,121 @@ +//============================================================================== +// Copyright 2011 Meta Watch Ltd. - http://www.MetaWatch.org/ +// +// Licensed under the Meta Watch License, Version 1.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.MetaWatch.org/licenses/license-1.0.html +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//============================================================================== + +/******************************************************************************/ +/*! \file Fonts.h +* +* Fonts functions common to OLED and LCD version +* +* LCD is ROW based, OLED is column based +*/ +/******************************************************************************/ + +#ifndef FONTS_H +#define FONTS_H + +/*! There are three fonts defined for the MetaWatch LCD + * they are 5, 7 and 16 pixels tall with variable width + */ +typedef enum +{ + MetaWatch5, + MetaWatch7, + MetaWatch16, + MetaWatchTime, + MetaWatch5Oled, + MetaWatch7Oled, + MetaWatch16Oled, + MetaWatchIconOled + +} etFontType; + +/*! Use to size the bitmap used in the Display Task for printing characters FOR + * THE LCD VERSION + */ +#define MAX_FONT_ROWS ( 19 ) + +/*! The maximum number of columns any font (or icon) requires. This is + * used to define the size of the bitmap passed into font functions FOR THE + * OLED version + */ +#define MAX_FONT_COLUMNS ( 30 ) + +#define TOTAL_TIME_CHARACTERS ( 12 ) +#define TIME_CHARACTER_COLON_INDEX ( 10 ) +#define TIME_CHARACTER_SPACE_INDEX ( 11 ) + +/*! Convert a character into an index into the font table + * + * \param CharIn is the input character + * \return Index into the table + */ +unsigned char MapCharacterToIndex(unsigned char CharIn); + +/*! Convert a digit (0-9) into an index into the font table + * + * \param Digit is a number + * \return Index into the table + */ +unsigned char MapDigitToIndex(unsigned char Digit); + +/*! Get the bitmap for the specified character + * + * \param Character is the desired character + * \param pBitmap pointer to an array of integers that holds the bitmap + * + * \note pBitmap must point to an object large enough to hold the largest bitmap + * + * \note For the LCD bitmaps the font height is the same as number of rows. + * If the width is less than 8 then each row is a byte. + * If the width is less than 16 but > 8 then each row is a word. + * The function works with ints so that it is generic for both types + * + */ +void GetCharacterBitmap(unsigned char Character,unsigned int * pBitmap); + +/*! Get the width for a specified character * + * + * \param Character is the desired character + * \return Width of character in columns + */ +unsigned char GetCharacterWidth(unsigned char Character); + +/*! Set the font type used for future Get operations * + * + * \param Type of font + */ +void SetFont(etFontType Type); + +/*! Set the font spacing for the current font* + * + * \param Spacing is the number of columns between characters + * + * \note The characters do not have any 'natural' spacing between them + */ +void SetFontSpacing(unsigned char Spacing); + +/*! + * \return The font spacing in columns + */ +unsigned char GetFontSpacing(void); + + +/*! + * \return The font height in rows + */ +unsigned char GetCharacterHeight(void); + +#endif /*FONTS_H*/ diff --git a/ui/LcdDisplay.c b/ui/LcdDisplay.c new file mode 100644 index 0000000..ee88652 --- /dev/null +++ b/ui/LcdDisplay.c @@ -0,0 +1,73 @@ +#include +#include +#include + +#include "oswald-ui.h" +#include "Fonts.h" +#include "LcdDisplay.h" + +#define NUM_LCD_ROWS 96 +#define NUM_LCD_COL_BYTES ( 12 ) +#define MAX_FONT_ROWS ( 19 ) + + +gint WriteLcdCharacter(oswald_ui *ui, gint x, gint y, unsigned char Character) +{ + gint CharacterHeight = GetCharacterHeight(); + gint CharacterWidth = GetCharacterWidth(Character); + unsigned int bitmap[MAX_FONT_ROWS]; + gint lx, ly; + + GetCharacterBitmap(Character,(unsigned int*)&bitmap); + + // printf("cw=%d ch=%d\n", CharacterWidth, CharacterHeight); + for (ly=0; ly +#include "oswald-ui.h" +#include "Fonts.h" // the MetaWatch fonts -typedef struct { - GtkWidget *mainwin; - GtkDrawingArea *darea; - GdkPixmap *pixmap; -} oswald_ui; - - +#define BITMAP_WIDTH 192 +#define BITMAP_HEIGHT 192 void set_pixel(oswald_ui *ui, gint x, gint y, gboolean state) { GdkRectangle update_rect; - GdkGC *gc; gint ix, iy; ix = x*2; @@ -35,10 +31,29 @@ void set_pixel(oswald_ui *ui, gint x, gint y, gboolean state) update_rect.width = 10; update_rect.height = 10; - gdk_draw_point(GDK_DRAWABLE(ui->pixmap), state ? ui->mainwin->style->black_gc : ui->mainwin->style->white_gc, ix, iy); - gdk_draw_point(GDK_DRAWABLE(ui->pixmap), state ? ui->mainwin->style->black_gc : ui->mainwin->style->white_gc, ix+1, iy); - gdk_draw_point(GDK_DRAWABLE(ui->pixmap), state ? ui->mainwin->style->black_gc : ui->mainwin->style->white_gc, ix, iy+1); - gdk_draw_point(GDK_DRAWABLE(ui->pixmap), state ? ui->mainwin->style->black_gc : ui->mainwin->style->white_gc, ix+1, iy+1); + gdk_draw_point(GDK_DRAWABLE(ui->pixmap), state ? ui->darea->style->black_gc : ui->darea->style->white_gc, ix, iy); + gdk_draw_point(GDK_DRAWABLE(ui->pixmap), state ? ui->darea->style->black_gc : ui->darea->style->white_gc, ix+1, iy); + gdk_draw_point(GDK_DRAWABLE(ui->pixmap), state ? ui->darea->style->black_gc : ui->darea->style->white_gc, ix, iy+1); + gdk_draw_point(GDK_DRAWABLE(ui->pixmap), state ? ui->darea->style->black_gc : ui->darea->style->white_gc, ix+1, iy+1); + + gtk_widget_draw (GTK_WIDGET(ui->darea), &update_rect); +} + +void clear_display(oswald_ui *ui) +{ + GdkRectangle update_rect; + + update_rect.x = 0; + update_rect.y = 0; + update_rect.width = BITMAP_WIDTH; + update_rect.height = BITMAP_HEIGHT; + + gdk_draw_rectangle (ui->pixmap, + ui->darea->style->white_gc, + TRUE, + 0, 0, + ui->darea->allocation.width, + ui->darea->allocation.height); gtk_widget_draw (GTK_WIDGET(ui->darea), &update_rect); } @@ -96,18 +111,18 @@ static void create_mainwin(oswald_ui *ui) vb = gtk_vbox_new(FALSE, 5); gtk_box_pack_start (GTK_BOX(hb), vb, FALSE, FALSE, 5); - btn = gtk_button_new_with_label("D"); + btn = gtk_button_new_with_label(" D "); gtk_box_pack_start (GTK_BOX(vb), btn, FALSE, FALSE, 10); - btn = gtk_button_new_with_label("E"); + btn = gtk_button_new_with_label(" E "); gtk_box_pack_start (GTK_BOX(vb), btn, FALSE, FALSE, 10); - btn = gtk_button_new_with_label("F"); + btn = gtk_button_new_with_label(" F "); gtk_box_pack_start (GTK_BOX(vb), btn, FALSE, FALSE, 10); - ui->darea = (GtkDrawingArea *)gtk_drawing_area_new (); + ui->darea = gtk_drawing_area_new (); gtk_box_pack_start (GTK_BOX(hb), GTK_WIDGET(ui->darea), FALSE, FALSE, 5); - gtk_drawing_area_size (ui->darea, 192, 192); + gtk_drawing_area_size (GTK_DRAWING_AREA(ui->darea), BITMAP_WIDTH, BITMAP_HEIGHT); gtk_signal_connect (GTK_OBJECT (ui->darea), "expose_event", (GtkSignalFunc) expose_event, ui); gtk_signal_connect (GTK_OBJECT (ui->darea), "configure_event", (GtkSignalFunc) configure_event, ui); @@ -123,18 +138,37 @@ static void create_mainwin(oswald_ui *ui) vb = gtk_vbox_new(FALSE, 5); gtk_box_pack_start (GTK_BOX(hb), vb, FALSE, FALSE, 5); - btn = gtk_button_new_with_label("A"); + btn = gtk_button_new_with_label(" A "); gtk_box_pack_start (GTK_BOX(vb), btn, FALSE, FALSE, 10); - btn = gtk_button_new_with_label("B"); + btn = gtk_button_new_with_label(" B "); gtk_box_pack_start (GTK_BOX(vb), btn, FALSE, FALSE, 10); - btn = gtk_button_new_with_label("C"); + btn = gtk_button_new_with_label(" C "); gtk_box_pack_start (GTK_BOX(vb), btn, FALSE, FALSE, 10); gtk_widget_show_all(ui->mainwin); } +gboolean app_tmo_handler (gpointer userdata) +{ + oswald_ui *ui = (oswald_ui *)userdata; + + // fprintf(stderr, "tmo...\n"); + + if (ui->OnIdleScreen) { + update_idle_time_date(ui); +#if 0 + } else { + // go back to idle screen after IDLE_TIMEOUT seconds + if ((time(NULL) - ui->idle_tmo) > ui->conf.idle_tmo /*IDLE_TIMEOUT*/) + create_main_screen(ui); +#endif + } + + return TRUE; +} + int main(int argc , char ** argv) { oswald_ui ui; @@ -143,7 +177,10 @@ int main(int argc , char ** argv) create_mainwin(&ui); - set_pixel(&ui, 48, 48, TRUE); + //set_pixel(&ui, 48, 48, TRUE); + // demo_time(&ui); + ui.OnIdleScreen = TRUE; + g_timeout_add_seconds(1, app_tmo_handler, &ui); gtk_main (); return 0; -- 2.39.2