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

Helvetica Bold font substitution #424

Open
plutext opened this issue Dec 6, 2020 · 1 comment
Open

Helvetica Bold font substitution #424

plutext opened this issue Dec 6, 2020 · 1 comment

Comments

@plutext
Copy link
Owner

plutext commented Dec 6, 2020

Word substitutes Arial-BoldMT for Helvetica Bold. So we should do the same.

This is "normal" Office on Windows behaviour, coming from a Windows font substitution: see https://office-watch.com/2014/windows-s ... helvetica/ and in the registry Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes

See further https://www.docx4java.org/forums/docx-java-f6/embedded-bold-or-italic-font-problem-t2953.html

When embedded, by Word, Helvetica-bold.ttf (so-named according to the font table part) actually contains Arial-BoldMT.

@plutext
Copy link
Owner Author

plutext commented Dec 7, 2020

Should be able to address this at the FOP level with an entry in fop-substitutions.xml, something like:

      <substitution>
        <from font-family="Helvetica" font-weight="700..900"/>
        <to font-family="Arial-BoldMT"/>
      </substitution>

See https://github.com/plutext/docx4j/blob/master/docx4j-samples-resources/src/main/resources/fop-substitutions.xml

Remember to enable it in docx4j.properties; uncomment https://github.com/plutext/docx4j/blob/master/docx4j-samples-resources/src/main/resources/docx4j.properties#L136

or perhaps an entry in MicrosoftFonts.xml (not so convenient, since its embedded in docx4j-core.jar)

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

1 participant