Closed dan-cooke closed 1 month ago
That's probably need to be reported to Microsoft, not here. To make license more flexible, you know. I would guess its about licensing of the Comic Sans MS and absence of it in Chrome. If you open it in IE or Edge it might work for you since Microsoft invented that font.
@anti-the-social I don't think thats quite right, correct me if I'm wrong - but if you have Comic Sans MS installed as a System Font on a Windows machine. You own a license to that font.
The browser should render that font.
If you open it in IE or Edge it might work for you since Microsoft invented that font.
That is not how fonts work on the web, browsers do not ship any fonts, they just use your system fonts. And websites can load additional fonts, the onus of licensing is on the website author. If every visitor to your site had to own a license to view your fonts that would be a pretty poor experience right?
The issue here is not to do with licensing its seemingly a bug in docx, the reason I am so sure about this?
The font property works when used in a Paragraph
on Word Online.
There is probably more to this issue however, as I have uncovered some cases where the font property does work on Word Online, I suspect it could be another styling property I am setting that is conflicting with it.
@dan-cooke I tend to disagree here :) Neither my mac nor windows are not having Comic Sans font available in Chrome as a font-family. But my windows machine has Comic Sans at C:/Windows/Fonts In other words, font is not attached to browser Chrome as you said.
And yes, Word document is zip file and it can include custom fonts in it. And probably Word in Web does that - attaches Comic Sans if you chose it for some Paragraph.
BTW, here is an example how to attach custom font to the document https://github.com/dolanmiu/docx/blob/962795743c4f21d84c52e47e4f82dcf4ca536dc3/demo/91-custom-fonts.ts
Highly advice you to read Comic Sans license before attaching and/or using in your commercial or not products.
@anti-the-social I think we are getting our wires crossed here.
I am not distributing the Comic Sans Font. I am simply setting a CSS variable font-family: 'Comic Sans'
But my windows machine has Comic Sans at C:/Windows/Fonts In other words, font is not attached to browser Chrome as you said.
That is not what I said :) ... I said Browsers do not package any fonts, however they are capable of reading your OS System fonts.
I highly advise for you to read up on how fonts work on the web, here is a quick primer on safe web fonts as you can see Comic Sans MS is listed here (because every windows and mac user in the world have this font in their system fonts)
Here is a simple example for you:
font-family: 'Comic Sans MS'
You see that right? Github did not "distribute" the Comic Sans MS font to you, the browser read it from your system fonts
Anyway. This issue is being derailed - this is not about licensing of Comic Sans. You are talking about a completely unrelated circumstance.
I am closing this as this now seems to be resolved - I actually now suspect this was an issue with Word browser client itself.
Description
When using the
TextRun
propertyfont
to set a font family. The docx just uses the defaultAptos
font.Reproduction code
apologies this is taken from a larger library that I am working on for prosemirror. I can supply a fully working example if required, but its a pretty simple bug to reproduce.
If I generate a docx using this font property.
Edit
Paragraph
node and th is works on Web - so this hints that its not an issue with MS Word itself, but seemingly something I am doing / docx is doing