Disable default font for AlertDialog
Hello. I've set for my application default font as Amatic-Bold.ttf using
CalligraphyConfig.initDefault(new CalligraphyConfig.Builder() .setDefaultFontPath("fonts/Amatic-Bold.ttf") .build());
and in every activity
@Override protected void attachBaseContext(Context newBase) { super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase)); }
Everything works as it should - all texts are displayed using my font. However I would like to turn off that font in AlertDialog - there texts should be normal, using system default font. How can it be done? Can it?
Easily, no.
But, don't set a default font in the CalligraphyConfig. Then set a fontPath on the textStyles in your Themes, then just don't define one for your Alert Dialog.
We are going to go down the font manager route where Calligraphy supports font families bold/italic making this obsolete.
I am also tempted to remove the default font as it doesn't follow the Android pattern. But I'll discuss that in the open.
On Thu, 31 Mar 2016, 13:29 Yahya Bayramoğlu, [email protected] wrote:
@chrisjenx https://github.com/chrisjenx is it possible to set different fontPath as default for different textStyles? Because when i set defaultFontPath AlertDialog title stops being bold styled.
So it would be nice to have defining different fontPath's for different textStyles and having use them as regular as we do always. Something like:
CalligraphyConfig.initDefault(new CalligraphyConfig.Builder() .setDefaultFontPath("fonts/someFont.ttf") .setBoldFontPath("fonts/someBoldFont.ttf") .setItalicFontPath("fonts/someItalicFont.ttf") .setFontAttrId(R.attr.fontPath) .build());
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/chrisjenx/Calligraphy/issues/267#issuecomment-203907479
Hey, i had deleted my question because i saw the other issues, but thanks for replying this quick.
Looking forward to have this implementation though @chrisjenx
No worries Yahya, feel free to post ideas and suggestions, the lib is a bit mis-loved at the moment :(
On Thu, 31 Mar 2016 at 14:40 Yahya Bayramoğlu [email protected] wrote:
Hey, i had deleted my question because i saw the other issues, but thanks for replying this quick.
Looking forward to have this implementation though @chrisjenx https://github.com/chrisjenx
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/chrisjenx/Calligraphy/issues/267#issuecomment-203941709