Olá,
A medida da "linha horizontal" (verde) está correta (provavelmente você quer que ela seja cerca de 0). Infelizmente, a configuração 'Da parte inferior do cabeçalho ao topo do texto' é pouco confiável. O cálculo para determiná-la é complexo, depende da fonte e, atualmente, está incorreto.
Por algum motivo, não consigo colar uma imagem com sucesso, mas... para começar,
1. defina o valor da linha horizontal (verde) para 0pt
2. Defina o valor roxo 'da parte inferior do cabeçalho ao topo do texto' para, digamos, metade da altura da fonte.
3. Ajuste para que a linha horizontal fique posicionada corretamente sobre a régua. Metade é bom para Charis, 0,2 ou algo assim é melhor para Arial, se não me engano.
4. Lembre-se do deslocamento (offset).
5. Defina os valores como você realmente deseja que sejam, adicionando o deslocamento.
O que está dando errado?
O valor roxo é usado para calcular o valor azul ao lado dele, que, por razões históricas, é a distância do topo da página ao topo da caixa que contém o texto. Infelizmente, essa caixa inclui o espaço que os designers da fonte decidiram deixar para acentos. Para Charis, a 'ascensão' da fonte é cerca de 1,5 vezes a altura da fonte, mas para Arial é 1,2 vezes.
Para calcular o deslocamento correto, a interface do usuário em Python precisaria (a) determinar qual(is) fonte(s) está(ão) em uso no cabeçalho, (b) de alguma forma ler a(s) fonte(s) para determinar qual tem a maior ascensão.
Alternativamente, o cálculo no TeX poderia ser feito de uma maneira diferente, o que quebraria projetos existentes.
No momento, temos uma estimativa, que frequentemente está errada, mas não quebra nada de fato...
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...