Uno.Themes icon indicating copy to clipboard operation
Uno.Themes copied to clipboard

[Material][Cupertino] Default fonts need to be included in library and overridable

Open kazo0 opened this issue 3 years ago • 6 comments

SF Pro for Cupertino Roboto for Material

Figure out how to properly import Font files embedded in the Cupertino/Material libraries into the client apps and properly reference them in things like TextBlock styles.

Also, provide a mechanism to be able to override the default font provided by the libraries.

kazo0 avatar Jun 07 '21 13:06 kazo0

https://devblogs.microsoft.com/xamarin/embedded-fonts-xamarin-forms/

Xamarin Blog
Learn how to use embedded fonts in Xamarin.Forms - no more platform-specific handling of fonts or adding font files in multiple projects.

kazo0 avatar Jun 07 '21 14:06 kazo0

Also, provide a mechanism to be able to override the default font provided by the libraries.

This is a important requirement for projects.

jeanplevesque avatar Sep 30 '21 19:09 jeanplevesque

Related to https://github.com/unoplatform/uno/issues/3588

jeromelaban avatar Sep 30 '21 20:09 jeromelaban

@kazo0 Can you explain what one needs to define to override the FontFamily globally in Material? Do we have docs? I'd like to close this

francoistanguay avatar Nov 16 '22 18:11 francoistanguay

Styles within Uno.Material reference any one of these three FontFamilies: MaterialLightFontFamily, MaterialMediumFontFamily, and MaterialRegularFontFamily. You can set these resources to any FontFamily that you want by using the OverrideSource property of the MaterialFonts class that is initialized in the App.xaml. See docs for that here: https://platform.uno/docs/articles/external/uno.themes/doc/material-getting-started.html#change-default-font

So for this issue, we now have a way to override the fonts but we still aren't yet embedding the Roboto/SF Pro fonts into the library. I believe we are currently working on being able to have libraries bring in their own assets to be used within the consuming application, right?

kazo0 avatar Nov 16 '22 19:11 kazo0

Yes, it's part of 4.7: https://platform.uno/docs/articles/features/file-management.html?q=storagefil#support-for-library-provided-assets.

jeromelaban avatar Nov 16 '22 19:11 jeromelaban