soohy
New Member
Posts: 1
|
Post by soohy on Mar 3, 2017 18:46:21 GMT -8
Hello. I'm trying to add font to my project, but I can't deal with it. My program: #include <EEPROM.h> #include <SPI.h> #include <GD3.h> #include "fontdemo_assets.h"
void setup() { GD.begin(); LOAD_ASSETS(); }
void loop() { for(int i=0; i<OPENSANS_BOLD_CELLS; i++) { GD.ClearColorRGB(0x103000); GD.Clear(); GD.cmd_text(240, 136, 0, OPT_CENTER, "Hello world in Comic Sans MS"); GD.cmd_button(160, 200, 160, 40, 0, 0, "Press me!"); GD.cmd_number(400, 240, 30, OPT_CENTER, i); GD.swap(); delay(200); } } and here is fontdemo_assets.h #define LOAD_ASSETS() GD.safeload("OS.GD2"); #define OPENSANS_BOLD_HANDLE 0 #define OPENSANS_BOLD_WIDTH 12 #define OPENSANS_BOLD_HEIGHT 16 #define OPENSANS_BOLD_CELLS 96 #define ASSETS_END 9364UL static const shape_t OPENSANS_BOLD_SHAPE = {0, 12, 16, 0}; I tried with default_assets.h (like in attachment) but I still see only white rectangle, like this: _ ft812_gd3.zip (30.02 KB) Thanks for any help. Peter
|
|