Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom fonts #762

Open
evshi opened this issue Aug 1, 2024 · 2 comments · May be fixed by #803
Open

Support custom fonts #762

evshi opened this issue Aug 1, 2024 · 2 comments · May be fixed by #803
Assignees
Labels
p1 High priority

Comments

@evshi
Copy link
Contributor

evshi commented Aug 1, 2024

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: EnsembleUI/ensemble#1505

@evshi evshi added the p1 High priority label Aug 1, 2024
@evshi evshi added this to the React-Flutter Crossplay milestone Aug 1, 2024
@evshi evshi assigned sagardspeed2 and justEhmadSaeed and unassigned jkorn8 Aug 23, 2024
@sagardspeed2
Copy link
Contributor

sagardspeed2 commented Aug 25, 2024

@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 )
image

In theme.yaml
image

I added fonts in public folder
image

and here is the output
image

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 ?

@evshi
Copy link
Contributor Author

evshi commented Aug 27, 2024

@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

@sagardspeed2 sagardspeed2 linked a pull request Aug 28, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1 High priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants