Hola,
La medida de la "línea horizontal" en verde es precisa (probablemente quieras que sea aproximadamente 0). Lamentablemente, la configuración de 'Desde la parte inferior del encabezado hasta la parte superior del texto' no es fiable. El cálculo para determinarla es complejo, depende de la fuente y, actualmente, es incorrecto.
Por alguna razón, no puedo pegar una imagen con éxito, pero... para empezar,
1. Establece la cifra de la línea horizontal (verde) en 0pt
2. Establece la cifra morada de 'desde la parte inferior del encabezado hasta la parte superior del texto' en, digamos, la mitad de la altura de la fuente.
3. Ajusta para que la línea horizontal se sitúe correctamente sobre la regla. La mitad es bueno para Charis, 0.2 o algo así es mejor para Arial, si mal no recuerdo.
4. Recuerda la compensación (offset).
5. Establece los valores como realmente quieres que sean, añadiendo la compensación.
¿Qué está fallando?
La cifra morada se utiliza para calcular la cifra azul junto a ella, que, por razones históricas, es la distancia desde la parte superior de la página hasta la parte superior de la caja que contiene el texto. Lamentablemente, esa caja incluye el espacio que los diseñadores de la fuente decidieron dejar para las acentuaciones. Para Charis, el 'ascenso' de la fuente es aproximadamente 1,5 veces la altura de la fuente, pero para Arial es 1,2 veces.
Para calcular la compensación correcta, la interfaz de usuario de Python necesitaría (a) determinar qué fuente(s) se están utilizando en el encabezado, (b) leer de alguna manera la(s) fuente(s) para determinar cuál tiene el ascenso más alto.
Alternativamente, el cálculo en TeX podría realizarse de una manera diferente, lo que rompería los proyectos existentes.
Por el momento, tenemos una estimación, que a menudo es incorrecta, pero en realidad no rompe nada...
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...