Bienvenido a los foros de FT81x Manía. Te invitamos a regístrate totalmente gratis. Disfruta de tu experiencia con un grandes amigos y Staff.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Thread Contributor: raufjayAdding custom fonts

#11
0
I managed to make large numbers, 300 high by 200 wide (pixiels), I send you code. Using my 5-inch hotmcu screen.

[Image: I6wcRDN.jpg]

Use these 3 numbers 180Kbytes of RAM, you can complete up to 0 without problems.
If I'm younger, please, I'll give you another example

Or;

[Image: durAFVw.jpg]


Attached Files
.zip   test_num-180418a.zip (Size: 5.93 KB / Downloads: 5)
Reply
#12
0
Hi @ raufjay , another example with all the numbers, it would be necessary to make the point for float.
Use only 300KB of RAM ...  Wink


[Image: hdHv01e.jpg]

On the whole screen in 5 inches

Code convert with gd2asset;
gd2asset -f num.gd2 -o num.h t1.png,format=ARGB2 t2.png,format=ARGB2 t3.png,format=ARGB2 t4.png,format=ARGB2 t5.png,format=ARGB2 t6.png,format=ARGB2 t7.png,format=ARGB2 t8.png,format=ARGB2 t9.png,format=ARGB2 t0.png,format=ARGB2

Output::
Assets report
-------------
Header file:    num.h
GD3 RAM used:   300000
Output file:    num.gd2
File size:      7961


I enclose the example, in this case, it goes in the microSD reader, before the "setup" change its configuration.
This example will be uploaded tomorrow the repository on the library GD23Z

Enjoy !!!


Attached Files
.zip   test_num2_SD.zip (Size: 38.49 KB / Downloads: 5)
Reply
#13
1
Better response on post RE: Adding custom fontsHi,

So the steps would be:
1- create png files for individual numbers and decimal point using screen editor 1.17

2- Create assets file of all these png files.

3- use them as bitmapped image.

Am I right?

I still do not understand how that num.h file came from where? and how did it as been created?

I would appreciate if I can know the exact process. That would be good learning for me.
Reply
#14
0
There are two possible, use the Editor Designer, or using GD2asset Converter
  • The first one is the one you have described
The second is to use the GD2Assets. This tool is the most complete, it is used at the command level. They can be done in both Linux and Windows

They are Python scripts, therefore the tool will work much better in Linux. The problem in windows, will not convert the fonts, the images if.
For windows has the one I compiled months ago in this link; https://ft81xmania.com/comunidad/Tema-stm32-assets

If you use Linux (the best option), you download from the repository: https://github.com/lightcalamar/Asset-Tools-FT81X-v3

So;
  1. Create the images (preferable transparent in .png)
  2. Put the above code as an example
gd2asset -f num.gd2 -o num.h t1.png,format=ARGB2 t2.png,format=ARGB2 t3.png,format=ARGB2 t4.png,format=ARGB2 t5.png,format=ARGB2 t6.png,format=ARGB2 t7.png,format=ARGB2 t8.png,format=ARGB2 t9.png,format=ARGB2 t0.png,format=ARGB2
  • option -f num.gd2 (create the .gd2 file, where to copy to the micro SD)
  • option -o num.h (create the .h file, where to copy all the code and put in the arduino sketch, in a tab for example)

followed by the files to convert. For images of different format you have to use this form:
  •  t1.png,format=ARGB4 or t1.png,format=ARGB2  (etc ...)
  • Up to 15 images

It does not mean that we can only use 15 images, if we create a "sprite" of images are 15 multiplied by 15 images, in total up to 256 images, of course the limitation of the FT81xQ GPU.

Imagine icons of 64x64 pixels, many would be achieved ...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)