[haiku-commits] Re: haiku: hrev47669 - in src/apps/serialconnect/libvterm: src include

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 12 Aug 2014 21:06:39 +0200

Hi,

Am 12.08.2014 20:51, schrieb Ingo Weinhold:
   fontHeight = ceilf(ascent) + ceilf(descent + leading)

would ensure that there's at least one pixel spacing between the lines.
For leading < 1 that is no longer guaranteed, but at least nothing would
overlap.

Maybe the best solution would be to choose one of the three formulas
depending on the leading value.

IIRC, Freetype has no notion of "leading". It is calculated in app_server as fontHeight (what BFont.Size() returns) - (ascent + descent).

See http://cgit.haiku-os.org/haiku/tree/src/servers/app/font/FontStyle.cpp#n51

In typography, one would usually use 20% of the font height as additional line gap. This is what word processesors refer as "100% line height".

Best regards,
-Stephan


Other related posts: