Browse Source

Merge pull request #1557 from seanpaultaylor/next

Updated sample fonts which now have kerning.
Sean Taylor 11 years ago
parent
commit
f725797d19

+ 8 - 3
CHANGES.md

@@ -1,20 +1,25 @@
 ## v3.0.0
 
 - Adds support for MacOSX 64-bit.
-- Adds support for iOS 7.1.
-- Adds updates to FBX SDK 2015.1.
+- Adds support for iOS 8
+- Adds support for XCode 6
+- Adds support for Eclipse for Linux.
+- Adds support for Eclipse for Android.
+- Adds updates to FBX SDK 2015.1
 - Adds support for Bullet Physics 2.82
 - Adds gameplay-encoder support for Visual Studio 2013.
 - Adds support for C++11.
+- Adds support for font kerning.
 - Fixes Android to build with arm instead of thumb.
 
+
 ## v2.0.0
 
 - Adds support for Visual Studio 2013.
 - Adds support for iOS 7, MacOS X 10.9 and XCode 5.
 - Adds support for BlackBerry NDK 10.2.
 - Adds support for CollisionObject group mask filtering.
-- Adds support in shaders for mulitple lights using shader defines.
+- Adds support in shaders for multiple lights using shader defines.
 - Adds various improvements to Material binding support.
 - Adds support for array MaterialParameter's.
 - Adds support for encoding distance field based fonts.

BIN
gameplay/res/ui/arial.gpb


BIN
samples/browser/res/common/fonts/arial-distance.gpb


BIN
samples/browser/res/common/fonts/badaboom.gpb


BIN
samples/browser/res/common/fonts/fishfingers.gpb


BIN
samples/browser/res/common/fonts/neuropol.gpb


+ 5 - 5
samples/browser/src/Audio3DSample.cpp

@@ -151,7 +151,7 @@ void Audio3DSample::render(float elapsedTime)
     // Visit all the nodes in the scene for drawing
     _scene->visit(this, &Audio3DSample::drawScene);
 
-    drawDebugText(5, _font->getSize());
+    drawDebugText(5, 20, 18);
 
     _gamepad->draw();
     drawFrameRate(_font, Vector4(0, 0.5f, 1, 1), 5, 1, getFrameRate());
@@ -315,15 +315,15 @@ void Audio3DSample::addSound(const std::string& file)
     node->release();
 }
 
-void Audio3DSample::drawDebugText(int x, int y)
+void Audio3DSample::drawDebugText(int x, int y, unsigned int fontSize)
 {
     _font->start();
     static const int V_SPACE = 16;
     AudioListener* audioListener = AudioListener::getInstance();
     drawVector3("Position", audioListener->getPosition(), x, y);
-    drawVector3("Forward", audioListener->getOrientationForward(), x, y+=_font->getSize());
-    drawVector3("Orientation", audioListener->getOrientationUp(), x, y+=_font->getSize());
-    drawVector3("Velocity", audioListener->getVelocity(), x, y+=_font->getSize());
+    drawVector3("Forward", audioListener->getOrientationForward(), x, y += fontSize);
+    drawVector3("Orientation", audioListener->getOrientationUp(), x, y += fontSize);
+    drawVector3("Velocity", audioListener->getVelocity(), x, y += fontSize);
     _font->finish();
 }
 

+ 1 - 1
samples/browser/src/Audio3DSample.h

@@ -39,7 +39,7 @@ private:
 
     void addSound(const std::string& file);
 
-    void drawDebugText(int x = 0, int y = 0);
+    void drawDebugText(int x, int y, unsigned int fontSize);
 
     void drawVector3(const char* str, const Vector3& vector, int x, int y);
 

+ 15 - 14
samples/browser/src/InputSample.cpp

@@ -129,6 +129,7 @@ void InputSample::render(float elapsedTime)
     _inputSampleControls->draw();
 
     // Draw text
+    unsigned int fontSize = 18;
     Vector4 fontColor(1.0f, 1.0f, 1.0f, 1.0f);
     unsigned int width, height;
     char buffer[50];
@@ -147,43 +148,43 @@ void InputSample::render(float elapsedTime)
         for (std::list<TouchPoint>::const_iterator it = _touchPoints.begin(); it != _touchPoints.end(); ++it)
         {
             sprintf(buffer, "T_%u(%d,%d)", it->_id, (int)it->_coord.x, (int)it->_coord.y);
-            _font->measureText(buffer, _font->getSize(), &width, &height);
+            _font->measureText(buffer, fontSize, &width, &height);
             int x = it->_coord.x - (int)(width>>1);
             int y = it->_coord.y - (int)(height>>1);
-            _font->drawText(buffer, x, y, fontColor, _font->getSize());
+            _font->drawText(buffer, x, y, fontColor, fontSize);
         }
 
         // Mouse
         sprintf(buffer, "M(%d,%d)", (int)_mousePoint.x, (int)_mousePoint.y);
-        _font->measureText(buffer, _font->getSize(), &width, &height);
+        _font->measureText(buffer, fontSize, &width, &height);
         int x = _mousePoint.x - (int)(width>>1);
         int y = _mousePoint.y - (int)(height>>1);
-        _font->drawText(buffer, x, y, fontColor, _font->getSize());
+        _font->drawText(buffer, x, y, fontColor, fontSize);
         if (!_keyboardState && _mouseString.length() > 0)
         {
-            int y = getHeight() - _font->getSize();
-            _font->drawText(_mouseString.c_str(), 0, y, fontColor, _font->getSize());
+            int y = getHeight() - fontSize;
+            _font->drawText(_mouseString.c_str(), 0, y, fontColor, fontSize);
         }
         if (_mouseWheel)
         {
             sprintf(buffer, "%d", _mouseWheel);
-            _font->measureText(buffer, _font->getSize(), &width, &height);
+            _font->measureText(buffer, fontSize, &width, &height);
             int x = _mouseWheelPoint.x - (int)(width>>1);
             int y = _mouseWheelPoint.y + 4;
-            _font->drawText(buffer, x, y, fontColor, _font->getSize());
+            _font->drawText(buffer, x, y, fontColor, fontSize);
         }
     }
 
     // Pressed keys
     if (_keyboardString.length() > 0)
     {
-        _font->drawText(_keyboardString.c_str(), 0, 0, fontColor, _font->getSize());
+        _font->drawText(_keyboardString.c_str(), 0, 0, fontColor, fontSize);
     }
     
     // Printable symbols typed
     if (_symbolsString.length() > 0)
     {
-        _font->drawText(_symbolsString.c_str(), 0, _font->getSize(), fontColor, _font->getSize());
+        _font->drawText(_symbolsString.c_str(), 0, 18, fontColor, fontSize);
     }
 
     // Held keys
@@ -197,10 +198,10 @@ void InputSample::render(float elapsedTime)
         }
         if (!displayKeys.empty())
         {
-            _font->measureText(displayKeys.c_str(), _font->getSize(), &width, &height);
+            _font->measureText(displayKeys.c_str(), 18, &width, &height);
             int x = Game::getInstance()->getWidth() - width;
             int y = 0;
-            _font->drawText(displayKeys.c_str(), x, y, fontColor, _font->getSize());
+            _font->drawText(displayKeys.c_str(), x, y, fontColor, fontSize);
         }
     }
 
@@ -218,8 +219,8 @@ void InputSample::render(float elapsedTime)
         _formNode->getForm()->draw();
 
         sprintf(buffer, "Pitch: %f   Roll: %f", pitch, roll);
-        _font->measureText(buffer, _font->getSize(), &width, &height);
-        _font->drawText(buffer, getWidth() - width, getHeight() - height, fontColor, _font->getSize());
+        _font->measureText(buffer, 18, &width, &height);
+        _font->drawText(buffer, getWidth() - width, getHeight() - height, fontColor, fontSize);
     }
     _font->finish();
 }

+ 1 - 1
samples/browser/src/MeshBatchSample.cpp

@@ -75,7 +75,7 @@ void MeshBatchSample::render(float elapsedTime)
     _font->start();
     char text[1024];
     sprintf(text, "Touch to add triangles (%d)", (int)(_vertices.size() / 3));
-    _font->drawText(text, 10, getHeight() - _font->getSize() - 10, Vector4::one(), _font->getSize());
+    _font->drawText(text, 10, getHeight() - _font->getSize() - 10, Vector4::one(), 18);
     _font->finish();
 }
 

+ 1 - 1
samples/browser/src/PostProcessSample.cpp

@@ -223,7 +223,7 @@ void PostProcessSample::drawTechniqueId(const char* techniqueId)
     char buffer[128];
     sprintf(buffer, "%s", techniqueId);
     _font->start();
-    _font->drawText(buffer, Rectangle(0, 10, getWidth(), getHeight()), Vector4::one(), _font->getSize(), Font::ALIGN_TOP_HCENTER);
+    _font->drawText(buffer, Rectangle(0, 10, getWidth(), getHeight()), Vector4::one(), 18, Font::ALIGN_TOP_HCENTER);
     _font->finish();
 }
 

+ 1 - 1
samples/browser/src/Sample.cpp

@@ -268,6 +268,6 @@ void Sample::drawFrameRate(Font* font, const Vector4& color, unsigned int x, uns
     char buffer[10];
     sprintf(buffer, "%u", fps);
     font->start();
-    font->drawText(buffer, x, y, color, font->getSize());
+    font->drawText(buffer, x, y, color, 18);
     font->finish();
 }

+ 1 - 1
samples/browser/src/TextureSample.cpp

@@ -62,7 +62,7 @@ void TextureSample::initialize()
     cameraNode->translate(0, 0, 50);
     SAFE_RELEASE(camera);
 
-    const float fontSize = _font->getSize();
+    const float fontSize = 18;
     const float cubeSize = 10.0f;
     float x, y, textWidth;
     // Find the width of the cube in screen space

+ 1 - 1
samples/lua/res/game.lua

@@ -53,7 +53,7 @@ function render(elapsedTime)
     -- Draw the fps.
     local buffer = string.format("%u\n%s", Game.getInstance():getFrameRate(), _stateMachine:getActiveState():getId())
     _font:start()
-    _font:drawText(buffer, 5, 1, textColor, _font:getSize())
+    _font:drawText(buffer, 5, 1, textColor, 18)
     _font:finish()
 end
 

BIN
samples/spaceship/res/airstrip.gpb