diff --git a/cmake/Modules/CocosBuildHelpers.cmake b/cmake/Modules/CocosBuildHelpers.cmake index bca7f21704..0175f599b1 100644 --- a/cmake/Modules/CocosBuildHelpers.cmake +++ b/cmake/Modules/CocosBuildHelpers.cmake @@ -215,6 +215,7 @@ macro(cocos_pak_xcode cocos_target) INFO_STRING LONG_VERSION_STRING SHORT_VERSION_STRING + CUSTOM_FONT ) set(multiValueArgs) cmake_parse_arguments(COCOS_APP "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -228,6 +229,7 @@ macro(cocos_pak_xcode cocos_target) cocos_fake_set(COCOS_APP_INFO_STRING "cocos2d-x app") cocos_fake_set(COCOS_APP_LONG_VERSION_STRING "1.0.0") cocos_fake_set(COCOS_APP_SHORT_VERSION_STRING "1.0") + cocos_fake_set(COCOS_APP_CUSTOM_FONT "") # set bundle info set_target_properties(${cocos_target} PROPERTIES @@ -241,6 +243,7 @@ macro(cocos_pak_xcode cocos_target) set(MACOSX_BUNDLE_INFO_STRING ${COCOS_APP_INFO_STRING}) set(MACOSX_BUNDLE_LONG_VERSION_STRING ${COCOS_APP_LONG_VERSION_STRING}) set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${COCOS_APP_SHORT_VERSION_STRING}) + set(MACOSX_CUSTOM_FONT_FILE ${COCOS_APP_CUSTOM_FONT}) message(STATUS "cocos package: ${cocos_target}, plist file: ${COCOS_APP_INFO_PLIST}") diff --git a/cmake/Modules/iOSBundleInfo.plist.in b/cmake/Modules/iOSBundleInfo.plist.in index fa2a779a2d..76c9781d71 100644 --- a/cmake/Modules/iOSBundleInfo.plist.in +++ b/cmake/Modules/iOSBundleInfo.plist.in @@ -47,5 +47,9 @@ ${MACOSX_BUNDLE_ICON_FILE} + UIAppFonts + + ${MACOSX_CUSTOM_FONT_FILE} + diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index 4b433bbded..288bc9ad8f 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -467,7 +467,19 @@ if(APPLE) MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.mac/Info.plist" ) elseif(IOS) - cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in") + # set custom fonts + set(GAME_CUSTOM_FONT) + set(CUSTOM_FONT_LIST + "fonts/A Damn Mess.ttf" + "fonts/Abberancy.ttf" + "fonts/Paint Boy.ttf" + "fonts/Schwarzwald.ttf" + "fonts/Scissor Cuts.ttf") + foreach(font ${CUSTOM_FONT_LIST}) + string(APPEND GAME_CUSTOM_FONT "\n${font}") + endforeach() + + cocos_pak_xcode(${APP_NAME} INFO_PLIST "iOSBundleInfo.plist.in" CUSTOM_FONT ${GAME_CUSTOM_FONT}) set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon-${APP_NAME}") set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "") set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Developer")