FireBirdLib - Topfield TMS PVR TAP Programming Library
FM_GetStringHeight.c
Go to the documentation of this file.
1#include <string.h>
2#include "FBLib_FontManager.h"
3
4dword FM_GetStringHeight(char *Text, tFontData *FontData)
5{
7
8 dword i;
9 dword h, Height = 0;
10
11 if(!Text || !Text[0] || !FontData || !FontData->pFontData)
12 {
13 TRACEEXIT();
14 return 0;
15 }
16
17 for(i = 0; i < strlen(Text); i++)
18 {
19 if(FM_isValidCharacter(Text[i]))
20 {
21 h = FontData->FontDef[FM_CharToIndex(Text[i])].Height;
22 if(h > Height) Height = h;
23 }
24 }
25
26 TRACEEXIT();
27 return Height;
28}
byte FM_CharToIndex(byte Char)
Definition: FM_CharToIndex.c:3
bool FM_isValidCharacter(byte Char)
dword FM_GetStringHeight(char *Text, tFontData *FontData)
#define TRACEEXIT()
Definition: libFireBird.h:1244
#define TRACEENTER()
Definition: libFireBird.h:1243
tFontDef FontDef[191]
Definition: libFireBird.h:1821
byte * pFontData
Definition: libFireBird.h:1820
dword Height
Definition: libFireBird.h:1814