PlayN字体支持 [英] PlayN Font Support

查看:171
本文介绍了PlayN字体支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PlayN或支持库(如TriplePlay和其他)支持什么类型的非标准字体 - 特别是自定义TrueType字体。

解决方案

你必须在你打算使用的每个后端上注册不同的字体,但是一旦字体按名字注册,你可以像使用任何内置字体一样简单地调用 b
$ b

HTML5后端注册字体使用 @ font-face in CSS 在加载您的游戏的页面上。 Android和Java后端需要一些代码来注册字体,在iOS后端,字体必须列在 Info.plist 文件中。



PlayN Showcase示例应用程序演示了所有平台的自定义字体注册:


  • Java

  • Android

  • iOS -samples / source / browse / showcase / html / src / main / webapp / Showcase.htmlrel =noreferrer> HTML


What kind of support do the PlayN or supporting libraries (like TriplePlay and others) provide in regards to non-standard fonts -- custom TrueType fonts in particular.

解决方案

You have to register the font differently on each backend that you intend to use, but once the font is registered by name, you can use it like any built-in font by simply calling PlayN.graphics().createFont(name, style, size).

The HTML5 backend registers fonts using @font-face in CSS on the page that loads your game. The Android and Java backends require some code to register the font, and in the iOS backend the font must be listed in your Info.plist file.

The PlayN Showcase sample application demonstrates custom font registration for all platforms:

这篇关于PlayN字体支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆