Comments (4)
Property names follows kebab-case naming convention, like in css. Use font-size
to specify font size within eml
:
/// eml:
commands.add(eml!(<span s:font-size="42px">Hello</span>))
or ess
:
/* style.ess */
/* set font size to exact element */
span {
font-size: 42px
}
/*
text elements often resides as children of other nodes,
so it may be useful to set font props using `*` selector
*/
/* set default font size */
* {
font-size: 24px
}
/* set font size for specific block
.specific-block * {
font-size: 36px
}
There also orher font related properties:
* {
/* load custom font from assets folder */
font: "fonts/MyFont.ttf"
/* use predefined font style */
font: bold /* regular|bold|italic|bold-italic */
/* specify font color */
color: red
}
I'd like to keep this issue open, until #31 got resolved.
from belly.
Thanks a lot for your quick reply !
My bad also, I was so focused on Bevy's text attributes that I forgot to try it css style :)
That is valuable information about using a specific font as well , thanks !
It is not really an issue at this stage but would there be any way of reusing a font specified in an asset file in bevy_asset_loader
?
#31 is a very good idea !
Btw I have a list of other questions , possible bugs (still need to some testing outside of my main project to isolate things) , and (small) feature requests: is that too much at the current time or are you ok with that ?
Either way, thanks a lot for creating Belly
, very useful and promising!
from belly.
Thank you for such a words! I appreciate it!
It is not really an issue at this stage but would there be any way of reusing a font specified in an asset file in bevy_asset_loader ?
I'm not sure if I understand you question right. Lets look on this ess:
* {
font: "my-font.ttf"
}
The Text
components generated by belly will hold Handle<Font>
to my-font.ttf
asset. If you define same font in bevy_asset_loader
asset, your asset collections will hold the same Handle<Font>
to the same my-font.ttf
, so it will be the only instance of my-font.ttf
asset.
You may want to pass font by asset key:
* {
font: "collection.assets#my.font"
}
Unfortunately for now it is not possible, but may be possible in future.
Btw I have a list of other questions , possible bugs (still need to some testing outside of my main project to isolate things) , and (small) feature requests: is that too much at the current time or are you ok with that ?
Fill free to contact me in discord @jkbo#2629, or/and add issues. There are should be a lot of small bugs which is pretty easy to fix. Feature requests are welcome as well!
from belly.
closing in favor of #31
from belly.
Related Issues (20)
- Bevy 0.10 support? HOT 2
- DIV doesn't create a new line HOT 4
- can you pass Resources to run!()? HOT 2
- cargo check fails after "rustup update" HOT 5
- [core.relations] bypass requested resources to `run!` handler. HOT 1
- [Suggest] commit a GitHub project HOT 1
- [eml] Load `*.eml` from asset files
- Food for thought on tracking ECS values in UI
- Issue: Belly not compiling for opt-level = 3 HOT 5
- [eml] Scope-based styles HOT 1
- [eml] Entity-component association & bind expressions in `eml!` context. HOT 1
- [eml] Widget prop change handlers & expressions HOT 1
- [eml] Style props bindings HOT 1
- [eml] Widget![...] query param HOT 1
- s:position_type="absolute" doesn't work HOT 1
- Multi window error HOT 1
- How to use this with a Camera3D ? HOT 1
- Touch input does not work on android HOT 4
- What's wrong with `belly`?
- drain_filter not found error in connect.rs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from belly.