-
Notifications
You must be signed in to change notification settings - Fork 144
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
[HELP] Custom Font Support #71
Comments
@jaredrummler Any news about that? Calligraphy3 and ViewPump basically set a standard font in all views, including dialogs, snack bars, etc. Maybe it would be better if you remove the font option and create an extra module for that?! I got it partly working: abstract class AdvancedActivity : AppCompatActivity(), BaseCyaneaActivity {
companion object {
init {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true)
}
}
private val delegate: CyaneaDelegate by lazy {
CyaneaDelegate.create(this, cyanea, getThemeResId())
}
private val resources: CyaneaResources by lazy {
CyaneaResources(super.getResources(), cyanea)
}
override fun attachBaseContext(newBase: Context) {
super.attachBaseContext(ViewPumpContextWrapper.wrap(delegate.wrap(newBase)))
}
override fun onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) {
delegate.onCreate(savedInstanceState)
super.onCreate(savedInstanceState, persistentState)
}
override fun onPostCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) {
super.onPostCreate(savedInstanceState, persistentState)
delegate.onPostCreate(savedInstanceState)
}
override fun onStart() {
super.onStart()
delegate.onStart()
}
override fun onResume() {
super.onResume()
delegate.onResume()
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
delegate.onCreateOptionsMenu(menu)
return super.onCreateOptionsMenu(menu)
}
override fun getResources(): Resources = resources
} And MainActivity extending AdvancedActivity: class MainActivity : AdvancedActivity() {
...
} However my custom toolbars e.g. does not apply changed colors (works like a charm when using without calligraphy and viewpump) |
Hi,
I am using Calligraphy for custom font support of user choice. But after coming to Cyanea, the fonts are not applied to the application.
I read about the FontDecorator but is it only to be used in XML (Also I'm not getting the kotlin part, I'm still using Java). I want to use custom fonts of user choice from a list of given fonts stored in assets. How am I supposed to use them?
The text was updated successfully, but these errors were encountered: