From 67bbbb2800ecca2956d5d86770cbb9c9f69f14cd Mon Sep 17 00:00:00 2001 From: Walzer Date: Thu, 20 Oct 2011 14:56:39 +0800 Subject: [PATCH] 1. relative to bug #754, FontTest should use "fonts/abc.ttf" as external ttf name 2. fixed a tiny bug, FontTest can show font name on the top correctly --- cocos2dx/platform/ios/CCImage_ios.mm | 2 +- tests/tests/FontTest/FontTest.cpp | 19 +++++-------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/cocos2dx/platform/ios/CCImage_ios.mm b/cocos2dx/platform/ios/CCImage_ios.mm index cfb9258f7e..25885dd5b5 100644 --- a/cocos2dx/platform/ios/CCImage_ios.mm +++ b/cocos2dx/platform/ios/CCImage_ios.mm @@ -338,7 +338,7 @@ static CGSize _caculateStringSizeWithFontOrZFont(NSString *str, id font, CGSize CGSize tmp; if (isZfont) { - [FontLabelStringDrawingHelper sizeWithZFont:str zfont:font]; + tmp = [FontLabelStringDrawingHelper sizeWithZFont:str zfont:font]; } else { diff --git a/tests/tests/FontTest/FontTest.cpp b/tests/tests/FontTest/FontTest.cpp index 593ded6111..76ffe55262 100644 --- a/tests/tests/FontTest/FontTest.cpp +++ b/tests/tests/FontTest/FontTest.cpp @@ -9,21 +9,13 @@ enum { }; static int fontIdx = 0; + +static std::string fontList[] = +{ #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) -static std::string fontList[] = -{ - "American Typewriter", + "American Typewriter", "Marker Felt", - "A Damn Mess", - "Abberancy", - "Abduction", - "Paint Boy", - "Schwarzwald Regular", - "Scissor Cuts", -}; -#else -static std::string fontList[] = -{ +#endif "fonts/A Damn Mess.ttf", "fonts/Abberancy.ttf", "fonts/Abduction.ttf", @@ -31,7 +23,6 @@ static std::string fontList[] = "fonts/Schwarzwald Regular.ttf", "fonts/Scissor Cuts.ttf", }; -#endif static const char* nextAction(void) {