Open evshi opened 1 month ago
@evshi
Based on the solution mentioned in https://stackoverflow.com/questions/41676054/how-to-add-fonts-to-create-react-app-based-projects and the way Flutter Ensemble registers fonts in the pubspec.yaml file, we can simplify the process of adding custom fonts to our project.
If we place our index.css file in the public folder and add our fonts to the public folder as well, then register the fonts in index.css using the @font-face rule, we won’t need to make any additional changes to our implementation. The custom font family will automatically be supported in the theme file.
In index.css ( this will be moved to public folder, so fonts src path will also change according to that )
In theme.yaml
I added fonts in public folder
and here is the output
where the button us using the custom font family
give your thoughts on this and if I am doing anything wrong here or missed anything ?
@sagardspeed2 in ensemble fonts are fetched from firebase they aren't always built into the project. So you need to find a way to load fonts at runtime. Please discuss with @justEhmadSaeed
Is your feature request related to a problem? Please describe. Fonts are important part of branding and UX. Customers have the ability to upload their own fonts or reference open source fonts like google fonts.
Describe the solution you'd like https://docs.ensembleui.com/theme-and-styling/custom-fonts
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here. EDL implemented in Flutter runtime: https://github.com/EnsembleUI/ensemble/issues/1505