Skip to content

Conversation

@jakejackson1
Copy link
Contributor

@jakejackson1 jakejackson1 commented Sep 3, 2025

The syntax en_GB is invalid for the $mode. Based on the PDF 1.6 specification, the format should follow RFC 3066 en-GB (the code is used in the /Lang entry).

RFC 3066 has been revised multiple times, and looks to fall under the BCP 47 language tag standard now. The PR also adds a link to documentation on the BCP 47 language tag format.

References

This PR also adds a link to documentation on the BCP 47 language tag format, which is the revised version of RFC 3066 referenced in the PDF 1.6 specification for the `/Lang` entry.
@finwe
Copy link
Member

finwe commented Sep 3, 2025

The question is, couldn't mPDF just process en_GB to en-GB internally?

@jakejackson1
Copy link
Contributor Author

The question is, couldn't mPDF just process en_GB to en-GB internally?

That was my first thought: just do a quick str_replace from underscore to hyphens. But after considering the complexity of language and font processing in mPDF, I didn't want to risk altering functionality in the library without 100% understanding the potential side effects. It was much easier doing a preliminary investigation and updating the docs to better reflect the intended input.

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 this pull request may close these issues.

2 participants