2

Is it possible to use typeFaces with Pixate Freestyle on Android?

For example:

label{
    font-family: "MyCustomFont";
}

Remember that I'll put the font file inside the Assets folder.

admdrew
  • 3,790
  • 4
  • 27
  • 39

1 Answers1

0

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/). However, the Android version only supports the built-in font-families. 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. 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).

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.

sgibly
  • 3,828
  • 1
  • 21
  • 21
  • 1
    It is not possible to use JAVA.NET.URI and load the font from there and use as a font-face attribute at the CSS Style ? – Rodrigo Amaro Sep 11 '14 at 14:00