Closed diatche closed 5 months ago
This is easy.
First, Use Custom CSS style and define it like this:
.custom-font * {
font-family: YourFontName !important;
}
Then, you can set this custom-font
CSS style in any file you want. For this, you need to set cssclasses
in the frontmatter to custom-font
. Something like this:
And this is the settings page:
Just to check (because I know CSS, but not WELL) -- is it possible to create several different defined classes here for each different font, on the off chance I end up wanting to use a couple different fonts but only for certain things? (I can think of some use cases since I do writing/roleplaying/mood boards etc and could use handwriting fonts for example.)
If in the Custom CSS style, I also defined .custom-font2 and .customfont3, etc etc (or .whatevername) with an additional font-family, and labeled them in the css-class front matter, would it let me use multiple fonts on a page by page basis?
Yes, This should be okay in theory. But, currently my plugin only loads one external font. For this to work, I should work on #2.
That would be awesome and much appreciated!
This is now added. You can easily do what you want by using custom css classes.
Thank you so much!!
On Sat, Jan 20, 2024 at 8:14 AM Amir Pourmand @.***> wrote:
This is now added. You can easily do what you want by using custom css classes.
— Reply to this email directly, view it on GitHub https://github.com/pourmand1376/obsidian-custom-font/issues/7#issuecomment-1902110988, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYILT6LSX75QJIF2QPA5JSDYPPGODAVCNFSM6AAAAABAL7CJLWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBSGEYTAOJYHA . You are receiving this because you commented.Message ID: @.***>
It works great! Thank you
Hi, using the multiple font options to try to set a bigger font size and different font for Arabic only notes, it all works an doesn't alter the font of my notes unless I have "custom-font" written.
However doing this makes Obsidian freak out as the plugin says it is "processing fonts" and it gets so slow you'd think it froze, but things just take 5-10 seconds to happen. It goes back to normal when you quit and restart and it works fine. It freezes again if you open the plugin settings menu and you have to slowly change fonts, quit, then restart. I notice in the background when you open the plugin settings your font scrolls through every single one you have installed (I have five for Arabic) then settles on the one you selected, and unfreezes, unless you try picking a new one where it freezes until you reopen Obsidian.
Thanks for writing this. This helps me to display Church Slavonic text correctly. The problem is that I only need the font loaded in those files which use Church Slavonic. So it would be great if there was a way to specify the font per file.
Using the
font
property seems like a great way to set the font per page, instead of setting the font globally.