FireBirdLib - Topfield TMS PVR TAP Programming Library
FM_GetStringWidth.c
Go to the documentation of this file.
1
#include <string.h>
2
#include "
FBLib_FontManager.h
"
3
4
dword
FM_GetStringWidth
(
char
*Text,
tFontData
*FontData)
5
{
6
TRACEENTER
();
7
8
dword i;
9
dword Width = 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
Width += FontData->
FontDef
[
FM_CharToIndex
(Text[i])].
Width
;
21
}
22
23
TRACEEXIT
();
24
return
Width;
25
}
FBLib_FontManager.h
FM_CharToIndex
byte FM_CharToIndex(byte Char)
Definition:
FM_CharToIndex.c:3
FM_isValidCharacter
bool FM_isValidCharacter(byte Char)
Definition:
FM_isValidCharacter.c:3
FM_GetStringWidth
dword FM_GetStringWidth(char *Text, tFontData *FontData)
Definition:
FM_GetStringWidth.c:4
TRACEEXIT
#define TRACEEXIT()
Definition:
libFireBird.h:1244
TRACEENTER
#define TRACEENTER()
Definition:
libFireBird.h:1243
tFontData
Definition:
libFireBird.h:1819
tFontData::FontDef
tFontDef FontDef[191]
Definition:
libFireBird.h:1821
tFontData::pFontData
byte * pFontData
Definition:
libFireBird.h:1820
tFontDef::Width
dword Width
Definition:
libFireBird.h:1813
FontManager
FM_GetStringWidth.c
Generated on Fri Apr 29 2022 13:34:01 for FireBirdLib - Topfield TMS PVR TAP Programming Library by
1.9.3