Guilherme H Marins
Guilherme H Marins

Reputation: 11

Problems with special characters using lv_textarea_add_text(ta, "á")

The function lv_textarea_add_text(ta, "á") doesn't display special characters in the text area. What could be the issue?

I tried using the function lv_textarea_add_text(ta, "á") to add the text "á" to the text area. I expected the text area to display the character "á" correctly. However, the special character did not display as expected.

Upvotes: 0

Views: 119

Answers (1)

satyam antapurkar
satyam antapurkar

Reputation: 1

The character you are trying to display in not within the ASCII range. To add special character/symbol (Unicode), you need to add font to your project by using any of below methods:

  1. Go to lvgl online font converter and upload a font that supports Unicode characters. Make sure to specify the correct Unicode range (e.g. Latin Extended-A) when converting the font.
  2. By using offline font converter available in directory lvgl/scripts/

Apply added font using: lv_obj_set_style_text_font(ta, &ADDED_FONT, LV_PART_MAIN | LV_STATE_DEFAULT);

Note: The above API is valid for lvgl version 9.0.0. A similar API is available in other versions, also maybe with different API name.

Upvotes: 0

Related Questions