Use a more reliable conversion to UTF8.

Fixes https://gitlab.com/kicad/code/kicad/issues/12722

Fixes https://gitlab.com/kicad/code/kicad/issues/13313
This commit is contained in:
Jeff Young 2023-01-07 13:12:02 +00:00
parent c2f7dbfc15
commit aeb0d1d887
1 changed files with 2 additions and 2 deletions

View File

@ -332,7 +332,7 @@ VECTOR2I OUTLINE_FONT::getTextAsGlyphs( BOX2I* aBBox, std::vector<std::unique_pt
FT_Set_Char_Size( face, 0, scaler, GLYPH_RESOLUTION, 0 ); FT_Set_Char_Size( face, 0, scaler, GLYPH_RESOLUTION, 0 );
hb_buffer_t* buf = hb_buffer_create(); hb_buffer_t* buf = hb_buffer_create();
hb_buffer_add_utf8( buf, aText.c_str(), -1, 0, -1 ); hb_buffer_add_utf8( buf, UTF8( aText ).c_str(), -1, 0, -1 );
hb_buffer_guess_segment_properties( buf ); // guess direction, script, and language based on hb_buffer_guess_segment_properties( buf ); // guess direction, script, and language based on
// contents // contents
@ -525,7 +525,7 @@ void OUTLINE_FONT::RenderToOpenGLCanvas( KIGFX::OPENGL_GAL& aGal, const wxString
const EDA_ANGLE& aOrientation, bool aIsMirrored ) const const EDA_ANGLE& aOrientation, bool aIsMirrored ) const
{ {
hb_buffer_t* buf = hb_buffer_create(); hb_buffer_t* buf = hb_buffer_create();
hb_buffer_add_utf8( buf, aString.c_str(), -1, 0, -1 ); hb_buffer_add_utf8( buf, UTF8( aString ).c_str(), -1, 0, -1 );
hb_buffer_guess_segment_properties( buf ); // guess direction, script, and language based on contents hb_buffer_guess_segment_properties( buf ); // guess direction, script, and language based on contents
unsigned int glyphCount; unsigned int glyphCount;