Pixate / pixate-freestyle-android

Pixate Freestyle for Android
Apache License 2.0
254 stars 55 forks source link

font-face support #10

Closed dbrouard closed 10 years ago

dbrouard commented 10 years ago

Hi, thanks for such a fantastic software.

I open this issue asking for information about loading external typography and using them with font-face. All my tests where unsuccesful. Is it possible some way? how?

Thanks! Diego Brouard

Shalom commented 10 years ago

Hi Diego, Unfortunately this is a known issue. I'm pasting here the answer I gave on a support ticket we got (http://pixate.zendesk.com/agent/#/tickets/707).

I've looked into it a little bit, and there seems to be an issue there with the loading of custom fonts. In general, the font support is similar to what we have on 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).

I'll try to get to it and fix it as soon as I can. However, we are an open source project, so in case you would like to contribute any change, you are more then welcome! :)

Best, -Shalom

dbrouard commented 10 years ago

Thanks Shalom for your explanations. Be sure I'll try to contribute to this project. To me it's the great discovering for this year. I can't wait to copy and paste my default.css from android to xcode!

Right now I need to finish two projects, after that, I'll be glad to talk to you to have a look at this.

Cheers, Diego.

Shalom commented 10 years ago

No problem. Let me know if you need some guidance when you do.

RoundSparrow commented 9 years ago

Hello - I am working on an independent project. This is about 1 year ago you had this discussion. I too was looking how to get more details of the TrueType font on Android. Did you integrate http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/TTFReader.java or come up with another solution? Thank you.

Shalom commented 9 years ago

I'm afraid I never got the chance to revisit this issue. Did you start integrating the TTFReader and hit some issues? Would be good to know.

romecode commented 9 years ago

Any updates on this? @Shalom that link you posted to ticket#707 is not found.. any idea where to find it nowdays?

Shalom commented 9 years ago

It's the same content that was on 707. No updates.