你好,
绿色的“水平线”测量值是准确的(你可能希望它约为 0)。不幸的是,“页眉底部到正文顶部”的设置不可靠。计算它的数学方法很复杂,取决于字体, 而且目前是错误的。
由于某种原因,我无法成功粘贴图片,但是……首先,
1. 将(绿色的)水平线数值设置为 0pt
2. 将紫色的“页眉底部到正文顶部”设置为,比如说,字体高度的一半。
3. 调整位置,使水平线正确地位于规则线上。对于 Charis 字体,一半是合适的;如果我没记错的话,对于 Arial 字体,0.2 左右更好。
4. 记住这个偏移量。
5. 设置你实际想要的值,并加上偏移量。
出了什么问题?
紫色数值用于计算旁边的蓝色数值,由于历史原因,该数值是从页面顶部到包含文本的框顶部的距离。不幸的是,该框包括字体设计师决定为重音符号留出的空间。对于 Charis 字体,字体的“上升高度”(ascent)大约是字体高度的 1.5 倍,但对于 Arial 字体则是 1.2 倍。
要计算 正确的偏移量,Python 用户界面需要 (a) 确定页眉中使用的字体,(b) 以某种方式读取字体以确定哪个具有最高的上升高度。
或者,TeX 中的计算可以用不同的方式进行,但这会破坏现有项目。
目前,我们有一个猜测,这经常是错误的,但实际上并没有破坏任何东西……
Hi,
The green "horizontal rule" measure is accurate (you probably want it to be about 0). Unfortunately the 'Bottom of header to top of text' setting is unreliable. The maths to work it out is complex, depends on the font, and currently wrong.
I can't successfully past an image, for some reason, but... to start with,
1. set the (green) horizontal rule figure to 0pt
2. Set the purple 'bottom of header to top of text' to, say half the font height.
3. Adjust so the horizontal line is sitting on the rule properly. Half is good for charis, 0.2 or so is better for Arial, if I remember correctly.
4. Remember the offset.
5. Set values how you actually want them to be, adding in the offset.
What's going wrong?
The purple figure is used to calculate the blue figure beside it, which for historical reasons is the distance from the top of the page to the top of the box containing the text. Unfortunately, that box includes the space the font designers decided to leave for accents. For Charis, the 'ascent' of the font is about 1.5 times the font height, but for Ariel it is 1.2 times.
To calculate the correct offset, The Python user interface would need to (a) work out which font(s) are in use in the header, (b) somehow read the font(s) to determine which one has the highest ascent.
Alternatively, the calculation in TeX could be done in a different way, which would break existing projects.
At the moment, we have a guess, which is frequently wrong, but doesn't actually break anything...
机器翻译自 English