diff --git a/src/Font/Font_FTFont.cxx b/src/Font/Font_FTFont.cxx index ab0cf8d6cc..d1bdc56057 100755 --- a/src/Font/Font_FTFont.cxx +++ b/src/Font/Font_FTFont.cxx @@ -29,6 +29,7 @@ Font_FTFont::Font_FTFont (const Handle(Font_FTLibrary)& theFTLib) : myFTLib (theFTLib), myFTFace (NULL), myPointSize (0), + myLoadFlags (FT_LOAD_NO_HINTING | FT_LOAD_TARGET_NORMAL), myUChar (0) { if (myFTLib.IsNull()) @@ -131,7 +132,7 @@ bool Font_FTFont::loadGlyph (const Standard_Utf32Char theUChar) 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; @@ -150,7 +151,7 @@ bool Font_FTFont::RenderGlyph (const Standard_Utf32Char theUChar) 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) { diff --git a/src/Font/Font_FTFont.hxx b/src/Font/Font_FTFont.hxx index 8e6de21d00..73ce754899 100755 --- a/src/Font/Font_FTFont.hxx +++ b/src/Font/Font_FTFont.hxx @@ -205,6 +205,7 @@ protected: 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 diff --git a/tests/bugs/vis/bug24555 b/tests/bugs/vis/bug24555 new file mode 100755 index 0000000000..1fd7d04c77 --- /dev/null +++ b/tests/bugs/vis/bug24555 @@ -0,0 +1,36 @@ +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