Skip to main content
ALuca
Associate II
September 19, 2019
Solved

Display Issue using Text Wildcard Buffer

  • September 19, 2019
  • 7 replies
  • 2192 views

Hello,

I have a display issue when I using the wildcard buffer.

I already used wildcard buffer by the past on a previous version of touch GFX.

I created a new project for a custom board and the problem is that I can't modify a text with the wildcard buffer. 

See my function below : 

void Screen1View::Button1clicked()
{
	Unicode::snprintf(textArea1Buffer, TEXTAREA1_SIZE, "Bonjour");
	textArea1.resizeToCurrentText();
	textArea1.invalidate();
}

On the screen the letters (B,o,n,j,o,u and r) seems to be all on the top of the others, all at the same position.

I made some tests and in another one, I obtained only few letters of the complete word "njo" for exemple. 

I think I use touch GFX function as needed because as I said I already complete an application on a previous custom board. 

The only one difference is that on the previous project I used IAR and for this new one I use Atollic.

I also tried to complete the buffer, char by char : 

textArea1Buffer[0] = 'B';
textArea1Buffer[1] = 'o';
textArea1Buffer[2] = 'n';
textArea1Buffer[3] = 'j';

The result is the same.

It looks to be an abnormal behaviour.

Could you help me ?

Thank you

Regards,

Alexis

This topic has been closed for replies.
Best answer by Martin KJELDSEN

Not sure what's wrong with your application, but i re-made your example in 4.10.0:

  1. Created a TextArea with 1 wildcard.
  2. Set a buffer of size 20
  3. Defined a wildcard range of a-z,A-Z for the default typography used by the textarea
  4. Reused your code for setting the contents of the buffer
  5.  

0690X00000ARRikQAH.png

/Martin

7 replies

HP_it
Senior II
September 19, 2019

How large is your buffer? it should be at least 8 chars long (bonjour is 7 and \0 is 1). it's probably not that but you code only shows 4 places.

ALuca
ALucaAuthor
Associate II
September 19, 2019

My buffer has a size of 11

PBU
Associate III
September 19, 2019

Hi @ALuca​ 

Hope this will solve your issue.

  1. void Screen1View::Button1clicked()
  2. {
  3. Unicode::strncpy(textArea1Buffer,"Bonjour",TEXTAREA1_SIZE);
  4. textArea1.resizeToCurrentText();
  5. textArea1.invalidate();
  6. }

ALuca
ALucaAuthor
Associate II
September 20, 2019

Hi PBU,

Thank you for the answer, the problem stay the same with this solution.

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
September 20, 2019

Not sure what's wrong with your application, but i re-made your example in 4.10.0:

  1. Created a TextArea with 1 wildcard.
  2. Set a buffer of size 20
  3. Defined a wildcard range of a-z,A-Z for the default typography used by the textarea
  4. Reused your code for setting the contents of the buffer
  5.  

0690X00000ARRikQAH.png

/Martin

ALuca
ALucaAuthor
Associate II
September 24, 2019

Hello Martin,

Thank you for your answer ! I forgot to define wildcard range on this project...

After that all is OK..

Alexis

Martin KJELDSEN
Principal III
September 24, 2019

That's great, @ALuca​.

Does it make sense now? Since you don't know at asset-generation time which glyphs you'll need (no static strings defined) you'll choose a range of potential glyphs. E.g. if you're showing a text-message (which can be completely random) from a phone you need at least the entire alphabet + other symbols.

/Martin