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: Text with newline doesn't work  (Read 8983 times)

raydem

  • Newbie
  • *
  • Posts: 28
    • View Profile
Text with newline doesn't work
« on: October 26, 2022, 11:22:20 AM »

Hi,
I want to use the newline function inside the string, but it only draws a strange symbol at the position of "\n". I checked the programming guide and says to only include the "\n" in the string. I am using the font 18.

Code: [Select]
cmd_text(80, 60, 29, OPT_CENTER,"one two\nthree
four");

I am using this
Code: [Select]
cmd_text(80, 60, 18, EVE_OPT_CENTERY,"User:\n");
« Last Edit: October 26, 2022, 11:24:54 AM by raydem »
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 741
    • View Profile
Re: Text with newline doesn't work
« Reply #1 on: October 28, 2022, 02:19:05 PM »

Hello,

Please could you attach a screen snippet of the strange symbol that appears?

I notice that in the code example you have attached, by removing 'EVE_' from 'EVE_OPT_CENTERY', the option to center the text vertically should work as intended.

Best regards BRT Community
Logged

raydem

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Text with newline doesn't work
« Reply #2 on: October 29, 2022, 12:41:51 AM »

Hi,
This is the strange symbol:


Code: [Select]
cmd_text(80, 60, 29, OPT_CENTER,"one two\nthree
four");
This code was copied from the programming guide, it is the reason for it has not the EVE_. I used Rudolph's code and the defines use prefix EVE_ .
Code: [Select]
#define EVE_OPT_CENTERY          1024u
« Last Edit: October 29, 2022, 12:46:04 AM by raydem »
Logged

raydem

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Text with newline doesn't work
« Reply #3 on: November 04, 2022, 12:47:54 PM »

hi,

Some news?

thanks.
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 741
    • View Profile
Re: Text with newline doesn't work
« Reply #4 on: November 07, 2022, 04:18:49 PM »

Hi again,

Thank you for sharing that. Could you please tell me the bytes your code sends as a result of that call?

Just as a side note, a colleague also tried the code out and it worked as intended without displaying that unusual symbol.

Best regards BRT Community
Logged

Rudolph

  • Sr. Member
  • ****
  • Posts: 390
    • View Profile
Re: Text with newline doesn't work
« Reply #5 on: November 07, 2022, 08:43:28 PM »

I just gave it a spin as well since that reference to EVE_OPT_CENTERY and it just works for me either.

EVE_cmd_text(120, 100, 28, EVE_OPT_CENTER, "Lala\nFoobar");
EVE_cmd_text(120, 160, 29, EVE_OPT_CENTER,"one two\nthree four");

And the other options like EVE_OPT_CENTERX, EVE_OPT_CENTERY, EVE_OPT_RIGHTX or EVE_OPT_RIGHTX|EVE_OPT_CENTERY are also working.

This also does work:
uint32_t args[16];
args[0U] = 1234;
EVE_cmd_text_var(120, 220, 29, EVE_OPT_CENTERY|EVE_OPT_FORMAT,"log:\n%d%%", 1, args);

It does look a little strange with an UTF-8 font though, the spacing between the lines is off, probably because the height of the characters is too high.
Logged

raydem

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Text with newline doesn't work
« Reply #6 on: November 09, 2022, 01:51:37 PM »

Quote
  Unfortunately, the FT81x series of EVE ICs does not support the '/n' character in its text commands, this accounts for the behaviour you are seeing with the ME812AU setting in ESD, new line interpretation is only supported in the BT81x series of EVE ICs.
There is the answer in the other post. And I used FT811.

Rudolph, thanks for checked it.
« Last Edit: November 09, 2022, 01:56:34 PM by raydem »
Logged