none
请教word行间距具体算法 RRS feed

  • 问题

  • 我现在在编word转pdf的程序,但是对于word中的行间距有疑问。并查看了MS-DOC文档,里面有关于行间距的具体的算法。但是word里面检验这个算法觉得有问题。MS-DOC中关于行间距的算法描述如下:
    dyaLine (16 bits): An integer that specifies the spacing between lines, based on the following rules:
           dyaLine MUST either be between 0x0000 and 0x7BC0 or between 0x8440 and 0xFFFF.
           When dyaLine is between 0x8440 and 0xFFFF, the line spacing, in twips, is exactly 0x10000 minus dyaLine.
           When fMultLinespace is 0x0001 and dyaLine is between 0x0000 and 0x7BC0, a spacing multiplier is used to determine line spacing for this paragraph. The spacing multiplier is dyaLine/240. For example, a spacing multiplier value of 1 specifies single spacing; a spacing multiplier value of 2 specifies double spacing; and so on. The actual line spacing, in twips, is the spacing multiplier times the font size, in twips.When fMultLinespace is 0x0000 and dyaLine is between 0x0000 and 0x7BC0, the line spacing, in twips, is dyaLine or the number of twips necessary for single spacing, whichever value is greater.
    fMultLinespace (16 bits): An integer which MUST be either 0x0000 or 0x0001.
    当设单倍行距时,字体为五号(即10.5磅),即dyaLine=240,且fMultLinespace=1,根据上面的计算公式line spacing=(dyaline/240)*fontSize(单位为twip),那么   行间距=(240/240)*10.5*20 twips=210twips=0.370370370cm=3.70370370mm,  但是在word中设置成单倍行距,五号字体(并且取消对齐网格),放大到500%,观看旁边的标尺,很明显行间距不止3.70370370mm,目测行间距都快达到了5mm了。所以我想确认一下这个公式是不是准确?如果准确   dyaline,fontSize的单位的单位分别是什么?   希望相关人员能解答一下 谢谢了 Msn:   meetdoer@outlook.com 

    2013年4月3日 6:38

答案