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
TFT fonts and zones
Re: TFT fonts and zones
Hi,
Thank you for your suggestion, I will pass them to our developers.
Regards,
Filip.
Thank you for your suggestion, I will pass them to our developers.
Regards,
Filip.
Re: TFT fonts and zones
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.
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.
Re: TFT fonts and zones
Here you go:
Prototypes:
Code:
Examples:
Regards
Prototypes:
Code: Select all
char TFT_Char_Width(char c, const char *font);
int TFT_Text_Width(char *txt, const char *font);
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;
}
Code: Select all
char ch_width = TFT_Char_Width('A', &Tahoma11x13_Regular);
int txt_width = TFT_Text_Width("Hello world", &Tahoma11x13_Regular);
Re: TFT fonts and zones
I like the bilbo60's suggestion:
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
Is there any progress?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, ...
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
- Aleksandar.Mitrovic
- mikroElektronika team
- Posts: 1697
- Joined: 11 Mar 2015 12:48
Re: TFT fonts and zones
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
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
Re: TFT fonts and zones
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
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