BRT Community

General Category => Discussion - EVE => Topic started by: nico on June 04, 2021, 05:22:45 PM

Title: Custom Font (right to left f.e. arabic) on BT815
Post by: nico on June 04, 2021, 05:22:45 PM
Hi, is it possible to show arabic text on the BT815? I converted the font "Noto Sans Arabic" with the EVE Asset Builder to ASTC. I then use it with CMD_SETFONT2 and CMD_TEXT. Everything works fine for any unicode letter I tried, I have just problems with fonts which are written right to left.

This example shows how I try to display the persian text for "Hello":
Code: [Select]
Gpu_CoCmd_SetFont2(phost, customFontId, fontRamAddress, 0);
Gpu_CoCmd_Text(phost, x, y, customFontId, alignment, "سلام");

The C file is saved with UTF-8 encoding.
It results as the reversed text on the display.
Is the only way to invert the text before sending it out with CMD_TEXT? I think the result would be wrong, because f.e. in persian the letters look different if they are connected from the right or left side.
Title: Re: Custom Font (right to left f.e. arabic) on BT815
Post by: BRT Community on June 07, 2021, 05:57:01 PM
Hello,

One alternative might be to make your own text function so that you can customise it.

We have an example in this application note draft below which shows how to use the widths of the characters from the metric block. In this case it is a standard ANSI font and the font data is in RAM_G (see example 2)

 BRT_AN_042.pdf (ftp://u45902898-ide:Ftd1$erv@ftp.ftdichip.com/CES/Forum/BRT_AN_042_BETA/BRT_AN_042_FT81x_Creating_font_with_special_characters%20DRAFT.pdf)

This would allow you to make a more flexible text command,

Beat Regards, BRT Community