Просмотр исходного кода

Merge pull request #1641 from rgngl/patch-1

Add 1 pixel padding to generated font atlas
Sean Taylor 11 лет назад
Родитель
Сommit
79a3b05f07
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      tools/encoder/src/TTFFontEncoder.cpp

+ 2 - 2
tools/encoder/src/TTFFontEncoder.cpp

@@ -316,7 +316,7 @@ int writeFont(const char* inFilePath, const char* outFilePath, std::vector<unsig
         // Allocate temporary image buffer to draw the glyphs into.
         unsigned char* imageBuffer = (unsigned char*)malloc(imageWidth * imageHeight);
         memset(imageBuffer, 0, imageWidth * imageHeight);
-        penX = 0;
+        penX = 1;
         penY = 0;
         row = 0;
         i = 0;
@@ -339,7 +339,7 @@ int writeFont(const char* inFilePath, const char* outFilePath, std::vector<unsig
             // If we reach the end of the image wrap aroud to the next row.
             if ((penX + advance) > (int)imageWidth)
             {
-                penX = 0;
+                penX = 1;
                 row += 1;
                 penY = row * rowSize;
                 if (penY + rowSize > (int)imageHeight)