Open fritzrehde opened 1 year ago
As far as I know, the only way to set a separate font rule is to use Pango Markup in your config file.
If you resize icons this way, you may also find yourself unhappy with their vertical alignment, as it tends to drift out of sync with the rest of the text. In this case you can also set a rise
value to adjust the vertical alignment of the resized icons. Note that too large a rise
value will begin to push the rest of the text in the opposite direction, so you'll have to test and find what works.
"format": "<span size='x-large' rise='-1500' color='#fff'>墳</span> {volume}%",
@fritzrehde how did you use a separate font for icons?
@ArtemSmaznov, you should use span
where you want to separate font for icons
See format
section in config
"battery": {
"bat": "BAT0",
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "<span font-family=\"Font Awesome 6 Pro Regular\">{icon}</span> {capacity}%",
"format-full": "{icon}",
"format-alt": "{icon} {time}",
// "format-good": "", // An empty format will hide the module
"format-icons": {
"plugged": "",
"full": "",
"charging": ["","","","","","",""],
"default": ["","","","",""]
},
"tooltip": true
},
That's what I wanted to avoid. Hoped there was a way to reference icons in css. but guess I just need to add custom classes in the config with span like I was doing in EWW
@ArtemSmaznov I never did get around to fixing this for me, I wasn't happy with any of the solutions. I just accepted that the icons are smaller and use the same font for everything for now.
I used the following, but won't necessarily work depending on scaling.
<span size='large'>{icon}</span>
Use the nerdfont variant Propo, i.e.: "JetBrainsMono Nerd Font Propo", which isn't strictly monospaced, and works well in this scenario
Wait, shouldn't this be valid?
"format": "<span class='icon'>{icon}</span> {temperatureC}°C",
doesn't seem to work for with widget just not displaying anything. Is class
specifically that isn't supported?
Wait, shouldn't this be valid?
"format": "<span class='icon'>{icon}</span> {temperatureC}°C",
doesn't seem to work for with widget just not displaying anything. Isclass
specifically that isn't supported?
it's not supported, I want to find a way to reference a span inside, but without luck yet
<markup><span> </span> <span class="value">333</span> </markup>'
from markup due to error parsing markup: Attribute 'class' is not allowed on the <span> tag on line 1 char 55
I have already added a seperate font used for icons, but now the icons are too small compared to the text. Is it possible to specify a seperate font size for another font (in my case the icon font)?