From 9ba958806256e38ae4ae4fc424c37f8a7eea2ae9 Mon Sep 17 00:00:00 2001 From: Marco Nolden Date: Tue, 29 Jun 2010 16:13:18 +0200 Subject: [PATCH] FIX: enable UTF8 text rendering --- Rendering/vtkFreeTypeUtilities.cxx | 8 ++++---- Rendering/vtkFreeTypeUtilities.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Rendering/vtkFreeTypeUtilities.cxx b/Rendering/vtkFreeTypeUtilities.cxx index a92f1963359..e5902fb037a 100644 --- a/Rendering/vtkFreeTypeUtilities.cxx +++ b/Rendering/vtkFreeTypeUtilities.cxx @@ -663,7 +663,7 @@ int vtkFreeTypeUtilities::GetFace(vtkTextProperty *tprop, //---------------------------------------------------------------------------- int vtkFreeTypeUtilities::GetGlyphIndex(unsigned long tprop_cache_id, - char c, + FT_UInt32 c, FT_UInt *gindex) { #if VTK_FTFC_DEBUG_CD @@ -705,7 +705,7 @@ int vtkFreeTypeUtilities::GetGlyphIndex(unsigned long tprop_cache_id, //---------------------------------------------------------------------------- int vtkFreeTypeUtilities::GetGlyphIndex(vtkTextProperty *tprop, - char c, + FT_UInt32 c, FT_UInt *gindex) { if (!tprop) @@ -929,7 +929,7 @@ int vtkFreeTypeUtilities::GetBoundingBox(vtkTextProperty *tprop, } // Get the glyph index - if (!this->GetGlyphIndex(tprop_cache_id, *str, &gindex)) + if (!this->GetGlyphIndex(tprop_cache_id,(unsigned char)*str, &gindex)) { continue; } @@ -1169,7 +1169,7 @@ int vtkFreeTypeUtilities::PopulateImageData(vtkTextProperty *tprop, } // Get the glyph index - if (!this->GetGlyphIndex(tprop_cache_id, *str, &gindex)) + if (!this->GetGlyphIndex(tprop_cache_id, (unsigned char)*str, &gindex)) { continue; } diff --git a/Rendering/vtkFreeTypeUtilities.h b/Rendering/vtkFreeTypeUtilities.h index a2d39ade8fd..eeb815e7a0c 100644 --- a/Rendering/vtkFreeTypeUtilities.h +++ b/Rendering/vtkFreeTypeUtilities.h @@ -123,7 +123,7 @@ class VTK_RENDERING_EXPORT vtkFreeTypeUtilities : public vtkObject // Return true on success, false otherwise // This method is successful // only when FreeType version is >= 2.1.9 - int GetGlyphIndex(vtkTextProperty *tprop, char c, FT_UInt *gindex); + int GetGlyphIndex(vtkTextProperty *tprop, FT_UInt32 c, FT_UInt *gindex); // Description: // Given a text property and a character, get the corresponding FreeType @@ -199,7 +199,7 @@ class VTK_RENDERING_EXPORT vtkFreeTypeUtilities : public vtkObject // only when FreeType version is >= 2.1.9 int GetSize(unsigned long tprop_cache_id, int font_size, FT_Size *size); int GetFace(unsigned long tprop_cache_id, FT_Face *face); - int GetGlyphIndex(unsigned long tprop_cache_id, char c, FT_UInt *gindex); + int GetGlyphIndex(unsigned long tprop_cache_id, FT_UInt32 c, FT_UInt *gindex); int GetGlyph(unsigned long tprop_cache_id, int font_size, FT_UInt gindex,