1 //==============================================================================
2 // Copyright 2011 Meta Watch Ltd. - http://www.MetaWatch.org/
4 // Licensed under the Meta Watch License, Version 1.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.MetaWatch.org/licenses/license-1.0.html
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //==============================================================================
17 /******************************************************************************/
20 * Fonts functions common to OLED and LCD version
22 * LCD is ROW based, OLED is column based
24 /******************************************************************************/
31 /*! There are three fonts defined for the MetaWatch LCD
32 * they are 5, 7 and 16 pixels tall with variable width
47 /*! Use to size the bitmap used in the Display Task for printing characters FOR
50 #define MAX_FONT_ROWS ( 19 )
52 /*! The maximum number of columns any font (or icon) requires. This is
53 * used to define the size of the bitmap passed into font functions FOR THE
56 #define MAX_FONT_COLUMNS ( 30 )
58 #define TOTAL_TIME_CHARACTERS ( 12 )
59 #define TIME_CHARACTER_COLON_INDEX ( 10 )
60 #define TIME_CHARACTER_SPACE_INDEX ( 11 )
62 /*! Convert a character into an index into the font table
64 * \param CharIn is the input character
65 * \return Index into the table
67 unsigned char MapCharacterToIndex(unsigned char CharIn);
69 /*! Convert a digit (0-9) into an index into the font table
71 * \param Digit is a number
72 * \return Index into the table
74 unsigned char MapDigitToIndex(unsigned char Digit);
76 /*! Get the bitmap for the specified character
78 * \param Character is the desired character
79 * \param pBitmap pointer to an array of integers that holds the bitmap
81 * \note pBitmap must point to an object large enough to hold the largest bitmap
83 * \note For the LCD bitmaps the font height is the same as number of rows.
84 * If the width is less than 8 then each row is a byte.
85 * If the width is less than 16 but > 8 then each row is a word.
86 * The function works with ints so that it is generic for both types
89 void GetCharacterBitmap(unsigned char Character, u16t *pBitmap);
91 /*! Get the width for a specified character *
93 * \param Character is the desired character
94 * \return Width of character in columns
96 unsigned char GetCharacterWidth(unsigned char Character);
98 /*! Set the font type used for future Get operations *
100 * \param Type of font
102 void SetFont(etFontType Type);
104 /*! Set the font spacing for the current font*
106 * \param Spacing is the number of columns between characters
108 * \note The characters do not have any 'natural' spacing between them
110 void SetFontSpacing(unsigned char Spacing);
113 * \return The font spacing in columns
115 unsigned char GetFontSpacing(void);
119 * \return The font height in rows
121 unsigned char GetCharacterHeight(void);