[forms-devel] Xamarin.Forms Android Custom Font Support

johan.kson at gmail.com johan.kson at gmail.com
Tue Jun 14 20:50:19 UTC 2016


Hi!

I like it! Go for it! :) oh, and what Jason said. 

// Johan (not a xamarin employee, just your average xamarin enthusiast) 

Skickat från min iPhone

> 14 juni 2016 kl. 20:51 skrev Roy Vousten <royvou at hotmail.com>:
> 
> Hello Xamarin.Forms Community,
> 
> Why doesn't Xamarin.Forms support custom Font's for various controls on the Android Platform?
> 
> As a recap the current situation.
> (https://developer.xamarin.com/guides/xamarin-forms/user-interface/text/fonts/):
> iOS: Use the Font Name (Custom fonts that should be loaded are defined in info.plist).
> Android: Create a Custom renderer  or use the font name for a system font.
> WP: Use filelocation # fontname for a custom font, or use the font name for a system font.
> 
> Something that could be implemented for Android so custom fonts is a supported feature across all platforms.
> 
> We could parse the FontFamily property to determine if it's an filelocation/filename [myawesomefont.ttf/myawesomefont.otf]. If it is, we should load the font from that location, otherwise it's a normal font and we should use the current way of loading a font.
> 
> It seems to be all that has to be changed is this:
> https://github.com/royvou/Xamarin.Forms/blob/android-customfont/Xamarin.Forms.Platform.Android/Renderers/FontExtensions.cs
> 
> 
> This shouldn't have a big impact on the codebase and not break existing apps.
> 
> 
> Thoughts?
> 
> Roy
> _______________________________________________
> forms-devel mailing list
> forms-devel at lists.xamarin.com
> http://lists.ximian.com/mailman/listinfo/forms-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/forms-devel/attachments/20160614/c5c0d223/attachment.html>


More information about the forms-devel mailing list