mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
Fix for fonts with no kerning tables
Apply deltas even if the font has no kerning table
This commit is contained in:
parent
7a0c35c334
commit
f76f0607c7
@ -384,7 +384,7 @@ float Font::getKerning(Uint32 first, Uint32 second, unsigned int characterSize)
|
|||||||
|
|
||||||
FT_Face face = static_cast<FT_Face>(m_face);
|
FT_Face face = static_cast<FT_Face>(m_face);
|
||||||
|
|
||||||
if (face && FT_HAS_KERNING(face) && setCurrentSize(characterSize))
|
if (face && setCurrentSize(characterSize))
|
||||||
{
|
{
|
||||||
// Convert the characters to indices
|
// Convert the characters to indices
|
||||||
FT_UInt index1 = FT_Get_Char_Index(face, first);
|
FT_UInt index1 = FT_Get_Char_Index(face, first);
|
||||||
@ -396,6 +396,7 @@ float Font::getKerning(Uint32 first, Uint32 second, unsigned int characterSize)
|
|||||||
|
|
||||||
// Get the kerning vector
|
// Get the kerning vector
|
||||||
FT_Vector kerning;
|
FT_Vector kerning;
|
||||||
|
if( FT_HAS_KERNING(face))
|
||||||
FT_Get_Kerning(face, index1, index2, FT_KERNING_UNFITTED, &kerning);
|
FT_Get_Kerning(face, index1, index2, FT_KERNING_UNFITTED, &kerning);
|
||||||
|
|
||||||
// X advance is already in pixels for bitmap fonts
|
// X advance is already in pixels for bitmap fonts
|
||||||
|
Loading…
Reference in New Issue
Block a user