Apache OpenOffice (AOO) Bugzilla – Issue 74609
PDF export problem with Times New Roman font - faulty character spacing - possible fixes
Last modified: 2013-08-07 14:42:39 UTC
The problem is that composing a document under OOo Writer 2.1 using Times New Roman font, Regular typeface, size 12 on a Linux system, followed by selecting File > Export as pdf > Export / Export gives a PDF file with some characters jammed together. In some cases, the whole space between characters is omitted (the space between words). The problem with the PDF file is observed using Adobe Reader 7.0 under the Linux operating system and also using Adobe reader 7.0 under Windows XP. The jamming together of some characters is obvious on the computer monitor screen and also on an Adobe printout. This issue might be considered as a reopening of issue 18559 and all the duplicates listed under that issue. The problem reported here differs from the previous issue reports in that a) OOo Writer 2.0 and 2.1 give the problem (previous issues were for version 1.x); b) no apostrophes in the text are involved; c) no font with a name ending in L is involved; and d) some workarounds that cure the problem are presented under "Diagnostic Tests". System Used for Tests a) OpenOffice.org Writer 2.1 downloaded directly from your web site on 2007 Feb 7 and operating under Linux distribution 2.6.19-1.2895.fc6 #1 on my office PC. b) The display is running on the same computer as OOo. c) There are no notable enhancements to the system regarding the display or desktop. d) Besides the fonts that came with the Linux distribution, MicroSoft True Type Corefonts (MSTT) were added to the operating system. e) For this report of a font related bug, I also include the requested output files from certain Linux commands: /usr/bin/chkfontpath > stuff.chkfontpath xset -q > stuff.xset xdpyinfo > stuff xdpyinfo - for display settings f) Other files also included as attachements are: test_OOo_file.odt - a file to be used to generate the faulty PDF output export_file1.pdf - output from diagnostic test b file_from_Adobe_Writer.pdf - output from diagnostic test c export_file2.pdf - output from diagnostic test e export_file3.pdf - output from diagnostic test f DIAGNOSTIC TESTS a) No problem occurs when using Courier fonts (fixed spacing fonts) or the Bitstream Character font (the only other proportional spacing font on my computer). When using Times New Roman, Regular typeface, size 12: b) The STANDARD TEST is to use OOo Writer 2.1 and select File > Open select test_OOo_file.odt / Open to display the standard test file. File > Print / OK gives a printed copy of the file which shows none of the character spacing problems found in the output PDFs. {In diagnostic tests e and f, an additional operation is inserted here.} File > Export as pdf In "Export" dialogue box, give the file name "export_file1" / Export / Export to obtain output file export_file1.pdf which is included as an attachment. Viewing the export file with Adobe Reader 7.0 shows that various successive characters are jammed together (faulty spacing) as shown on the terminal screen and in a printout from Adobe Reader; many of these errors are flagged in the file's text. I particularly note that the jamming together of a particular character pair does not occur in all cases. In line 2, the word "problem" has BL jammed together. In line 5, "problem" displays and prints normally. In line 7, the whole space after "problem" is omitted so that "problemin" displays and prints as one word. This jamming of characters does not depend on settings in the "Export as pdf" dialogue box. c) To demonstrate that Adobe Reader 7.0 was working properly, I ran the following test. File > Open select test_OOo_file.odt / Open to display the standard test file. File > SaveAs / For File type, select Micorsoft Word XP (.doc) / Save to get output file test_OOo_file.doc . I sent this to another computer with Adobe Writer (Adobe Acrobat 6.0 Professional) which produced the file 'file_from_Adobe_Writer.pdf' which is included as an attachment. Using this file in Adobe Reader 7.0 on the first computer (using Linux) and also on another computer (using Windows XP) gives a text display and printout with no problems (no character jamming) in the text. I note that many comments in the text are now superfluous and not appropriate; I left them in because I wanted to use the same input file in all diagnostic tests. [The equation at the bottom of the file does not display or print correctly (because of the conversion to Word .doc format), but that is a separate issue not dealth with here.] d) A workaround that gives a PDF without character jamming AND ALSO displays the equation correctly uses the following commands: File > Open select test_OOo_file.odt / Open to display the standard test file. File > Print check "Print to file" / OK outputs a PostScript file test_OOo_file.ps . File > Exit . On the Linux command line enter ps2pdf test_OOo_file.ps This command outputs the PDF test_OOo_file.pdf ; Adobe Reader 7.0 shows this file displays and prints the text without any character jamming, and also gives a correct equation. This workaround was suggested by my colleague Andrew Cenko. THIS TEST STRONGLY INDICATES THAT there is a bug in "Export to pdf" rather than in some other OOo function. e) The above tests were done with the "Character Spacing" values of: "Kern pairs" not checked; Spacing "Default" . We now experiment with these values. File > Open select test_OOo_file.odt / Open to display the standard test file. Use the cursor to highlight the whole document display. Format > Character / Position Under "Spacing", check "Kern pairs" / OK File > Export as pdf In "Export" dialogue box, give the file name "export_file2" / Export / Export to obtain output file export_file2.pdf which is included as an attachment. Adobe Reader 7.0 operating on this file shows that selecting the "Kern pairs" option removes some of the character jamming, leaves other character jamming unchanged, and introduces some new character jamming pairs. I note especially: In the text, in the "Example" line that starts "Daniel was pleasant ...", the FF in "office" now appears as a single character F, but the whole space now appears between "office" and "and". In the following line that starts "no particular difficulty ...", the characters UL in "difficulty" are no longer jammed together, but the characters FF are now jammed together. THIS TEST DEOMONSTRATES THAT THE CHARACTER SPACING SETTINGS somehow adversely affect the Times New Roman font but the problem only appears on "Export as pdf". f) This test demonstrates a "Character Spacing" setting that solves the "Export as pdf" problem. File > Open select test_OOo_file.odt / Open to display the standard test file. Use the cursor to highlight the whole document display. Format > Character / Position Under "Spacing", select "Expand [to] 0.1pt" ("Kern pairs" does not matter)/ OK File > Export as pdf In "Export" dialogue box, give the file name "export_file3" / Export / Export to obtain output file export_file3.pdf which is included as an attachment. Adobe Reader 7.0 operating on this file shows that there is now no jamming of adjacent characters. The text font is slightly spread out horizontally which changes the word rap at the end of lines, but that change occurs in the .odt document before we "Export as pdf". But "Export as pdf" works correctly here for the Times New Roman font; there is no character spacing fault and the equation displays correctly. * * * * * These diagnostic tests should provide plenty of clues as to the cause of the pdf faulty character spacing (jamming) problem. End of description. I may have to supply the attachements as "Additional Comments". - VJS
Created attachment 43088 [details] Standard OOo Writer test file to demonstrate the font problem
Created attachment 43089 [details] PDF from Diagnostic Test b which illustrates the character spacing fault from "Export to pdf"
Created attachment 43090 [details] PDF from Diagnostic Test e which shows change in character spacing fault when selecting "Kern pair"
Created attachment 43091 [details] PDF from Diagnostic Test f which shows how "Expand to 0.1pt" can correct the character spacing fault
Created attachment 43092 [details] Output of Linux command /usr/bin/chkfontpath
Created attachment 43093 [details] Output of Linux command xset -q
Created attachment 43094 [details] Output of Linux command xdpyinfo
Created attachment 43095 [details] Standard OOo input which produces the character spacing fault (character jamming) when using "Export as pdf"
In the first attachment, please change the Description to read "Standard OOo Writer test file to demonstrate the font problem (application/vnd.oasis.opendocument.text)" and delete the last attachment (duplicate of first attachment file). Victor J. Slabinski
Works for me with WinXP, I get no errors. If have got font file "times.ttf" with change day 18. Oct 2002, Times New Roman Version 3.00.
Created attachment 43116 [details] PDF from Diagnostic Test c which shows that Adobe Writer gives a PDF without faulty character spacing
Confirming with 2.1 on Suse10.2 (running in Virtual PC) - I get the same spacing problems as described in "export_file1.pdf". As always, virtual machine image can be uploaded for developers upon request.
Reassigned to HI.
Could not reproduce, please take a look.
Created attachment 43163 [details] Screenshot with size and date of .ttf files I used.
I can provide those .ttf files if necessary.
tentative target
*** Issue 74759 has been marked as a duplicate of this issue. ***
*** Issue 71161 has been marked as a duplicate of this issue. ***
*** Issue 70002 has been marked as a duplicate of this issue. ***
The root cause for this is freetype/WinGDI having different opinions about advance widths than our subsetter code. I'll need to have a method to bring them in sync.
fixed in CWS glyphadv
please verify in CWS glyphadv
Verified with cws glyphadv = ok
*** Issue 73695 has been marked as a duplicate of this issue. ***
Still ok in 680m209_9139
*** Issue 76489 has been marked as a duplicate of this issue. ***
*** Issue 78895 has been marked as a duplicate of this issue. ***
*** Issue 75937 has been marked as a duplicate of this issue. ***
*** Issue 78575 has been marked as a duplicate of this issue. ***