Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

No easy way to use Custom Font for FormattedString on Android

$
0
0

Custom font in Label is simple by using custom renderer but FormattedString is not the case.

Not only I have to read deeply into the assembly of Xamarin Forms to find out the lifecycle behind, but almost every steps I wish to override are all

  • extensions (FormattedString.ToAttributed)
  • private (Label.UpdateText())
  • sealed (Span)

which cannot be overrided.

I end up spending a few hours and re-implementing the whole chain from LabelRenderer to FormattedStringExtensions just to change the implementation of Font.ToTypeface() (Gist). :(

My questions:

  1. Is there workaround which is easier and more elegant?

  2. Are Xamarin Team going to make more classes public or virtual so that even without open sourcing the project, developers can modify some behaviours more easily?


Update:

I just found that Text in Span is not BindableProperty AND AGAIN Span is a sealed class :( :( :( Could Xamarin Team make it either non-sealed or bindable so that Span can become a useful class again?

Duplicate: http://forums.xamarin.com/discussion/21653/formattedstring-spans-tap-gesture


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>