steved
Junior Member

Posts: 13
|
Post by steved on Aug 26, 2021 7:57:23 GMT -8
Created two test programs to narrow this down to being something with the GD3 asset tool creating a .gd3 asset file and loading that on a microSD card. microSD_test.ino (733 B) Using the same .ino file above, will work a header file created with the GD3asset program // This file was generated with the command-line:
// gd3asset.exe ARIALNB.TTF,format=L4,firstchar=0x2D,topchar=0x39,size=96 DCI_TEST_LOGO_small.png,format=ARGB2 Will NOT work with a .gd3 file and header created with the GD3asset program, just get a blank screen. // This file was generated with the command-line:
// gd3asset.exe -3 -f poro_assets.gd3 ARIALNB.TTF,format=L4,firstchar=0x2D,topchar=0x39,size=96 DCI_TEST_LOGO_small.png,format=ARGB2 The microSD card works with the demo programs video1, video2, etc. (yes the .gd3 file is loaded on the microSD card) Any thoughts?
|
|
steved
Junior Member

Posts: 13
|
Post by steved on Aug 26, 2021 8:19:24 GMT -8
Update - After a LONG time, at least 5 minutes the screen is now showing a blue screen with white text "ERROR Cannot open file: poro_assets.gd3"
|
|
|
Post by tftlcdcyg on Aug 26, 2021 12:27:53 GMT -8
You can share with us the DCI TEST LOGO_small.png file to test the sketch.
The GD.begin (0); instruction seems to me to disable the call to the microSD reader. Must be GD.begin ();
|
|
steved
Junior Member

Posts: 13
|
Post by steved on Aug 27, 2021 7:32:31 GMT -8
Changing GD.begin(0) to GD.begin(), I no longer get a blank screen, but I still get blue screen with "ERROR Cannot open file: poro-assets.gd3" So seems like it's not getting made correctly or being corrupted somehow? As I said before, this microSD card has the images and other assets for the examples and seems to work fine. I cannot add another file, but the header is pretty simple, here's the comment about how it was created. // This file was generated with the command-line:
// gd3asset.exe -f poro-assets.gd3 ARIALNB.TTF,size=96 DCI_TEST_LOGO_small.png,format=ARGB2 Attachments:
poro-assets.gd3 (25.55 KB)
ARIALNB.TTF (176.5 KB)
|
|
|
Post by tftlcdcyg on Aug 27, 2021 11:48:19 GMT -8
With this line in the windows command line, you generate a single file for your png image, preserving transparency. You just have to add the .h file, in the sketch folder gd3asset -o poro_asset.h DCI_TEST_LOGO_small.png,format=ARGB4 poro_asset.h (17.19 KB) To obtain two files, one for the sketch folder and the other that goes on a microSD card, you must do the following: gd3asset -f poro_asset.gd2 -o poro_asset.h DCI_TEST_LOGO_small.png,format=ARGB4 poro_asset.h (303 B) poro_asset.gd2 (3.6 KB) This would be the image call sketch for both cases, in the second .gd2 goes to the microSD memory: #include "GD2.h"
#include "poro_asset.h"
void setup() { GD.begin(); LOAD_ASSETS(); }
void loop() { GD.Clear(); GD.ClearColorRGB(0x000000); GD.get_inputs(); GD.SaveContext(); GD.Begin(BITMAPS); GD.Vertex2ii(0, 0, 0); GD.RestoreContext(); GD.swap(); } Regarding the font you want to use, I have the same doubt as you, how can we combine it with an image?
|
|
steved
Junior Member

Posts: 13
|
Post by steved on Aug 27, 2021 12:30:16 GMT -8
Using a png and a font works fine. Like I said in my original post, if I just have the header file with both the image and a subset of the font it works fine. The problem is I am running out of memory the Arduino can hold. I want to use a nice font in a very large size. My application I have is working with a limited selection from the font (the firstchar and topchar variables). But I would like to have the whole font. This is a FT81x driver so I can use the GD3asset tool with the 1 meg limit, but I cannot load the header file onto the Arduino because I run out of memory.
It seems like the asset file created with the -f option is not working correctly for me. I can run the Nightstrike demo which loads some assets from the same microSD card, but even in my simple example program the screen just displays "ERROR cannot open...".
|
|
steved
Junior Member

Posts: 13
|
Post by steved on Aug 27, 2021 13:40:24 GMT -8
Ok. I solved the problem. I found this hereSo the problem was just the filename was too long. Changed it to something shorter and is working.
|
|