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

Setting a default font not working. Example attached. #4403

Open
joe-azps opened this issue Sep 3, 2024 · 3 comments
Open

Setting a default font not working. Example attached. #4403

joe-azps opened this issue Sep 3, 2024 · 3 comments

Comments

@joe-azps
Copy link

joe-azps commented Sep 3, 2024

In using custom fonts I cannot get the editor to set it as a default. After initializing Quill I am using quill.format but the quill.format('font', fontname) will not work but quill.format('size', '24pt') does works.

Would anyone have some insight on how to get this to work.

A work around would be to set the css font on the .ql-editor as the css shows. I have this commented out for now because while that does work I need it to be in my quill.getContents(). For export reasons I need each Op specify the font to use.

Steps for Reproduction
You can see a reproduction of this here:
https://jsfiddle.net/hk9e60zg/6/

Expected behavior:
As soon as I start typing the font should be applied.

Actual behavior:
The font isn't applied but the size is.

Platforms:
macOS
Safari 17.5 and Chrome 128

Version:
2.0.2

@joe-azps
Copy link
Author

joe-azps commented Sep 4, 2024

Figured out my issue, not a bug.

@LaughingJohn
Copy link

Hi @joe-azps, any chance you can share what you did to fix it, as I'm about to do the same thing and could do with a working example! Thanks.

@joe-azps
Copy link
Author

joe-azps commented Sep 4, 2024

Hi @joe-azps, any chance you can share what you did to fix it, as I'm about to do the same thing and could do with a working example! Thanks.

Here is the working one. I was missing the style for the font.

https://jsfiddle.net/nrz5y149/

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

No branches or pull requests

2 participants