Calligraphy icon indicating copy to clipboard operation
Calligraphy copied to clipboard

Using custom font with variants.

Open staroflead opened this issue 8 years ago • 9 comments

How can I use font's variant like light, bold,italic? Can I use textStyle attribute and set only font family to able to use all 4 variants? And how can I reuse default font arial after I have init the config in application onCreate() ?

staroflead avatar Mar 17 '16 10:03 staroflead

It's an old requested feature see #195

Need to work out a way to build Typeface Families.

chrisjenx avatar Mar 18 '16 13:03 chrisjenx

The MeetMe/font-compat project does this automatically on Lollipop+. And there's a workaround that works for KitKat and earlier, with some style tweaks.

jhansche avatar Mar 28 '16 14:03 jhansche

That font-compat is complicated to use. But I'll take how he generates font families.

Thanks for linking.

On Mon, 28 Mar 2016, 15:27 Joe, [email protected] wrote:

The MeetMe/font-compat https://github.com/MeetMe/font-compat project does this automatically on Lollipop+. And there's a workaround that works for KitKat and earlier, with some style tweaks.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/chrisjenx/Calligraphy/issues/264#issuecomment-202416461

chrisjenx avatar Mar 28 '16 14:03 chrisjenx

Complicated because of the way the families are parsed? It mirrors the way that the Android platform configures font families, which means if/when Android ever exposes that capability, it will likely mirror that style of configuration: https://github.com/MeetMe/font-compat/blob/master/sample/src/main/res/raw-v19/fonts.xml

jhansche avatar Mar 28 '16 16:03 jhansche

Hey guys, Did anyone get a fix for this?

bmutinda avatar Apr 17 '16 11:04 bmutinda

I use seperated fontpath for each variant. Unfotunately, it's currently the only way.

staroflead avatar Apr 17 '16 12:04 staroflead

I actually have found a better way to do this. :D

On Sun, 17 Apr 2016 at 13:02 staroflead [email protected] wrote:

I use seperated fontpath for each variant. Unfotunately, it's currently the only way.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/chrisjenx/Calligraphy/issues/264#issuecomment-211007108

chrisjenx avatar Apr 17 '16 14:04 chrisjenx

Please enlighten us :)

staroflead avatar Apr 17 '16 14:04 staroflead

Very similar to the font manager mechanism. But I think I'd always do it as third party attribute and pull out the text Style at the same time.

Basically the best of both worlds, font compat plus Calligraphy :D

On Sun, 17 Apr 2016, 15:42 staroflead, [email protected] wrote:

Please enlighten us :)

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/chrisjenx/Calligraphy/issues/264#issuecomment-211033634

chrisjenx avatar Apr 17 '16 15:04 chrisjenx