Matchstic / Xen-HTML

Unified and simplified HTML rendering
GNU General Public License v2.0
109 stars 16 forks source link

Is it possible to use the current system font in a widget? #257

Closed strafe closed 4 years ago

strafe commented 4 years ago

Currently I'm bundling my own fonts with the widget. Is it possible to use whichever font has been chosen with A-Font, Snowboard, etc. for text in the widget?

Matchstic commented 4 years ago

That’ll be something to implement yourself. You’d have to ensure the font-family CSS property is set as

font-family: -apple-system;

For custom user fonts to apply. If you want to also have the option for using your bundled fonts, then you’d need to set this at runtime via JavaScript.

strafe commented 4 years ago

@Matchstic thanks for the heads up. I gave this a go with -apple-system as the font family, but it always uses the system's stock font regardless of whether it's been changed using A-Font or Snowboard.

Something interesting was that if I enabled A-Font's WebKit injection, the font did apply. I'm assuming there's nothing I can really do to improve that functionality but thought I'd ask regardless.

Matchstic commented 4 years ago

Ah, thanks for posting your findings.

That does sound about right, the WebKit injection from A-Font would be needed to change the system default font in a widget.

On 28 May 2020, at 23:29, strafe notifications@github.com wrote:

 @Matchstic thanks for the heads up. I gave this a go with -apple-system as the font family, but it always uses the system's stock font regardless of whether it's been changed using A-Font or Snowboard.

Something interesting was that if I enabled A-Font's WebKit injection, the font did apply. I'm assuming there's nothing I can really do to improve that functionality but thought I'd ask regardless.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.