Skip to content
Commit ed15ff14 authored by Oleh Kravchenko's avatar Oleh Kravchenko Committed by Benjamin Cabé
Browse files

fb: cfb: Fix print of ASCII chars from 128 to 255



Change the "c" variable type from char to uint8_t in get_glyph_ptr() and
draw_char_vtmono() to fix issues with the range check of the "c" value.

The easiest way to print localized text with Zephyr is
to ask GCC for compile-time conversion:

  INCLUDE(${ZEPHYR_BASE}/cmake/cfb.cmake NO_POLICY_SCOPE)
    GENERATE_CFB_FONT_FOR_TARGET(app
    "${CMAKE_CURRENT_SOURCE_DIR}/fonts/koi8-u.png"
    "${ZEPHYR_BINARY_DIR}/include/generated/cfb_font_dice.h"
    8 16 --first 0 --last 255)

  TARGET_COMPILE_OPTIONS(app PRIVATE
    -finput-charset=UTF-8
    -fexec-charset=KOI8-U)

Signed-off-by: default avatarOleh Kravchenko <oleg@kaa.org.ua>
parent 6ba32743
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment