Hi,
i am trying to get a working legacy L8 font with UTF-8File, CMD_SETFONT, First character: 1, RAM_G+ 181936.
=> Resulting command line is: fnt_cvt.exe -f legacy -C BT81X -i C:/blabla/isfdV11BoldPlus55.ttf -s 22 -d 181936 -c setfont -l 1 -g -u C:/blabla/isfdFont V4.txt -o C:/blabla/output -O
I am using this because i have no flash attached and i am only using a few glyphs and then the output for L8 ist relatively small.
When i use the font in my application i only get "pixel dust/snow" or a solid block instead of numbers with CMD_NUMBER or CMD_TEXT. Other fonts are working fine.
BTW: I get the same result with the setting CMD_SETFONT2.
Going more into detail:
Resulting command line: fnt_cvt.exe -f legacy -C BT81X -i C:/blabla/isfdV11BoldPlus55.ttf -s 22 -d 181936 -c setfont -l 1 -g -u C:/blabla/isfdFont V4.txt -o C:/blabla/output -O
In the *_L8.c i then get:
#include "Common.h"
#define FONT_HANDLE (1)
#define FONT_FILE_ADDRESS (RAM_G + 181936)
#define STRIDE (28)
#define FONT_WIDTH (28)
#define FONT_HEIGHT (24)
#define FIRST_CHARACTER (1)
void Load_Font_L8(EVE_HalContext * phost)
{
Gpu_CoCmd_Dlstart(phost);
App_WrCoCmd_Buffer(phost, CLEAR(1, 1, 1));
App_WrCoCmd_Buffer(phost, COLOR_RGB(255, 255, 255));
Gpu_Hal_LoadImageToMemory(phost, "../../../L8/isfdV11BoldPlus55_22_L8.raw", FONT_FILE_ADDRESS, LOAD);
App_WrCoCmd_Buffer(phost, BITMAP_HANDLE(FONT_HANDLE));
App_WrCoCmd_Buffer(phost, BITMAP_SOURCE(FONT_FILE_ADDRESS + 148 - STRIDE*FONT_HEIGHT*FIRST_CHARACTER));
App_WrCoCmd_Buffer(phost, BITMAP_LAYOUT(L8, STRIDE, FONT_HEIGHT));
App_WrCoCmd_Buffer(phost, BITMAP_SIZE(NEAREST, BORDER, BORDER, FONT_WIDTH, FONT_HEIGHT));
Gpu_CoCmd_SetFont(phost, FONT_HANDLE, FONT_FILE_ADDRESS);
Gpu_CoCmd_Text(phost, 50, 50, FONT_HANDLE, 0, "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A");
App_WrCoCmd_Buffer(phost, DISPLAY());
Gpu_CoCmd_Swap(phost);
App_Flush_Co_Buffer(phost);
Gpu_Hal_WaitCmdfifo_empty(phost);
}
This output i am using in my code...
In the .rawh i find:
/* Widths */
0,16,14,16,16,16,16,16,16,16,8,16,28,17,20,20,28,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* Format */
3,0,0,0,
/* Stride */
28,0,0,0,
/* Max Width */
28,0,0,0,
/* Max Height */
24,0,0,0,
/* Raw Data Address in Decimal: <181412> */
164,196,2,0,
/* 148 Metric Block End --- */
/*Bitmap Raw Data begin +++*/
/*The expected raw bitmap size is 11424 Bytes */
0,0,0,3,88,173,222,246,248,227,182,100,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,198,.......
For the "base" i get FONT_FILE_ADDRESS (RAM_G + 181936)
For BITMAP_SOURCE(FONT_FILE_ADDRESS + 148 - STRIDE*FONT_HEIGHT*FIRST_CHARACTER)); => I get the address for the first bitmap at 181412 which seemed to be smaller than the base address (Base: 181936 vs. Bitmap 181412). Is this correct ? I would think that bitmap source is Base+148 ?
With CMD_SETFONT2 the memory map looks a bit more plausible (especially the "Raw Data Address in Decimal") which here matches with the resulting memory map:
Command line: fnt_cvt.exe -f legacy -C BT81X -i C:/blabla/isfdV11BoldPlus55.ttf -s 22 -d 181936 -c setfont2 -l 1 -g -u C:/blabla/isfdFont V4.txt -o C:/blabla/output -O 4
Uploaded memory map of RAM_G with CMD_SETFONT2 looks like this:
Load metrix 3 Start: 181936 => 0x2C6B0
Load metrix 3 End: 182084 => 0x2C744
Load font bitmap 3 Start: 182084 => 0x2C744
Load font bitmap 3 End: 193508 => 0x2F3E4
_L8.rawh
/* Widths */
0,16,14,16,16,16,16,16,16,16,8,16,28,17,20,20,28,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* Format */
3,0,0,0,
/* Stride */
28,0,0,0,
/* Max Width */
28,0,0,0,
/* Max Height */
24,0,0,0,
/* Raw Data Address in Decimal: <182084> */
68,199,2,0,
/* 148 Metric Block End --- */
/*Bitmap Raw Data begin +++*/
/*The expected raw bitmap size is 11424 Bytes */
0,0,0,3,88,173,222,246,248,227,182,100,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,198,.....
But still also "pixel snow"...
Find attached my font if you want to try...with the EAB settings above...
Thank you for your help
Torsten