linux uses fastreport to export Chinese PDF reports lazarus / 32-Linux ---------------------------------------------------------------------- jianwt · 2024-05-11 04:40 在lazarus3.2(linux  deepin64)GTK2程序时,使用fastreport导出中文PDF报表时,报错提示为“Cant swap font"。 我已经将所用到的字体手动放在系统目录下了,但还是报错,有在linux系统导出中文PDF报表成功的群友,帮忙看看是什么问题导出报错?? 英文不好,在线翻译的。 最后谢谢你们的帮助! Symptom When I use fastreport to export Chinese PDF reports in lazarus3.2 (linux deepin64) GTK2 program, an error message "Cant swap font" is displayed. I have manually placed the fonts used in the system directory , but there are still errors. Some friends have successfully exported Chinese PDF reports in linux system, help to see what is the problem? English is not good, online translation. Thank you for your help! ---------------------------------------------------------------------- Handoko · 2024-05-11 04:48 Have you tried to install Chinese fonts provided by your Linux distributions? For example below is the screenshot running Synaptic Package Manager on my Ubuntu Mate. Simply copy/pasting the fonts may not work correctly. You may need to run: sudo fc-cache -fv ---------------------------------------------------------------------- Thaddy · 2024-05-11 05:16 @Handoko Selamat pagi, (UTF+1), I wonder if FastReport can use x-fonts but it can handle open type font and ttf fonts. if you have windows simply copy over the chinese ttf fonts from the \windows\fonts directory. Example are Microsoft JhengHei or the open source SimSun and family, These fonts are known by me to work well in report engines. Linux can handle Opentype and TrueType fonts. - X-fonts are - legacy - bitmap fonts. - OTF and TTF are usually vector fonts, although they can also handle bitmap fonts, but in the correct format. Most modern TTF fonts have internal OTF line out. An example of this is JhengHei and FastReport supports it. There are literally 1000ths of fonts which come with permissive licensing, like Creative Commons or M.I.T. FastReport does not support X-fonts is my guess. ---------------------------------------------------------------------- jianwt · 2024-05-11 06:24 @Handoko I really copy and paste the Chinese font, I will use the computer to test the method you said tonight, thank you for your help! Have you ever successfully exported Chinese PDF documents with FR in linux? ---------------------------------------------------------------------- Handoko · 2024-05-11 11:58 Quote from: Thaddy on May 11, 2024, 07:16:20 am@Handoko Selamat pagi, (UTF+1),   Selamat pagi juga! Good morning too. Quote from: jianwt on May 11, 2024, 08:24:37 amHave you ever successfully exported Chinese PDF documents with FR in linux? I can speak Chinese but I can't read nor write Chinese text. So I have no Chinese fonts in my computer. You may also try Noto fonts. As far as I know most Ubuntu and its variants have Noto (no tofu) fonts installed by default. Perhaps your Linux has Noto fonts too. ---------------------------------------------------------------------- Thaddy · 2024-05-11 13:58 I have Notomono-regular.ttf on my Debian boxes, indeed. Note Linux also has two other font types that you can likely not use with FastReport, T1 fonts and ps fonts (postscript). Comes from FastReport's Windows heritage. ---------------------------------------------------------------------- jianwt · 2024-05-13 01:16 After several tests, the export PDF error or because it is the Chinese font, the English font export will not report the error, which master can point to how to solve this problem. thank you ---------------------------------------------------------------------- Handoko · 2024-05-13 04:32 Please provide a simplified demo code that can show the issue, so we can download, run and inspect the problem. ---------------------------------------------------------------------- jianwt · 2024-05-13 05:23 @Handoko In the window system, you can export PDF in both Chinese and English. In the linux system can export English, export Chinese will report an error! ttf folder is Chinese font。 The Chinese font used cannot be uploaded due to the size limitation of the forum attachment 宋体  You can download the Chinese font file here   http://www.downcc.com/font/353318.html ---------------------------------------------------------------------- PierceNg · 2024-05-13 06:05 Which version of Fast Report and where to download the source? ---------------------------------------------------------------------- jianwt · 2024-05-13 06:23 @PierceNg https://www.fast-report.com/en/download/fast-report-vcl/ ---------------------------------------------------------------------- paweld · 2024-05-13 08:55 actually under linux there is a problem with Chinese font. In my case, although it does not report errors but after export in a pdf file instead of Chinese characters there are rectangles. Have you tried contacting FastReport support? They usually solve problems in a fairly short time.