Closed jt196 closed 2 years ago
It is not yet known how to obtain a suitable default font. The var(--joplin-font-family) variable works well most of the time. If you find a better variable or css value, please provide it to me. thank you for your suggestion.
Sorry dude my CSS is a bit lacking! I'm guessing the 'Roboto' theme font (Dracula theme) I currently have is a Google web font. Helvetica works I'd assume as it's one of the html web safe fonts.
I think I've addressed this in https://github.com/cqroot/joplin-outline/pull/28
I have the Dracula theme set and noticed Roboto wasn't picked up in the outline via the var but if I put literally "Roboto" in the preferences it worked. Experimenting w/live editing in the dev tools I determined that the double-quotes around the var(...)
prevented it from being interpolated to its value (i.e. Roboto).
OK - just checked this, possibly hasn't been pushed to the the Joplin repo yet, but this is still not working in my version. Joplin 1.7.11, Outline v1.1.6. All without quotes:
The latest version is 1.1.7. It seems that the official repo did not get this update.
OK no probs, when it updates, I'll report back and confirm it's working or not and close if the former. Cheers!
@cqroot as per the comment above still in v 1.1.7. Only 'Avenir' is changing the font to a sans serif.
@jt196 Do you have the Roboto font installed / available? If it doesn't work when you explicitly specify it (i.e. in the same way as 'Avenir') then it won't work when inherited, either.
Here is the presentation I get with "SomeOtherFont" (that is, any value that I don't have installed). It's a default serif font.
Here it is with "Roboto" specified in settings. I have this font installed.
And here it is with the default "var(--joplin-font-family)" setting. In order to get this appearance, I had to both install the Roboto font AND change the plugin to remove the quotes.
Aaaah, missing the font installation. It's working now.
I'm guessing plugins don't have access to the Joplin fonts then? Kind of a weird set up!
Yeah, it's weird, but there's a reason.
Plugins are deliberately restricted to their own sandbox (directory).
The Roboto font is packaged as a CSS file into the Electron app. Since we're prevented by the code above from making a relative reference like this:
<link rel="stylesheet" href="../../node_modules/roboto-fontface/css/roboto/roboto-fontface.css">
It's right there ... but we can't use it. 🤷🏽♂️
Perhaps there's a feature request there, for Joplin to expose bundled resources into the plugin sandbox. It doesn't make sense to me for each plugin to ship w/redundant fonts, etc.
It doesn't make sense to me for each plugin to ship w/redundant fonts, etc.
Or have the users install fonts on their system to match the packaged Joplin fonts...
Thanks for the explanation though. Makes sense to expose a small amount of the Joplin visual styling to the plugins for design consistency's sake. No idea how hard it would be to implement though!
App version: 1.7.3 Plugin version: 1.0.10
If I set the font family to
default
or leave it asvar(--joplin-font-family)
, the Outline text displays as a serif font. If I change it tohelvetica
, the font will change correctly.It'd be great to have this working as per the default font for the theme.