unoplatform / Uno.Themes

This library is designed to help you use the Material, Fluent or Cupertino design system with the Uno Platform
https://platform.uno
Apache License 2.0
170 stars 33 forks source link

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

Open kazo0 opened 3 years ago

kazo0 commented 3 years ago

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 commented 3 years ago

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

Xamarin Blog
Adding Embedded Fonts: Custom Fonts in 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.
jeanplevesque commented 3 years ago

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

This is a important requirement for projects.

jeromelaban commented 3 years ago

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

francoistanguay commented 2 years ago

@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

kazo0 commented 2 years ago

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?

Uno.Material
jeromelaban commented 2 years ago

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

File Management