Font_FTFont::loadGlyph() - use the same flags as RenderGlyph(), FT_LOAD_NO_HINTING has been missed.
Test cases for issue CR24555
: myFTLib (theFTLib),
myFTFace (NULL),
myPointSize (0),
+ myLoadFlags (FT_LOAD_NO_HINTING | FT_LOAD_TARGET_NORMAL),
myUChar (0)
{
if (myFTLib.IsNull())
myGlyphImg.Clear();
myUChar = 0;
if (theUChar == 0
- || FT_Load_Char (myFTFace, theUChar, FT_LOAD_TARGET_NORMAL) != 0
+ || FT_Load_Char (myFTFace, theUChar, myLoadFlags) != 0
|| myFTFace->glyph == NULL)
{
return false;
myGlyphImg.Clear();
myUChar = 0;
if (theUChar == 0
- || FT_Load_Char (myFTFace, theUChar, FT_LOAD_RENDER | FT_LOAD_NO_HINTING | FT_LOAD_TARGET_NORMAL) != 0
+ || FT_Load_Char (myFTFace, theUChar, myLoadFlags | FT_LOAD_RENDER) != 0
|| myFTFace->glyph == NULL
|| myFTFace->glyph->format != FT_GLYPH_FORMAT_BITMAP)
{
FT_Face myFTFace; //!< FT face object
NCollection_String myFontPath; //!< font path
unsigned int myPointSize; //!< point size set by FT_Set_Char_Size
+ FT_Int32 myLoadFlags; //!< default load flags
Image_PixMap myGlyphImg; //!< cached glyph plane
FT_Vector myKernAdvance; //!< buffer variable
--- /dev/null
+puts "============"
+puts "OCC24555"
+puts "============"
+puts ""
+#######################################################################
+# Visualization - the same text is rendered with shift at second time
+#######################################################################
+
+vinit
+vclear
+vaxo
+vdrawtext "This program" 0 0 0 0 255 0 0 0 0 0 50 1 Arial
+
+vdrawtext "This program" 0 0 0 255 0 0 0 0 0 0 50 1 Arial
+
+set x 346
+set y 190
+
+set R 0
+set G 0.9843137264251709
+set B 0
+
+decho off
+set catch_status 0
+if { [catch {QAGetPixelColor $x $y $R $G $B} catch_result] } {
+ set catch_status 1
+}
+decho on
+
+if {${catch_status} == 0} {
+ puts "Error : color is bad"
+} else {
+ puts "OK : color is good"
+}
+
+set only_screen 1