-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Introduce a FontRef #5515
Copy link
Copy link
Open
Labels
A-AssetsLoad files from disk to use for things like images, models, and soundsLoad files from disk to use for things like images, models, and soundsA-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-FeatureA new feature, making something new possibleA new feature, making something new possible
Metadata
Metadata
Assignees
Labels
A-AssetsLoad files from disk to use for things like images, models, and soundsLoad files from disk to use for things like images, models, and soundsA-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-FeatureA new feature, making something new possibleA new feature, making something new possible
What problem does this solve or what need does it fill?
Declaring a
TextStylewhenever you create aTextnode is annoying because you need an asset_server to load the fontWhat solution would you like?
Implement a
FontRefinspired by theShaderRefof the newMaterialHere's what I assume it would look like
This should be done alongside an
impl Into<FontRef> for &strto make it easy to just create a FontRef from a static string path.What alternative(s) have you considered?
Font inheritance would be an interesting possibility, but I think font inheritance could be implemented on top of this
FontRefAdditional context
This would also partially fix the lack of a default font with bevy since we could register a font once in a startup resource and just use it everytime
FontRef::Defaultis used.