diff --git a/modules/core_fonts/verdana-11px-rounded.otfont b/modules/core_fonts/verdana-11px-rounded.otfont index 10ecefc2..6f3a49ae 100644 --- a/modules/core_fonts/verdana-11px-rounded.otfont +++ b/modules/core_fonts/verdana-11px-rounded.otfont @@ -3,6 +3,7 @@ Font texture: verdana-11px-rounded.png height: 14 glyph-size: 16 16 + spacing: -1 0 glyph-widths: 32: 4 diff --git a/src/framework/graphics/font.cpp b/src/framework/graphics/font.cpp index ac7c0cef..6cd9c307 100644 --- a/src/framework/graphics/font.cpp +++ b/src/framework/graphics/font.cpp @@ -188,7 +188,9 @@ const std::vector& Font::calculateGlyphsPositions(const std::string& text lineWidths.resize(lines+1); lineWidths[lines] = 0; } else if(glyph >= 32) { - lineWidths[lines] += m_glyphsSize[glyph].width(); + lineWidths[lines] += m_glyphsSize[glyph].width() ; + if((i+1 != textLength && text[i+1] != '\n')) // only add space if letter is not the last or before a \n. + lineWidths[lines] += m_glyphSpacing.width(); maxLineWidth = std::max(maxLineWidth, lineWidths[lines]); } } @@ -221,7 +223,7 @@ const std::vector& Font::calculateGlyphsPositions(const std::string& text // render only if the glyph is valid if(glyph >= 32 && glyph != (uchar)'\n') { - virtualPos.x += m_glyphsSize[glyph].width(); + virtualPos.x += m_glyphsSize[glyph].width() + m_glyphSpacing.width(); } } diff --git a/src/otclient/net/protocolgameparse.cpp b/src/otclient/net/protocolgameparse.cpp index a7de893e..813612fc 100644 --- a/src/otclient/net/protocolgameparse.cpp +++ b/src/otclient/net/protocolgameparse.cpp @@ -1055,6 +1055,9 @@ ThingPtr ProtocolGame::internalGetThing(InputMessage& msg) uint32 id = msg.getU32(); std::string name = msg.getString(); + if(name.length() > 0) // every creature name must have a capital letter + name[0] = toupper(name[0]); + g_map.removeCreatureById(removeId); if(m_localPlayer->getId() == id)