diff options
Diffstat (limited to 'mkspecs/features/winrt')
-rw-r--r-- | mkspecs/features/winrt/font_deployment.prf | 60 | ||||
-rw-r--r-- | mkspecs/features/winrt/package_manifest.prf | 7 |
2 files changed, 66 insertions, 1 deletions
diff --git a/mkspecs/features/winrt/font_deployment.prf b/mkspecs/features/winrt/font_deployment.prf new file mode 100644 index 0000000000..36db5b7cac --- /dev/null +++ b/mkspecs/features/winrt/font_deployment.prf @@ -0,0 +1,60 @@ +# Provide default fonts for windows phone +# The DEFAULTFONTS variable indicates, whether the default set of fonts is +# used for deployment. The check below won't work after the fonts are added +# so this helper variable is added and used for the user warning check later. +!defined(FONTS, var):winphone { + FONTS = \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSans.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSans-Bold.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSans-BoldOblique.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSansMono.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSansMono-Bold.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSansMono-BoldOblique.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSansMono-Oblique.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSans-Oblique.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSerif.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSerif-Bold.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSerif-BoldOblique.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSerif-Oblique.ttf + DEFAULTFONTS = +} + +if(build_pass:equals(TEMPLATE, "app"))| \ +if(!build_pass:equals(TEMPLATE, "vcapp")) { + defined(DEFAULTFONTS, var) { + message(Default fonts will automatically be deployed with your application. \ + To avoid automatic deployment unset the \"FONTS\" variable (\"FONTS =\") in your .pro file. \ + You can also customize which fonts are deployed by setting the \"FONTS\" variable.) + } + + contains(TEMPLATE, "vc.*") { + BUILD_DIR = $$OUT_PWD + } else { + load(resolve_target) + BUILD_DIR = $$dirname(QMAKE_RESOLVED_TARGET) + } + + for (FONT, FONTS) { + font_$${FONT}.input = $$FONT + font_$${FONT}.output = $$BUILD_DIR/fonts/$$basename(FONT) + font_$${FONT}.CONFIG = verbatim + QMAKE_SUBSTITUTES += font_$${FONT} + } + + !isEmpty(FONTS):equals(TEMPLATE, "app") { + fonts.files = $$BUILD_DIR/fonts/* + isEmpty($$target.path) { + fonts.path = $$OUT_PWD/fonts + } else { + fonts.path = $$target.path/fonts + } + + INSTALLS += fonts + } +} + +!isEmpty(FONTS):winphone:equals(TEMPLATE, "vcapp"):build_pass { + fonts.files = $$OUT_PWD/fonts/* + fonts.path = fonts + DEPLOYMENT += fonts +} diff --git a/mkspecs/features/winrt/package_manifest.prf b/mkspecs/features/winrt/package_manifest.prf index a959bc5480..fda4fb5e8f 100644 --- a/mkspecs/features/winrt/package_manifest.prf +++ b/mkspecs/features/winrt/package_manifest.prf @@ -28,6 +28,7 @@ # WINRT_MANIFEST.iconic_tile_icon: Image file for the "iconic" tile template icon. Default provided by the mkspec. # WINRT_MANIFEST.iconic_tile_small: Image file for the small "iconic" tile template logo. Default provided by the mkspec. # WINRT_MANIFEST.capabilities: Specifies capabilities to add to the capability list. +# WINRT_MANIFEST.capabilities_device: Specifies device capabilities to add to the capability list. (location, webcam...) # WINRT_MANIFEST.dependencies: Specifies dependencies required by the package. # The manifest is generated for each build pass for normal apps, and only once for vcapps. @@ -95,10 +96,14 @@ # Capabilities are given as a string list and may change with the configuration (network, sensors, etc.) WINRT_MANIFEST.capabilities = $$unique(WINRT_MANIFEST.capabilities) - !isEmpty(WINRT_MANIFEST.capabilities)|winphone { + WINRT_MANIFEST.capabilities_device = $$unique(WINRT_MANIFEST.capabilities_device) + + !isEmpty(WINRT_MANIFEST.capabilities)|!isEmpty(WINRT_MANIFEST.capabilities_device)|winphone { MANIFEST_CAPABILITIES += "<Capabilities>" for(CAPABILITY, WINRT_MANIFEST.capabilities): \ MANIFEST_CAPABILITIES += " <Capability Name=\"$$CAPABILITY\" />" + !winphone:for(CAPABILITY, WINRT_MANIFEST.capabilities_device): \ + MANIFEST_CAPABILITIES += " <DeviceCapability Name=\"$$CAPABILITY\" />" MANIFEST_CAPABILITIES += "</Capabilities>" WINRT_MANIFEST.capabilities = $$join(MANIFEST_CAPABILITIES, $$INDENT, $$INDENT) |