-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Support for @font-face unicode-range #913
Comments
We have not coded in support for the @font-face {
font-family: 'Noto Sans';
font-style: normal;
font-weight: normal;
src: local('Noto Sans'), local('NotoSans'), url(http://full/path/to/fonts/NotoSans-Regular.ttf) format('truetype');
}
@font-face {
font-family: 'Noto Sans Arabic';
font-style: normal;
font-weight: normal;
src: local('Noto Sans Arabic'), local('NotoSansArabic'), url(http://full/path/to/fonts/NotoNaskhArabic-Regular.ttf) format('truetype');
} <span style="Noto Sans, sans-serif;">blah</span> <span style="Noto Sans Arabic, Noto Sans, sans-serif;" lang="ar" dir="rtl">بلاه</span> |
Thanks for the fast response @bsweeney. In my case, I won't know when a language is used to control the markup. But I appreciate that it's on your horizon. All the best. |
Hello @bsweeney, is there any progress with this? It would really come in handy in our project. |
@keksa not as of yet. It probably won't be something we can look at until the release after next. |
Good afternoon, Just a question: we are experiencing the same problem (at least that's what our developers report to me)
This mix up shows up correct readable Latin strings but unreadable (squares) instead of the corresponding non latin charset (eg: customer name, if from china...) Do you have any plan to fix this issue? |
We do intend to address the issue but do not have a time frame right now. Until a fix is produced the best you can do is work around the issue by styling the contact names with an appropriate font. |
Hi @bsweeney, Just wondered if there was any progress on this one, or anyway I can help? We're looking to get this working to provide more international support as per this original request. I've tried setting up a font-installer routine which successfully installs Could you paste a working example if this is still a way away from fixing, happy to load in fonts and use them specifically, but can't seem to get the usage right, (I am definitely including the font as inspecting the PDF states it). Appreciate any input you can give :) Edit: I realised that the example needed
|
We haven't begun discussing the process by which we could support this in the generated PDF. Off the top of my head, one way we can do this on the HTML parsing side would be to split text frames based on ranges and select the appropriate font when placing in the PDF. I haven't looked to see what, if anything, the PDF spec provides in support of this type of functionality. If you have thoughts please feel free to share. As for a working example, try this:
Note that you have to allow remote (isRemoteEnabled option = true) and dompdf needs read/write access to the path specified by the fontDir option. Also, use this with the caveat that Dompdf does not yet support complex text layout features such as bidirectionality or shaping (#2619). You'll have to pre-process your text to have it displayed correct in your PDF. |
Thanks @bsweeney, that's helpful. For now I'll stick with letting our users install fonts via our system (negates the isRemoteEnabled setting), and then they can hard set the font to use in their templating (via snippets). Look forward to a more globally usable option in the future 👍 .
|
With this change the text reflower scans the text of the frame to determine which font from the styled font families supports the characters contained within. Font preference is based on the order the fonts in the style declarations value. When characters in the text are supported by different fonts the frame is split at the character where the font changes. The used value of the current frame's font-family style is set to the supporting font. fixes dompdf#3142 should help enable full unicode-range support (dompdf#913)
With this change the text reflower scans the text of the frame to determine which font from the styled font families supports the characters contained within. Font preference is based on the order the fonts in the style declarations value. When characters in the text are supported by different fonts the frame is split at the character where the font changes. The used value of the current frame's font-family style is set to the supporting font. fixes dompdf#3142 should help enable full unicode-range support (dompdf#913)
With this change the text reflower scans the text of the frame to determine which font from the styled font families supports the characters contained within. Font preference is based on the order the fonts in the style declarations value. When characters in the text are supported by different fonts the frame is split at the character where the font changes. The used value of the current frame's font-family style is set to the supporting font. fixes dompdf#3142 should help enable full unicode-range support (dompdf#913)
With this change the text reflower scans the text of the frame to determine which font from the styled font families supports the characters contained within. Font preference is based on the order the fonts in the style declarations value. When characters in the text are supported by different fonts the frame is split at the character where the font changes. The used value of the current frame's font-family style is set to the supporting font. fixes dompdf#3142 should help enable full unicode-range support (dompdf#913)
With this change the text reflower scans the text of the frame to determine which font from the styled font families supports the characters contained within. Font preference is based on the order the fonts in the style declarations value. When characters in the text are supported by different fonts the frame is split at the character where the font changes. The used value of the current frame's font-family style is set to the supporting font. fixes dompdf#3142 should help enable full unicode-range support (dompdf#913)
With this change the text reflower scans the text of the frame to determine which font from the styled font families supports the characters contained within. Font preference is based on the order the fonts in the style declarations value. When characters in the text are supported by different fonts the frame is split at the character where the font changes. The used value of the current frame's font-family style is set to the supporting font. fixes dompdf#3142 should help enable full unicode-range support (dompdf#913)
With this change the text reflower scans the text of the frame to determine which font from the styled font families supports the characters contained within. Font preference is based on the order the fonts in the style declarations value. When characters in the text are supported by different fonts the frame is split at the character where the font changes. The used value of the current frame's font-family style is set to the supporting font. fixes dompdf#3142 should help enable full unicode-range support (dompdf#913)
With this change the text reflower scans the text of the frame to determine which font from the styled font families supports the characters contained within. Font preference is based on the order the fonts in the style declarations value. When characters in the text are supported by different fonts the frame is split at the character where the font changes. The used value of the current frame's font-family style is set to the supporting font. fixes dompdf#3142 should help enable full unicode-range support (dompdf#913)
With this change the text reflower scans the text of the frame to determine which font from the styled font families supports the characters contained within. Font preference is based on the order the fonts in the style declarations value. When characters in the text are supported by different fonts the frame is split at the character where the font changes. The used value of the current frame's font-family style is set to the supporting font. fixes dompdf#3142 should help enable full unicode-range support (dompdf#913)
With this change the text reflower scans the text of the frame to determine which font from the styled font families supports the characters contained within. Font preference is based on the order the fonts in the style declarations value. When characters in the text are supported by different fonts the frame is split at the character where the font changes. The used value of the current frame's font-family style is set to the supporting font. fixes dompdf#3142 should help enable full unicode-range support (dompdf#913)
With this change the text reflower scans the text of the frame to determine which font from the styled font families supports the characters contained within. Font preference is based on the order the fonts in the style declarations value. When characters in the text are supported by different fonts the frame is split at the character where the font changes. The used value of the current frame's font-family style is set to the supporting font. fixes dompdf#3142 should help enable full unicode-range support (dompdf#913)
With this change the text reflower scans the text of the frame to determine which font from the styled font families supports the characters contained within. Font preference is based on the order the fonts in the style declarations value. When characters in the text are supported by different fonts the frame is split at the character where the font changes. The used value of the current frame's font-family style is set to the supporting font. fixes dompdf#3142 should help enable full unicode-range support (dompdf#913)
With this change the text reflower scans the text of the frame to determine which font from the styled font families supports the characters contained within. Font preference is based on the order the fonts in the style declarations value. When characters in the text are supported by different fonts the frame is split at the character where the font changes. The used value of the current frame's font-family style is set to the supporting font. fixes dompdf#3142 should help enable full unicode-range support (dompdf#913)
With this change the text reflower scans the text of the frame to determine which font from the styled font families supports the characters contained within. Font preference is based on the order the fonts in the style declarations value. When characters in the text are supported by different fonts the frame is split at the character where the font changes. The used value of the current frame's font-family style is set to the supporting font. fixes #3142 should help enable full unicode-range support (#913)
I'd like to use Google's Noto fonts to improve language compatibility in my PDF exports. This would be part of software that would get run on lots of different servers over which I can't control what fonts are installed or not.
Here's how I've attempted to declare my fonts with
@font-face
, using theunicode-range
to subset the font:But this doesn't seem to be working. Arabic characters won't get displayed. And if I try to use a font stack to fall-back on a more workable font, it doesn't work:
<p style="font-family: 'Noto Sans', sans-serif;">من</p>
Is this a known issue? Or is there some way to get mixed-language documents that I'm missing? Thanks.
The text was updated successfully, but these errors were encountered: