Changed: Remove useless code

--HG--
branch : develop
This commit is contained in:
kervala 2019-04-21 14:42:17 +02:00
parent 869a5f2b53
commit 37dacba951

View file

@ -461,33 +461,6 @@ CFontGenerator::CFontGenerator (const std::string &fontFileName, const std::stri
SetTextAlign (hdcDib, TA_TOP | TA_LEFT | TA_NOUPDATECP);
SetBkColor (hdcDib, RGB (0,0,0));
SetTextColor (hdcDib, RGB (255, 255, 255));
/*FT_Error error;
if (!_LibraryInit)
{
error = FT_Init_FreeType (&_Library);
if (error)
{
nlerror ("FT_Init_FreeType() failed: %s", getFT2Error(error));
}
_LibraryInit = true;
}
error = FT_New_Face (_Library, fontFileName.c_str (), 0, &_Face);
if (error)
{
nlerror ("FT_New_Face() failed with file '%s': %s", fontFileName.c_str(), getFT2Error(error));
}
if (!fontExFileName.empty())
{
error = FT_Attach_File (_Face, fontExFileName.c_str ());
if (error)
{
nlwarning ("FT_Attach_File() failed with file '%s': %s", fontExFileName.c_str(), getFT2Error(error));
}
}*/
}
CFontGenerator::~CFontGenerator ()
@ -499,28 +472,6 @@ CFontGenerator::~CFontGenerator ()
void CFontGenerator::getSizes (ucchar c, uint32 size, uint32 &width, uint32 &height)
{
/* FT_Error error;
error = FT_Set_Pixel_Sizes (_Face, size, size);
if (error)
{
nlerror ("FT_Set_Pixel_Sizes() failed: %s", getFT2Error(error));
}
// retrieve glyph index from character code
FT_UInt glyph_index = FT_Get_Char_Index (_Face, c);
// load glyph image into the slot (erase previous one)
error = FT_Load_Glyph (_Face, glyph_index, FT_LOAD_DEFAULT);
if (error)
{
nlerror ("FT_Load_Glyph() failed: %s", getFT2Error(error));
}
// convert 24.6 fixed point into integer
width = _Face->glyph->metrics.width >> 6;
height = _Face->glyph->metrics.height >> 6;
*/
}
HFONT hFont = NULL;
@ -528,57 +479,6 @@ uint32 CurrentFontSize = 0;
uint8 *CFontGenerator::getBitmap (ucchar c, uint32 size, bool embolden, bool oblique, uint32 &width, uint32 &height, uint32 &pitch, sint32 &left, sint32 &top, sint32 &advx, uint32 &glyphIndex)
{
/* FT_Error error;
error = FT_Set_Pixel_Sizes (_Face, size, size);
if (error)
{
nlerror ("FT_Set_Pixel_Sizes() failed: %s", getFT2Error(error));
}
// retrieve glyph index from character code
FT_UInt glyph_index = FT_Get_Char_Index (_Face, c);
// load glyph image into the slot (erase previous one)
error = FT_Load_Glyph (_Face, glyph_index, FT_LOAD_DEFAULT);
if (error)
{
nlerror ("FT_Load_Glyph() failed: %s", getFT2Error(error));
}
if (size == 0)
{
width = 0;
height = 0;
pitch = 0;
left = 0;
top = 0;
advx = 0;
glyphIndex = glyph_index;
return NULL;
}
// convert to an anti-aliased bitmap
error = FT_Render_Glyph (_Face->glyph, ft_render_mode_normal);
if (error)
{
nlerror ("FT_Render_Glyph() failed: %s", getFT2Error(error));
}
width = _Face->glyph->bitmap.width;
height = _Face->glyph->bitmap.rows;
pitch = _Face->glyph->bitmap.pitch;
left = _Face->glyph->bitmap_left;
top = _Face->glyph->bitmap_top;
advx = _Face->glyph->advance.x >> 6;
glyphIndex = glyph_index;
return (uint8 *) _Face->glyph->bitmap.buffer;
*/
if (size == 0)
{
width = 0;
@ -705,12 +605,6 @@ uint8 *CFontGenerator::getBitmap (ucchar c, uint32 size, bool embolden, bool obl
advx = point.x;
WORD ag = 0;
/*uint t = GetGlyphIndices (hdcDib, &cc, 1, &ag, 0);
if (t == GDI_ERROR)
{
nlstop;
}
*/
glyphIndex = ag;
top = -_top;
@ -742,27 +636,12 @@ uint8 *CFontGenerator::getBitmap (ucchar c, uint32 size, bool embolden, bool obl
void CFontGenerator::getKerning (ucchar left, ucchar right, sint32 &kernx)
{
/* if (!FT_HAS_KERNING(_Face))
{
kernx = 0;
}
else
{
FT_Vector kerning;
FT_Error error = FT_Get_Kerning (_Face, left, right, ft_kerning_default, &kerning);
if (error)
{
nlerror ("FT_Get_Kerning() failed: %s", getFT2Error(error));
}
kernx = kerning.x;
}*/
}
uint32 CFontGenerator::getCharIndex (ucchar c)
{
// return FT_Get_Char_Index (_Face, c);
return 0;
}