cancel
Showing results for 
Search instead for 
Did you mean: 

Display Issue using Text Wildcard Buffer

ALuca
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

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

View solution in original post

7 REPLIES 7
HP
Senior III

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
Associate II

My buffer has a size of 11

PBU
Associate III

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
Associate II

Hi PBU,

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

Martin KJELDSEN
Chief III

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
Associate II

Hello Martin,

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

After that all is OK..

Alexis

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