Report contains Traditional Chinese in 'SimHei' font face with a combination of normal and bold styles. The report looks fine in preview mode but not in the PDF outputted, either the bold style is lost or the Chinese characters cannot be displayed correctly:
- When 'SimHei' is included in embedded font, the bold style is lost, all Chinese characters are displayed in same style
- When 'SimHei' is excluded from the embedded font, all Chinese characters displayed as '?' (screen attached)
I've checked other issues that excluding font from embedded font list should work, but it does not work in my case. 'SimHei' is a standard font for our customer and we must stick to this font.
Please advise whether DevExpress would fix the 'SimHei' bold style export issue in PDF output; or is there any alternative solutions.
Steps to Reproduce:
Report with Chinese characters in 'SimHei' normal & bold style.
Export to PDF with/without "Never Embedded Fonts" set.
Actual Results:
Bold style lost or Chinese characters become '?'
Expected Results:
'SimHei' font face with appropriate style (normal/bold) can be exported to PDF just like the preview mode.
Hi Anny,
If you set the XtraReport.ExportOptions.PdfExportOptions.NeverEmbeddedFonts property to the name of your font, the 1-byte based encoding will be used and you'll be unable to represent the entire set of Unicode characters in the PDF output. This behavior is by design. We've discussed this issue in this thread: Problems with Italic and Bold by different TT Fonts.
To avoid this problem, I suggest that you clear the NeverEmbeddedFonts property and then ensure whether the font files with required styles (i.e. Bold) are installed on the client's machine. Attached is a sample project, created by following the instructions you provided. Please test it on your side, and let me know how it goes.
Thanks,
Alex
In window\fonts folder, there's only one SimHei font file, this font has no bold/italic font file.
When clear the NeverEmbeddedFonts property, all Chinese characters are displayed in normal 'SimHei', no bold. As we must use 'SimHei', is that means we need to find the bold style font file and install to the client's window\fonts folder?
I still have a question, if the preview mode can display the SimHei bold style when no such style file in \window\fonts folder, would you briefly explain why this style cannot be displayed in the pdf ouput?
Anny,
Due to the MS Windows Typography specifics, Unicode characters will be displayed properly only when the font contains appropriate glyphs to display them. When a report is displayed in Preview mode, this situation is handled at OS level. However, when the font is embedded into a PDF document (the default behavior), you should ensure that all font styles (i.e. Bold, Italic - one file per style) are contained in the C:\WINDOWS\Fonts folder. Let me know whether this makes sense.
Thanks,
Alex
Checked your sample project that you've used label to display SimHei.
But in our reports, we must use RichText and we found that RichText cannot display SimHei in both normal & bold style. Please advise.
Since SimHei has no bold font file in c:\windows\fonts, we've also tried another font 'Microsoft JhengHei' which contain both normal & bold font file in this folder.
However, the testing result is still the same, i.e. bold style cannot be displayed.
Hi Anny,
Thanks for the clarification. Could you please post any report layout files or a complete sample project to illustrate the issue? I'll examine it, and then check for a solution.
Thanks,
Alex
Richtext report and screen dump of different views/pdf output.
Anny,
Thanks for posting your files. That's right, you need to double click the XRRichText and then ensure that the appropriate Font is used for both text lines. I've updated your report layout accordingly. Please refer to the attachment, and let me know whether this makes sense.
Thanks,
Alex
I've double check my report and cannot see the output PDF display the richtext in style set.
I cannot find your attachement.
Would you export a PDF and confirm the Bold/Normal Charaters with Font 'Microsoft JhengHei' can be displayed in a RichText, and attached for me to check?
Anny,
My apologies, I forgot to attach the updated report layout. Here it is.
Thanks,
Alex
Thanks for your sample report. Your report works fine when using font 'Microsoft YaHei'. But it does not work with 'Microsoft JhengHei', the bold style will be lost in PDF.
Please refer to attached report using 'Microsoft JhengHie' and advise whether we have set anything wrong.
Hi Anny,
Thanks for the update. I see the problem. It appears that this problem is related to the fact that a common Microsoft Rich Edit is used when you edit the XRRichText content. As it stands, the Microsoft JhengHei font is substituted with a different one (e.g. SimSun), when you modify the RTF content in Design mode. As an immediate solution, I can only suggest that you edit the RTF content separately (for instance, using our RichEditControl), and then load it into the XRRichText control using the corresponding smart tag option. You can also track the following suggestion: XRRichText - Use the Developer Express XtraRichEdit control as an in-place editor for the XRRichText control at design time.
Attached is an updated report layout. Please examine it, and let me know whether this helps.
Thanks,
Alex
Your suggestion immediate solution does not work because the report content contain binded information retrieved from DB.
Please adivse whether DevExpress would fix this problem.
Anny,
Assuming that you're displaying an RTF text from a database, everything should be in a similar manner as when you load the RTF text from a file.
If possible, post your example here, along with a database backup. We'll examine it locally, and then check for a solution.
Thanks,
Alex
A sample project is attached.
Steps:
Font & Style of Richtext with 'Microsoft JhengHei' Bold cannot be exported correctly to the PDF.
Hi Anny,
Thanks for posting your example. However, this situation is similar to the one described above: you have embedded the RTF text (along with Mail Merge fields) into the xrRichText2 in Report Designer. In this situation, the Microsoft JhengHei font is substituted with a different one. Unfortunately, at present there's no capability to avoid this problem. As an immediate solution, I suggest that you load the RTF content manually, or save it to the database and bind the XRRichText.Rtf property afterwards. Sorry for a possible inconvenience.
Thanks,
Alex
Alex,
You've mentioned there's no capability to avoid this problem now.
The immediate solution does not work for our client. Would you consider fixing this problem in coming version? Our client has bought DXperience-9.3.4.100 and would like to have your support to solve this problem.
Hi Anny,
The approach of loading the entire RTF content into the XRRichText should work fine. If this doesn't work for you, please explain the situation in greater detail, so that we can check whether you are referring to an actual issue we are currently unaware of.
Unfortunately, I cannot give you an exact estimate regarding the target release date of the feature suggested in the XRRichText - Use the Developer Express XtraRichEdit control as an in-place editor for the XRRichText control at design time ticket. If everything will go according to plan, we'll introduce this feature in the next major update (v2010 vol 2) this year. Please track the suggestion, so that we can keep you informed on our progress.
Thanks,
Alex