FireBirdLib - Topfield TMS PVR TAP Programming Library
FMUC_GetStringHeight.c
Go to the documentation of this file.
1#include <string.h>
2#include "FBLib_FontManager.h"
3
4dword FMUC_GetStringHeight(const char *Text, tFontDataUC *FontData)
5{
7
8 tGlyphCacheUC *GlyphData;
9 const byte *p, *pEnd;
10 byte BytesPerChar;
11 dword Height = 0;
12
13 if(!Text || !Text[0] || !FontData)
14 {
15 TRACEEXIT();
16 return 0;
17 }
18
19 p = Text;
20 pEnd = p + strlen(Text);
21
22 while(p < pEnd)
23 {
24 GlyphData = FMUC_GetGlyphData(FontData, p, &BytesPerChar);
25 if(GlyphData && (GlyphData->Height > Height)) Height = GlyphData->Height;
26 p += BytesPerChar;
27 }
28
29 TRACEEXIT();
30 return Height;
31}
tGlyphCacheUC * FMUC_GetGlyphData(tFontDataUC *FontData, const byte *UTF8Character, byte *BytesPerChar)
dword FMUC_GetStringHeight(const char *Text, tFontDataUC *FontData)
#define TRACEEXIT()
Definition: libFireBird.h:1244
#define TRACEENTER()
Definition: libFireBird.h:1243