简体   繁体   English

Pixate Freestyle是否在Android上支持自定义字体?

[英]Does Pixate Freestyle support custom fonts on Android?

Is it possible to use typeFaces with Pixate Freestyle on Android? 在Android上可以将typeFaces与Pixate Freestyle一起使用吗?

For example: 例如:

label{
    font-family: "MyCustomFont";
}

Remember that I'll put the font file inside the Assets folder. 请记住,我将字体文件放在Assets文件夹中。

In general, the font support is similar to what Pixate Freestyle have for iOS (see http://www.pixate.com/blog/2013-04-09-font-properties/ ). 通常,字体支持与Pixate Freestyle for iOS相似(请参见http://www.pixate.com/blog/2013-04-09-font-properties/ )。 However, the Android version only supports the built-in font-families. 但是,Android版本仅支持内置字体家族。 The fonts (Typefaces) loading is done at the https://github.com/Pixate/pixate-freestyle-android/blob/master/pixate-freestyle/src/com/pixate/freestyle/styling/fonts/PXFontRegistry.java class, and although there is a method there to load from a resource, this method is never called. 字体(Typefaces)的加载在https://github.com/Pixate/pixate-freestyle-android/blob/master/pixate-freestyle/src/com/pixate/freestyle/styling/fonts/PXFontRegistry.java类中完成,尽管那里有一种可以从资源中加载的方法,但永远不会调用此方法。 We'll need to fix that to have a custom-font support. 我们需要对其进行修复以提供自定义字体支持。 However, it will still be tricky with the font-family detection since Android's API does not provide the font family information when loading a Typeface as an asset (we may have to do an actual reading of the ttf file to get that information, like in here - http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/TTFReader.java ). 但是,由于字体家族检测仍然很棘手,因为在将Typeface作为资产加载时,Android的API不会提供字体家族信息(我们可能必须对ttf文件进行实际读取才能获取该信息,例如此处-http: //svn.apache.org/repos/asf/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/TTFReader.java )。

In case you would like to contribute any change, you are more then welcome, as it may take some time till we can get to it. 如果您想做出任何更改,欢迎您,因为我们可能需要一些时间才能完成更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM