From 783dfb3f148bf3a940f9a648bcb8f37048d089d3 Mon Sep 17 00:00:00 2001 From: zilongshanren Date: Wed, 22 Jun 2016 16:54:01 +0800 Subject: [PATCH 1/2] fix system font name on Android ttf creation --- cocos/platform/android/CCDevice-android.cpp | 2 +- tests/js-tests/src/FontTest/FontTest.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cocos/platform/android/CCDevice-android.cpp b/cocos/platform/android/CCDevice-android.cpp index f18c4cd7f0..ccc4b43967 100644 --- a/cocos/platform/android/CCDevice-android.cpp +++ b/cocos/platform/android/CCDevice-android.cpp @@ -114,7 +114,7 @@ public: int count = strlen(text); jbyteArray strArray = methodInfo.env->NewByteArray(count); methodInfo.env->SetByteArrayRegion(strArray, 0, count, reinterpret_cast(text)); - jstring jstrFont = methodInfo.env->NewStringUTF(fullPathOrFontName.c_str()); + jstring jstrFont = methodInfo.env->NewStringUTF(fullPathOrFontName.empty() ? textDefinition._fontName.c_str() : fullPathOrFontName.c_str()); if(!methodInfo.env->CallStaticBooleanMethod(methodInfo.classID, methodInfo.methodID, strArray, jstrFont, textDefinition._fontSize, textDefinition._fontFillColor.r, textDefinition._fontFillColor.g, diff --git a/tests/js-tests/src/FontTest/FontTest.js b/tests/js-tests/src/FontTest/FontTest.js index fe65ef667b..57f1e2411e 100644 --- a/tests/js-tests/src/FontTest/FontTest.js +++ b/tests/js-tests/src/FontTest/FontTest.js @@ -33,6 +33,8 @@ var fontIdx = 0; var fontList = [ // System Fonts + "sans-serif", + "sans-serif-light", "Verdana", "Lucida Sans Unicode", "Bookman Old Style", From 8366983a018a649e32c0c040798babd7c1653738 Mon Sep 17 00:00:00 2001 From: zilongshanren Date: Wed, 22 Jun 2016 17:01:53 +0800 Subject: [PATCH 2/2] fix js ui test missing UITest.json --- tests/cpp-tests/Resources/ccs-res | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cpp-tests/Resources/ccs-res b/tests/cpp-tests/Resources/ccs-res index fab8c569a8..50f82c2e07 160000 --- a/tests/cpp-tests/Resources/ccs-res +++ b/tests/cpp-tests/Resources/ccs-res @@ -1 +1 @@ -Subproject commit fab8c569a8f27a2ff7c1150c22507d727efe5c17 +Subproject commit 50f82c2e0736d127e0b58fef0d8b773af90a7f3d