changeset 29489:ee66869c30d6

Fix loading fonts from path with non-ASCII characters on Windows. * libinterp/corefcn/ft-text-renderer.cc (ft_manager::do_get_font): Use get_ASCII_filename to allow opening fonts on paths with non-ASCII characters on Windows.
author Markus Mützel <markus.muetzel@gmx.de>
date Mon, 05 Apr 2021 10:48:18 +0200
parents 2a251de6c1a5
children 747f592e2001
files libinterp/corefcn/ft-text-renderer.cc
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/ft-text-renderer.cc	Sat Apr 03 13:19:04 2021 +0200
+++ b/libinterp/corefcn/ft-text-renderer.cc	Mon Apr 05 10:48:18 2021 +0200
@@ -62,6 +62,7 @@
 #include "file-ops.h"
 #include "oct-env.h"
 #include "pr-output.h"
+#include "sysdep.h"
 #include "text-renderer.h"
 
 namespace octave
@@ -387,7 +388,8 @@
         ::warning ("unable to find default font files");
       else
         {
-          if (FT_New_Face (library, file.c_str (), 0, &retval))
+          std::string ascii_file = sys::get_ASCII_filename (file);
+          if (FT_New_Face (library, ascii_file.c_str (), 0, &retval))
             ::warning ("ft_manager: unable to load font: %s", file.c_str ());
 #if defined (HAVE_FT_REFERENCE_FACE)
           else
@@ -821,7 +823,12 @@
       {
         glyph_index = FT_Get_Char_Index (face, code);
 
+
+// FIXME: Add rotated characters:
+//     FT_Set_Transform( face, &matrix, &pen );
+
         if (code != '\n' && code != '\t'
+
             && (! glyph_index
                 || FT_Load_Glyph (face, glyph_index, FT_LOAD_DEFAULT)))
           {