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

Couple issues with embedded fonts #2521

Closed
mattidupre opened this issue Jan 5, 2024 · 6 comments · Fixed by #2800
Closed

Couple issues with embedded fonts #2521

mattidupre opened this issue Jan 5, 2024 · 6 comments · Fixed by #2800

Comments

@mattidupre
Copy link

mattidupre commented Jan 5, 2024

I might be jumping the gun but I wanted to play with embedded fonts. I've noticed two issues.

Using Word 365 / MacOS:

1: Font names with spaces corrupt the docx file.
2. Every font I tried aside from Pacifico (which I had already installed) is failing to render. The document loads fine but the font disappears from the Word UI selection once it gets changed. I do see those fonts showing up in fontTable.xml file. Confirmed the fonts have no embedding restrictions. Repo using demo 91 and swapping for Rubik or Salsa.

(I did notice that Word will retain a previously-installed font after it has been removed from the system.)

@jcyovera
Copy link

jcyovera commented Feb 15, 2024

I have the same trouble using "docx": "^8.5.0",
Scenario: I embed fonts on the code, fonts: [{ name: "Pacifico Bold" data: font, characterSet: CharacterSet.ANSI }], but when I try to open the Word file, the Word app shows an alert that the file is corrupted.

The workaround is to embed the fonts, for example, "Pacifico-Bold," and put a name without spaces; that works for me.

@mattidupre
Copy link
Author

Have you confirmed Word isn't just loading Pacifico locally on your system? That's what was happening to me after I thought I had it fixed.

@jcyovera
Copy link

jcyovera commented Feb 20, 2024

You are right. The fonts are not loading on the document. It is an issue with the docx library because I followed the example in the repository, but it doesn't work.

@ghost
Copy link

ghost commented Mar 15, 2024

i have same issue.... embedded fonts only works for Pacifico....

@vatsenko
Copy link

On my side - Corrupted file when space persist in font name (Microsoft Word error - Word found unreadable content ... )

@YousefED
Copy link
Contributor

YousefED commented Oct 21, 2024

I'm running into this as well. Could it be because there's no link from document.xml.rels to the fonttable? When I export a document with embedded font from Word, I see the following entry in document.xml.rels:

<Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable" Target="fontTable.xml"/>

However, when I export a document with an embedded font using docx.js, this seems to be missing

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

Successfully merging a pull request may close this issue.

4 participants