Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set font per page #7

Closed
diatche opened this issue Dec 8, 2023 · 12 comments
Closed

Set font per page #7

diatche opened this issue Dec 8, 2023 · 12 comments
Labels
documentation Improvements or additions to documentation

Comments

@diatche
Copy link

diatche commented Dec 8, 2023

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.

@pourmand1376
Copy link
Owner

pourmand1376 commented Dec 8, 2023

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:

image

And this is the settings page:
image

@pourmand1376 pourmand1376 pinned this issue Dec 8, 2023
@pourmand1376 pourmand1376 added the documentation Improvements or additions to documentation label Dec 8, 2023
@winged-voices
Copy link

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?

@pourmand1376
Copy link
Owner

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.

@winged-voices
Copy link

winged-voices commented Jan 19, 2024 via email

@pourmand1376
Copy link
Owner

This is now added. You can easily do what you want by using custom css classes.

@winged-voices
Copy link

winged-voices commented Jan 21, 2024 via email

@diatche
Copy link
Author

diatche commented Feb 10, 2024

It works great! Thank you

@diatche diatche closed this as completed Feb 10, 2024
@Rick1029
Copy link

Rick1029 commented Apr 9, 2024

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.

image

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.

@Ske-Man1149
Copy link

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.

image

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.

@pourmand1376 we want an answer,

@pourmand1376
Copy link
Owner

Hey, Thanks for mentioning your issue.

I really can not replicate this issue (so I can't solve it). Could you please upload your files and configurations so that I can replicate this on my own device?

@majnooni
Copy link

Hi.

I would like to thank you for such a brilliant idea that led to the plugin. When I try to export an obsidian note to PDF, the custom font is not embedded. Is there a way to do that? I have attached a PDF file so you can clearly understand me.

Thanks
Meysam
کتابخوانی و توصیه هایی برای آن.pdf

@pourmand1376
Copy link
Owner

pourmand1376 commented Aug 25, 2024

Hi. Thanks you for mentioning it.

This is the problem I've been aware of. I don't know any solutions.

I'll create a new issue for it in case anyone knows how to fix this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

6 participants