BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

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

Author Topic: Customized font for text via vertex2ii  (Read 9381 times)

Spyy

  • Newbie
  • *
  • Posts: 20
    • View Profile
Customized font for text via vertex2ii
« on: April 10, 2021, 11:05:14 PM »

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
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 748
    • View Profile
Re: Customized font for text via vertex2ii
« Reply #1 on: April 12, 2021, 04:43:14 PM »

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
« Last Edit: April 12, 2021, 04:51:05 PM by BRT Community »
Logged

Spyy

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Customized font for text via vertex2ii
« Reply #2 on: April 12, 2021, 11:49:24 PM »

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
Logged

Spyy

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Customized font for text via vertex2ii
« Reply #3 on: April 13, 2021, 11:45:01 AM »

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
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 748
    • View Profile
Re: Customized font for text via vertex2ii
« Reply #4 on: April 13, 2021, 03:36:16 PM »

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
Logged