News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Main Menu

Customized font for text via vertex2ii

Started by Spyy, April 10, 2021, 11:05:14 PM

Previous topic - Next topic

Spyy

Hi,

is it possible to create a custom font and use it in a display list via a vertex2ii command?
I have a font already created with the suggested tool and "imported" via header file, transferred it into the RAM_G and assigned a handle with CMD_SETFONT2....but when i use the handle in the vertex2ii it shows "something" which looks like a memory dump...

If yes, must i do this every time when i update the displaylist?
If yes a short displaylist example very welcome...

Thank you

Torsten

BRT Community

#1
Hi Torsten,

Yes, you can use Vertex2ii to display font characters as cells of a bitmap.

DL_START()
CLEAR(1, 1, 1) 
CMD_SETFONT2(5, 0, 32)   // handle 5
BEGIN(BITMAPS)
VERTEX2II(282, 243, 5, 0x32) // uses the ASCII/ANSI offset,    displays the number "2"
DISPLAY
SWAP

These won't take account of the character spacings however and so if printing more than one character you will need to adjust the X coordinate to space them.

We have some more advanced examples in this application note below which use the same principle but also check the font widths and so these might be useful,

BRT_AN_042.pdf

Best Regards, BRT Community

Spyy

Hi,

ah ok thank you....so it is necessary to call the setfont2 command everytime before i want to use the font or is the handle persistent after i called the setfont2 command?

Thank you

Torsten

Spyy

Hi,

not sure how to download the attached pdf. It seems this is a ftp link but it always asks for a application to open.

Torsten

BRT Community

Hi,

You can either use the SetFont2 on each list,   or you can also do it within a separate command list near the beginning of the application and this will assign the font to the handle. You can then just use the handle number after that in subsequent co-processor/display lists.   

In this latter case, you can create a short list for each font to be loaded in the same part of the code where you load the font data. Even though this is just to set up the font and won't display it, you do still need the CMD_DLSTART before the CMD_SETFONT2 and to finish with DISPLAY and SWAP as with a normal list.

The BRT_AN_042 file should be a PDF but there may be some kind of issue accessing the FTP. If you would like us to email you a copy you can email us at support.emea@brtchip.com and we'll send a copy,

Best Regards, BRT Community