On Fri, 10 Sept 2021 at 17:12, 'Neil Hodgson' via scintilla-interest
<
scintilla...@googlegroups.com> wrote:
>
> I’m not seeing any difference between ascent+descent and height on Fedora 34 with Pango 1.48.4 or Fedora 32 with Pango 1.44.7.
>
> Excerpts from tracing:
> DejaVu Sans Mono, 9 Ascent: 11.1387 Descent 2.83008 Height 13.9688 13.9688
> DejaVu Sans, 9 Ascent: 11.1387 Descent 2.83008 Height 13.9688 13.9688
> DejaVu Serif, 10 Ascent: 12.376 Descent 3.14453 Height 15.5205 15.5205
> DejaVu Sans Mono, 10 Ascent: 12.376 Descent 3.14453 Height 15.5205 15.5205
> DejaVu Sans, 10 Ascent: 12.376 Descent 3.14453 Height 15.5205 15.5205
The problem is these figures are all pre-rounding, I have added the
rounded versions to get:
DejaVu Sans Mono, 10 Ascent: 12.376 12 Descent 3.14453 3 Height
15.5205 15.5205 16 15
In particular the last two which are std::round(height) which is what
my patch was using to get the same height as Gedit and Eclipse and
std::round(ascent) + std::round(descent) which is what unmodified
Scintilla uses by adding Ascent() + Descent() since both of those are
rounded.
>
> The two values after ‘Height’ are from pango_font_metrics_get_height and pango_font_metrics_get_ascent + pango_font_metrics_get_descent.
>
> Attached is a patch to print out metrics inside PlatGTK.cxx.
>
> Replacing std::round with std::ceil in Ascent and Descent makes the underscore visible at the cost of extra space and fewer lines.
Yes, thats the point, it takes extra space to fit the underscore,
thats what Gedit and Eclipse do, as I said in the original message, "I
compared the Geany display to Eclipse and Gedit and the
Geany/Scintilla lines definitely use less vertical space".
While I had the printing I tried a few other fonts:
FreeMono, 10 Ascent: 10.666 11 Descent 2.66699 3 Height 13.333 13.333 13 14
Hack, 10 Ascent: 12.376 12 Descent 3.14453 3 Height 15.5205 15.5205 16 15
FreeSans, 10 Ascent: 10.666 11 Descent 2.66699 3 Height 14.666 13.333 15 14
Liberation Mono, 10 Ascent: 11.0996 11 Descent 4.00391 4 Height
15.1035 15.1035 15 15
MathJax_Typewriter, 10 Ascent: 9.25293 9 Descent 3.05371 3 Height
12.3066 12.3066 12 12
Nimbus Mono PS, 10 Ascent: 8.04004 8 Descent 5.29297 5 Height 16
13.333 16 13
Noto Mono, 10 Ascent: 12.3691 12 Descent 3.25488 3 Height 15.624
15.624 16 15
That is a wide range of values for what are ostensibly "10 point" fonts.
Also for varying point sizes plus I have annotated which ones have
visible underscores on standard Scintilla, ie
round(ascent)+round(descent):
DejaVu Sans Mono, 8 Ascent: 9.90137 10 Descent 2.51562 3 Height
12.417 12.417 12 13 yes
DejaVu Sans Mono, 9 Ascent: 11.1387 11 Descent 2.83008 3 Height
13.9688 13.9688 14 14 yes
DejaVu Sans Mono, 10 Ascent: 12.376 12 Descent 3.14453 3 Height
15.5205 15.5205 16 15 no
DejaVu Sans Mono, 11 Ascent: 13.6143 14 Descent 3.45898 3 Height
17.0732 17.0732 17 17 no
DejaVu Sans Mono, 12 Ascent: 14.8516 15 Descent 3.77344 4 Height
18.625 18.625 19 19 yes
That shows that the underscore issue may be more than just the plain
height since 11 point gives the same height value either way, but
doesn't show the underscores. Possibly Scintilla draws lower than the
font intended?
Cheers
Lex
>
> --
> You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
scintilla-inter...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/scintilla-interest/EA5F39EC-CED4-4897-A096-CCD2C0DABA74%40me.com.
>
>
> --
> You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
scintilla-inter...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/scintilla-interest/EA5F39EC-CED4-4897-A096-CCD2C0DABA74%40me.com.