[plt-scheme] leading in GUI text

From: Hugh Myers (hsmyers at gmail.com)
Date: Sat Jul 4 13:12:56 EDT 2009

Well I'll play with negative values if I need to. Given the very wide
variety out there in font-land, tweaking is the norm! :)


On Sat, Jul 4, 2009 at 6:48 AM, Matthew Flatt<mflatt at cs.utah.edu> wrote:
> At Sat, 4 Jul 2009 02:06:29 -0600, Hugh Myers wrote:
>> The docs say:
>> (new text%     [      [line-spacing line-spacing]
>>               [tab-stops tab-stops]
>>               [auto-wrap auto-wrap]])         →               (is-a?/c text%)
>>   line-spacing : (and/c real? (not/c negative?)) = 1.0
>>   tab-stops : (listof real?) = null
>>   auto-wrap : any/c = #f
>> The line-spacing argument sets the additional amount of space (in DC
>> units) inserted between each line in the editor when the editor is
>> displayed. This spacing is included in the reported height of each
>> line.
>> The part that I wonder about is "sets the additional amount of space"
>> Additional to what.
> Some fonts on some platforms have extra vertical space built in. I do
> not know why. That space is reported as the fourth result of
> `get-text-extent'.
>> In setting of chess
>> diagrams, I need the leading to be zero else the diagram will have
>> nasty little bits of white space.
> That sounds like exactly the sort of case where I've had to subtract
> the extra space built into a font to make the output look right.

Posted on the users mailing list.