2018-12-06 22:12:20 +01:00
|
|
|
package jp.juggler.util
|
|
|
|
|
|
|
|
import android.graphics.Typeface
|
2019-07-12 06:38:19 +02:00
|
|
|
import io.github.inflationx.calligraphy3.CalligraphyConfig
|
|
|
|
import io.github.inflationx.calligraphy3.CalligraphyInterceptor
|
|
|
|
import io.github.inflationx.calligraphy3.CalligraphyTypefaceSpan
|
|
|
|
import io.github.inflationx.viewpump.ViewPump
|
2018-12-06 22:12:20 +01:00
|
|
|
import jp.juggler.subwaytooter.R
|
|
|
|
|
2019-07-12 06:38:19 +02:00
|
|
|
fun initializeFont() {
|
|
|
|
ViewPump.init(
|
|
|
|
ViewPump.builder()
|
|
|
|
.addInterceptor(
|
|
|
|
CalligraphyInterceptor(
|
|
|
|
CalligraphyConfig.Builder()
|
|
|
|
.setFontAttrId(R.attr.fontPath)
|
|
|
|
.build()
|
|
|
|
)
|
|
|
|
)
|
2018-12-06 22:12:20 +01:00
|
|
|
.build()
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
fun fontSpan(tf : Typeface) : Any = CalligraphyTypefaceSpan(tf)
|