Markdown how to change the default Text size Android Markwon

655 Views Asked by At

Where can I set the configuration to set a custom font and text size for "regular text" while rendering Markdown with the Markwon dependency?

Setting custom multipliers for the headings and setting the codeBlock text sizes don't work. Neither works setting the <item name="android:textAppearance">@style/mytextappearance</item> in the application theme

1

There are 1 best solutions below

0
Some random IT boy On BEST ANSWER

Nevermind; I found it:

When building the Markwon instance you do:


Markwon
    .builder(context)
    .usePlugin(object : AbstractMarkwonPlugin(){
          override fun configureSpansFactory(builder: MarkwonSpansFactory.Builder) {
               super.configureSpansFactory(builder)
               builder.setFactory(Text::class.java) { _, _ -> TextAppearanceSpan(context, R.style.my_text_style)}

          }
    })
    .build()