Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

font for whole app not working #54

Open
moshlp opened this issue Aug 6, 2020 · 1 comment
Open

font for whole app not working #54

moshlp opened this issue Aug 6, 2020 · 1 comment

Comments

@moshlp
Copy link

moshlp commented Aug 6, 2020

hello, I've gone over the docs and tried everything but the fonts still don't show.
This is what I've done so far:

  • Copied and pasted the fonts to assets/fonts (mind you, if I double click the ttf in Android Studio, it says "Unable to open font barlowregular.ttf")

  • Application class -> added
    ViewPump.init(ViewPump.builder()
    .addInterceptor(new CalligraphyInterceptor(
    new CalligraphyConfig.Builder()
    .setDefaultFontPath("fonts/barlowregular.ttf")
    .setFontAttrId(R.attr.fontPath)
    .build()))
    .build());

  • Added to every activity -> @OverRide
    protected void attachBaseContext(Context newBase) {
    super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase));
    }

thanks for any help!

@chrisjenx
Copy link
Member

chrisjenx commented Feb 19, 2021

You tried with another ttf? ideally finding a "mobile" friendly one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants