TFT fonts and zones

Post your requests and ideas on the future development of Visual TFT Software.
Post Reply
Author
Message
bilbo60
Posts: 4
Joined: 27 Jul 2011 14:10

TFT fonts and zones

#1 Post by bilbo60 » 28 Jan 2012 06:57

Hello,

some useful routines could be implemented for the displays such as

int char_width( char c) returning under the selected font the real displayed width of the char

int text_width( char *s) returning the width of the text , giving the opportunity to center the text easely

or simply give us a pointer to the font header with a description of a such header to get access to the width info for each char

and for the bitmap ones

at least a pixel color readback .

also can you think for a bitblt like action for displaying chars, text, ...


regards

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: TFT fonts and zones

#2 Post by filip » 30 Jan 2012 13:36

Hi,

Thank you for your suggestion, I will pass them to our developers.

Regards,
Filip.

hooper
Posts: 143
Joined: 23 Oct 2009 08:51

Re: TFT fonts and zones

#3 Post by hooper » 19 Jun 2013 20:53

Right Bitblt might be very useful for graph drawing:
On arrival of a new sample you can use it to shift the whole graph one pixel to the left and
make room for the display of the new sample. 8)

aCkO
Posts: 1119
Joined: 14 Feb 2011 04:07
Location: Bar, Montenegro

Re: TFT fonts and zones

#4 Post by aCkO » 27 Aug 2013 15:13

Here you go:

Prototypes:

Code: Select all

char TFT_Char_Width(char c, const char *font);
int  TFT_Text_Width(char *txt, const char *font);
Code:

Code: Select all

char TFT_Char_Width(char c, const char *font) {
   unsigned int MinID = *(unsigned int *)&font[2];
   unsigned int MaxID = *(unsigned int *)&font[4];
   
   if (!(MinID <= c && c <= MaxID))
      return 0;
   else
      return font[8 + 4 * (c - MinID)];
}

int TFT_Text_Width(char *txt, const char *font) {
   int width = 0;
   
   while (*txt)
      width += TFT_Char_Width(*txt++, font) + 1;

   return width;
}

Examples:

Code: Select all

char ch_width = TFT_Char_Width('A', &Tahoma11x13_Regular);
int txt_width = TFT_Text_Width("Hello world", &Tahoma11x13_Regular);
Regards

vt23
Posts: 44
Joined: 17 Jun 2014 10:36

Re: TFT fonts and zones

#5 Post by vt23 » 08 Apr 2015 07:12

I like the bilbo60's suggestion:
bilbo60 wrote: and for the bitmap ones

at least a pixel color readback .

also can you think for a bitblt like action for displaying chars, text, ...
Is there any progress?
1. Mainly a pixel color readback is useful. It would return the color at required (entered) pixel position (x, y).
2. Or to have a function which return x, y coordinates of the first occurrence of required color. There can be also parametrs to enter a position of start of searching.

Regards

VT

User avatar
Aleksandar.Mitrovic
mikroElektronika team
Posts: 1697
Joined: 11 Mar 2015 12:48

Re: TFT fonts and zones

#6 Post by Aleksandar.Mitrovic » 14 Apr 2015 16:55

Hi,

Unfortunately in the latest version of compiler we didn't make major changes. Only minor updates.
Our Developers are working on the new version of VisualTFT at this moment.

I will pass your suggestion for further consideration to our Development team.

Best regards,
Aleksandar

vt23
Posts: 44
Joined: 17 Jun 2014 10:36

Re: TFT fonts and zones

#7 Post by vt23 » 21 Apr 2015 09:09

Hello Aleksandar.Mitrovic,

I think we have solved the issue of pixel readback together with user peini already (see topic "Idea for font anti-aliasing on displays"). We've done it for very popular controller ILI9341 and it works well. It is very useful for aCkO's BitPack library for anti-aliased fonts.

Regards
Vitek

Post Reply

Return to “Visual TFT Wish List”