<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hello! One quick irrelevant thing before the real post…<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The mailing list bot sent out an email that contained a broken link:<o:p></o:p></p>
<p class="MsoPlainText" style="margin-left:1.0in"><span style="color:red">Please read<o:p></o:p></span></p>
<p class="MsoPlainText" style="margin-left:1.0in"><span style="color:red"><a href="http://wiki.documentfoundation.org/Development/Use_of_MailList"><span style="color:red">http://wiki.documentfoundation.org/Development/Use_of_MailList</span></a> before posting.<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="color:red"><o:p> </o:p></span></p>
<p class="MsoNormal">On to the real email:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hopefully I’m not bothering you too much! Sorry to intrude on your dev mailing list, this may seem a little off topic, but I have been banging my head on this forever, and I know you guys are the experts! We can also all get some help
out of this, perhaps!<br>
<br>
I have been running into an issue that I know the developers of libreOffice have likely faced before! I was wondering if the developers that have worked on this before would like to talk some about this, I'd really appreciate it!<br>
<br>
Basically, I have some questions on how to calculate the line spacing between lines, when parsing and rendering a docx file.<br>
<br>
My requirement is to exactly match <b>Word</b>, not necessarily the OOXML spec, in the spacing between lines in a simple paragraph.<br>
<br>
In order to try to do this, I have built a tool to analyze the differences between my layout and Word's layout. To do so it does the following:<br>
<br>
- First it generates a (or many) docx files.<br>
- Next it creates pdfs from the docx files. It uses Word to render the docx to PDF, and my program to render the docx to PDF. "word.pdf", and "me.pdf"<br>
- Then it analyzes the resulting PDFs for differences in layout.<br>
<br>
So, my tool would say:<br>
<br>
- Create a document "template.docx" with 1000 "a" characters in a single run of text with the same properties.<br>
- Make a "word.pdf" and "me.pdf" from this docx<br>
- Calculate info from the pdfs, in particular, calculating the line spacing in terms of the calculated leading between a lines ascent and the previous lines descent (our (Ascent + Descent) are identical-ish, so all that differs is the whitespace between lines).
I often think of it as the lines whitespace...<br>
<br>
This tool showed me that the leading varies greatly from font to font.<br>
<br>
To depict this, I used the tool to make thousands of these comparisons, in particular generating for:<br>
<br>
- For each font in system<br>
- For "a", "y", and a mix of letters and spaces.<br>
- For different font sizes.<br>
- For different line spacing types (Single, One and a half, and Double)<br>
<br>
I was hoping to find groupings, such as "this type of font has 1.3 times my calculation of leading". <br>
<br>
I was able to conclude far less than I had hoped, and was wondering if you could help me further with the issue of calculating line spacing. I'm providing you with a file that is best downloaded and opened using the filters in the header row. Note that its
not totally complete, there are missing entries, but I doubt they will be a problem for anyone, and I'm going to regenerate it soon but its pretty slow, so I'm finishing up some changes to it first.<br>
<br>
Here is a comparison of the layout of our software, vs the layout of Word's for every font installed on my system, etc. (attached and linked)<br>
<a href="https://drive.google.com/file/d/0BzQpUdPjnJUUclRXVXFkaEh3Mms/view?usp=sharing">https://drive.google.com/file/d/0BzQpUdPjnJUUclRXVXFkaEh3Mms/view?usp=sharing</a><br>
<br>
I'm not positive, but I believe the issue could be one of the following:<br>
<br>
- Word is using a different process than we are to calculate the "leading" of a font. We don't parse the font files ourselves, instead rely on libraries to get font sizing information, and perhaps in the "world of font files" I am missing something, and word
is parsing the fonts directly and differently.<br>
- Word has some sort of lookup table that handles groups of fonts, or an algorithm, that scales a fonts leadings up or down based on some criteria I am unaware of.<br>
- Word is using an additional criteria besides leading, ascent, and descent, to determine line spacing.<br>
<br>
Please feel free to email me at <b><a href="mailto:nathanb@windward.net">nathanb@windward.net</a></b><br>
<br>
Thank you so much for your time!!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I know you guys aren’t trying to emulate Word, (I very much enjoy Writer) but am sure you’ve had complaints of people opening documents made in Word that there friend sent them, and having major formatting differences, such as different
pagination. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Microsoft is famous for having been both open and closed about this spec, and thus allowing its wide-spread adoption without proper competition, and I think that openness between communities trying to work with that is very helpful. We’d
be happy to exchange information about quirks and things that differ from the spec that we find.<o:p></o:p></p>
</div>
</body>
</html>