none
Placement of the first line on a page in DOCX (in relation to paragraph line spacing) RRS feed

  • Question

  • Hi folks,

    I have a docx file that I have created using Word 2007. The document has the top margin for the page set to 1 inch and it also has a paragraph which has its line spacing set to a fixed value of 2 inches. The spacing above & below the paragraph is set to 0. The font is Calibri and of size 11pt.

    I was expecting Word 2007 to place the first line of the paragraph at a distance of approximately 3 inches (top margin + line spacing - font descender) from the top edge of the page. However, it is placed at approximately 2.5 inches.

    Why is the line shifted up by this small margin? And how is this margin calculated? Changing the font size does not seem to affect this margin.

    Any help on this would be greatly appreciated.

    Friday, May 20, 2011 6:17 AM

Answers

  • Hi asampat,

    As I had alluded to in my last post, there are considerations that are part of Word's algorithm which are not part of the scope of the standard or implementer's notes.  Word does not place the text precisely on the bottom or center of the line but the determination of where to place it is not covered by the standard and is left as an implementation detail for the implementer.

    Thanks,

    Tom Jebo

    Microsoft Open Specifications

    Tuesday, June 28, 2011 4:45 PM

All replies

  • I don't know exactly how it's calculated (it may be built into the font and depend on the font, I don't know) but Word allows approximately one quarter of the line spacing for the font descenders - in the case of 2" line spacing, that's half an inch.
     

    Enjoy,
    Tony
    www.WordArticles.com
    Friday, May 20, 2011 9:35 AM
  • Hi Asampat:

    This forum is for software developers who are using the Open Specifications documentation to assist them in developing systems, services, and applications that are interoperable with certain Microsoft products. The Open Specifications can be found at:http://msdn.microsoft.com/en-us/library/cc203350(PROT.10).aspx. Your post does not appear to be related to the Open Specifications documentation.

    a more appropriate forum for this type questions is office forum at the folowing link:

    http://social.technet.microsoft.com/Forums/en-US/office2007deploymentcompatibility/thread/09b2b9e7-92a5-449c-a7d4-0fc26a6bb751


    Regards, Obaid Farooqi
    Friday, May 20, 2011 6:48 PM
    Owner
  • Hi Obaid,

    Yes, I am a developer and I am trying to figure out how to place the first line of the very first paragraph on a page when the paragraph uses exact line spacing. I would like to know what determines the placement of this line? I could not find this in the documentation. Maybe I missed something? What I described in my previous post was an example to help explain my question.

    Thanks.

     

     

    Sunday, May 22, 2011 6:27 PM
  • Hi asampat,

    I've been assigned to investigate your question.  I will get back to you shortly with a response.

    Best regards,
    Tom Jebo
    Escalation Engineer
    Microsoft Open Specifications

    Wednesday, May 25, 2011 3:36 PM
  • Hi asampat,

     

    Word deviates from ISO 29500 17.3.1.33 in the placement of the line based on the spacing settings.  The following will be added to MS-OI29500 as an implementer’s note for this section:

     

    The standard states that when the line height is “exactly” and is larger than required, the text is centered in the available space. When line height is “exactly” or “at-least” and is larger than required, Word positions the text at the bottom of the line.

     

    This will partly explain the placement that you notice in your example.   As Tony observed, there are other considerations that are implementation details for Word and which are out of scope for the standard as well as the implementer notes.

     

    Best regards,

    Tom Jebo

    Escalation Engineer

    Microsoft Open Specifications

    • Marked as answer by Tom Jebo MSFT Tuesday, June 7, 2011 12:50 PM
    • Unmarked as answer by asampat Thursday, June 23, 2011 5:07 PM
    Tuesday, May 31, 2011 9:11 PM
  • Hi Tom,

    Thanks for the response. My problem is still not solved though. I'm still not sure what to do when the line spacing is set to exact. Should I position the text in the center or at the bottom of the line?

    Based on my experiments, I have found that MS Office reserves about 1/5th of the line height for the descender. This is close to what Tony Jollans stated in his response. If I use that calculation (reserving 1/5th of the line height for the descender) to determine the placement of the text,  it seems to only roughly match MS Office.

    I would like to know if there are other factors influencing the placement of the text when the line height is set to exact. I have e-mailed you a test file at dochelp@winse.microsoft.com. Can you please take a look? The test file has two paragraphs (the first one with line spacing set to exact and the second one with line spacing set to single). Since the text of the first paragraph is shifted up by an unknown amount, the spacing between the two paragraphs is not determinable.

    Any help in solving this would be greatly appreciated. Thanks in advance.


    Thursday, June 23, 2011 5:07 PM
  • Hi asampat,

    As I had alluded to in my last post, there are considerations that are part of Word's algorithm which are not part of the scope of the standard or implementer's notes.  Word does not place the text precisely on the bottom or center of the line but the determination of where to place it is not covered by the standard and is left as an implementation detail for the implementer.

    Thanks,

    Tom Jebo

    Microsoft Open Specifications

    Tuesday, June 28, 2011 4:45 PM