50 #if (D4D_EXTSRC_FILE_ENABLE != D4D_FALSE) && (D4D_FNT_EXTSRC_SUPPORT != D4D_FALSE)
77 #if (D4D_FONT_TABLE_DISABLED == D4D_FALSE)
81 #if (D4D_EXTSRC_FILE_ENABLE != D4D_FALSE) && (D4D_FNT_EXTSRC_SUPPORT != D4D_FALSE)
95 while(fontTable[i].pFontDescriptor || fontTable[i].fileName)
114 while(d4d_pFontTable[i].pFontDescriptor || d4d_pFontTable[i].fileName)
117 if(d4d_pFontTable[i].fileName !=
NULL)
122 if(d4d_FontTableRam[i].pFontDescriptor)
123 D4D_MemFree((
void*)d4d_FontTableRam[i].pFontDescriptor);
130 j = (
sizeof(
D4D_FONT_TYPE) * (D4D_GetFontTableEntries(d4d_pFontTable) + 1));
135 if(d4d_FontTableRam ==
NULL)
139 for(i = 0; i < j; i++)
140 ((
Byte*)d4d_FontTableRam)[i] = 0;
143 D4D_ExtFntSetWorkPath(pFntWorkPath);
145 d4d_pFontTable = d4d_FontTableRam;
155 void D4D_ExtFntSetWorkPath(
D4D_CHAR* pPath)
162 pFntWorkPath = pPath;
166 while(d4d_pFontTable[i].pFontDescriptor || d4d_pFontTable[i].fileName)
169 if(d4d_pFontTable[i].fileName ==
NULL)
172 d4d_FontTableRam[i] = d4d_pFontTable[i];
178 if(d4d_FontTableRam[i].pFontDescriptor)
179 D4D_MemFree((
void*)d4d_FontTableRam[i].pFontDescriptor);
182 d4d_FontTableRam[i] = d4d_pFontTable[i];
185 pFile = D4D_OpenFntFile((
void*)d4d_pFontTable[i].fileName);
214 if(d4d_FontTableRam[i].pFontDescriptor ==
NULL)
222 if(
D4D_FileRead(pFile, d4d_FontTableRam[i].pFontDescriptor, fileSize) != fileSize)
234 while((pFntDesc !=
NULL) && ((pFntDesc - d4d_FontTableRam[i].pFontDescriptor) <= fileSize))
268 void D4D_ExtFntSetDfltWorkPath(
void)
277 D4D_CHAR* D4D_ExtFntGetWorkPath(
void)
316 if(pFontTable == d4d_pFontTable)
319 if(pFontTable ==
NULL)
322 d4d_pFontTable = pFontTable;
324 #if (D4D_EXTSRC_FILE_ENABLE != D4D_FALSE) && (D4D_FNT_EXTSRC_SUPPORT != D4D_FALSE)
343 #if (D4D_FONT_TABLE_DISABLED == D4D_TRUE)
349 while(d4d_pFontTable[i].pFontDescriptor !=
NULL)
351 if(d4d_pFontTable[i].ix_font == ix)
386 if(pFontType !=
NULL)
403 if(pFontType !=
NULL)
419 FNT_CHAR_PLACE char_place;
420 if(
NULL == pFontType)
431 if(char_place.pFontDescriptor ==
NULL)
437 tmp_width = char_place.pFontDescriptor->pSizeTable[char_place.index];
439 tmp_width = char_place.pFontDescriptor->charFullSize.width;
473 for(i = 0; i < pFontDescriptor->
charCnt; i++)
475 if(ch == pFontDescriptor->
pIxTable[i])
481 if(char_ix < pFontDescriptor->charCnt)
483 return pFontDescriptor->
pIxTable[char_ix];
489 if(char_ix < pFontDescriptor->charCnt)
504 FNT_CHAR_PLACE result = {
NULL, 0};
513 while (pFontDescriptor)
515 if((ch & 0xff00) == (pFontDescriptor->
startChar & 0xff00))
525 result.pFontDescriptor = pFontDescriptor;
559 if(!char_place->pFontDescriptor)
567 if(char_place->pFontDescriptor->pOffTable ==
NULL)
570 return (
D4D_FONT_DATA*)(char_place->pFontDescriptor->pFontData + char_place->pFontDescriptor->pOffTable[char_place->index]);
574 return (
D4D_FONT_DATA*)(char_place->pFontDescriptor->pFontData + char_place->index * char_place->pFontDescriptor->charBmpSize);
600 bit_cnt = (
Word)(pPxlDesc->char_width * pPxlDesc->row + pPxlDesc->clm);
601 data = pPxlDesc->pFntData[bit_cnt / 8];
606 byte_cnt = (
Word)((((pPxlDesc->char_width - 1) / 8) + 1) * pPxlDesc->row);
607 byte_cnt += (pPxlDesc->clm / 8);
608 data = pPxlDesc->pFntData[byte_cnt];
609 bit_cnt = (
Byte)(pPxlDesc->clm % 8);
613 return (
D4D_BOOL)((data >> (bit_cnt % 8)) & 0x01);
615 return (
D4D_BOOL)((data << (bit_cnt % 8)) & 0x80);
654 CHAR_PXL_DESC pxlDesc;
655 FNT_CHAR_PLACE char_place;
657 if(pFontType ==
NULL)
662 if(!pxlDesc.pFontDescriptor)
667 if((ch ==
'\t') && (p_CharDes->
pTab !=
NULL))
678 return (
D4D_COOR)(nextTab - p_CharDes->
x);
688 if(!char_place.pFontDescriptor)
691 pxlDesc.pFontDescriptor = char_place.pFontDescriptor;
697 pxlDesc.char_width = pxlDesc.pFontDescriptor->pSizeTable[char_place.index];
699 pxlDesc.char_width = pxlDesc.pFontDescriptor->charFullSize.width;
703 #ifndef D4D_COLOR_TRANSPARENT
707 for (pxlDesc.row=0; pxlDesc.row<pxlDesc.pFontDescriptor->charFullSize.height; ++pxlDesc.row)
709 for(pxlDesc.clm = 0; pxlDesc.clm < pxlDesc.char_width; pxlDesc.clm++)
725 p_CharDes->
colorBack = D4D_COLOR_TRANSPARENT;
741 for (pxlDesc.row=0; pxlDesc.row < pxlDesc.pFontDescriptor->charFullSize.height; ++pxlDesc.row)
743 for (yScale_cnt=1; yScale_cnt<=yScale; ++yScale_cnt)
745 for (pxlDesc.clm=1; pxlDesc.clm<=pFontType->
charSpacing.
width; ++pxlDesc.clm)
751 for(pxlDesc.clm = 0; pxlDesc.clm < pxlDesc.char_width; ++pxlDesc.clm)
758 for (px_cnt=1; px_cnt<=xScale; ++px_cnt)
D4D_WCHAR D4D_TCHAR
Type definition of eGUI character (it depends on UNICODE setting if this is D4D_CHAR or D4D_WCHAR)...
D4D_FONT_TYPE * pFontType
D4D_FONT_TYPE * D4D_GetFont(D4D_FONT ix)
D4D_CHAR * D4D_StrCopy(register D4D_CHAR *sd, register const D4D_CHAR *ss)
The function copy string one string to other one (terminated by zero)
static D4D_BOOL D4D_LCD_GetFntBit(CHAR_PXL_DESC *pPxlDesc)
#define D4D_MemAlloc(size)
Mem Alloc eGUI definition. If not defined by user config any special user function, it used standard system function.
D4D_COOR D4D_LCD_PrintChr(D4D_TCHAR ch, D4D_PRINT_DESC *p_CharDes)
D4D_COOR * pTabTable
Pointer to tabulator table.
#define D4D_FALSE
This is definition of boolean operation value in eGUI - FALSE.
D4D_COOR tabOffset
Start offset of tabulator.
const D4D_FONT_TYPE d4d_FontTable[]
D4D_FONT_SIZES charSpacing
static D4D_FONT_DATA * D4D_GetCharData(FNT_CHAR_PLACE *char_place)
D4D_FONT_PROPERTIES properties
void D4D_LCD_Box(D4D_COOR x1, D4D_COOR y1, D4D_COOR x2, D4D_COOR y2, D4D_COLOR color)
const D4D_FONT_IX * pIxTable
#define D4D_TRUE
This is definition of boolean operation value in eGUI - TRUE.
const D4D_FONT_OFFSET * pOffTable
D4D_FONT_TYPE * D4D_GetFontTable(void)
D4D Driver main header file.
void D4D_SetFontTable(D4D_FONT_TYPE *pFontTable)
struct D4D_FONT_DESCRIPTOR_S * pNext
#define D4D_FNT_WORK_PATH_DEFAULT
D4D_FNT_WORK_PATH_DEFAULT constant default declaration ("a:\\")
#define D4D_FileOpen
Macro used as short cut to used File Open function defined by D4D_DECLARE_FILE_FUNCTIONS.
D4D Driver private header file.
#define D4D_FONT_PACK_SCANPREFERRED_COLUMN
#define D4D_FONT_FLAGS_IX_TYPE_MAP
Byte D4D_COOR
Type definition of eGUI coordination variables.
unsigned char Byte
Type definition of Byte (unsigned 8-bit).
D4D_FONT_DESCRIPTOR * pFontDescriptor
#define D4D_EXTSRC_BUFF_SIZE
This macro is used to specify size of buffer that is using when external file support is enabled...
#define NULL
Type definition of null pointer.
#define D4D_FONT_FLAGS_FNT_WIDTH_PROPORTIONAL
#define D4D_MemFree(pMem)
Mem Free eGUI definition. If not defined by user config any special user function, it used standard system function.
unsigned long LWord
Type definition of LWord (unsigned 32-bit).
const D4D_FONT_DATA * pFontData
#define D4D_FNT_PRTY_TRANSPARENT_MASK
D4D_FONT_SIZES charFullSize
Type definition of eGUI tabulation structure.
LWord D4D_INDEX
Type definition of eGUI general index variables.
#define D4D_FONT_FLAGS_IX_STYLE_NONLINEAR
#define D4D_SEEK_SET
D4D_SEEK_SET eGUI Origin constant for begin of file (1)
static FNT_CHAR_PLACE D4D_LCD_GetCharPlace(const D4D_FONT_DESCRIPTOR *pFontDescriptorStart, D4D_TCHAR ch)
#define D4D_FONT_PACK_COMPRESSED_ON
D4D_CHAR * D4D_StrCat(register D4D_CHAR *sd, register const D4D_CHAR *ss)
The function concatenate strings (terminated by zero)
#define D4D_FileClose
Macro used as short cut to used File Close function defined by D4D_DECLARE_FILE_FUNCTIONS.
#define D4D_FileTell
Macro used as short cut to used File Tell function defined by D4D_DECLARE_FILE_FUNCTIONS.
const D4DLCD_FUNCTIONS D4D_LLD_LCD
LWord D4D_BOOL
Type definition of eGUI boolean.
#define D4D_UNUSED(x)
Macro used just for notify compiler that the input parameter is not used.
char D4D_CHAR
Type definition of eGUI ASCII character.
D4D_FONT_SIZE D4D_GetFontWidth(D4D_FONT ix)
sLWord D4D_INDEX_DELTA
Type definition of eGUI general index variables for signed offsets.
D4D_FONT_SIZE D4D_GetCharWidth(D4D_FONT ix, D4D_TCHAR ch)
#define D4D_FileSeek
Macro used as short cut to used File Seek function defined by D4D_DECLARE_FILE_FUNCTIONS.
D4D_FONT_SIZES D4D_GetFontSize(D4D_FONT ix)
#define D4D_SEEK_END
D4D_SEEK_END eGUI Origin constant for end of file (3)
static D4D_INDEX_DELTA D4D_GetCharIndex(D4D_FONT_DESCRIPTOR *pFontDescriptor, D4D_TCHAR ch)
Byte d4d_extsrcBuffer[D4D_EXTSRC_BUFF_SIZE]
D4D driver - resistive touch screen driver function header file.
D4D_COOR D4D_GetNextTab(D4D_TAB *pTab, D4D_COOR pos)
void(* D4DLCD_Send_PixelColor)(D4D_COLOR value)
The LCD driver send pixel function. The pixels will be draw on position (automaticaly incremented) se...
LWord D4D_COLOR
Type definition of eGUI color variables.
#define D4D_FONT_PACK_BITORDER_LITTLEEND
D4D_FONT_SIZE D4D_GetFontHeight(D4D_FONT ix)
#define D4D_FONT_PACK_SCANBASED_COLUMN
unsigned short Word
Type definition of Word (unsigned 16-bit).
static D4D_FONT_TYPE * d4d_pFontTable
D4D_BOOL D4D_FileIsAbsolutePath(D4D_CHAR *pFileName)
void * D4D_FILEPTR
Type definition of eGUI file pointer.
const D4D_FONT_SIZE * pSizeTable
int D4D_StrLen(register const D4D_CHAR *s)
The function returns length of string terminated by zero.
#define D4D_FileRead
Macro used as short cut to used File Read function defined by D4D_DECLARE_FILE_FUNCTIONS.
unsigned char(* D4DLCD_SetWindow)(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2)
The LCD driver Set logic window function. Into this logic window will be draw pixels.