[plt-scheme] leading in GUI text

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sat Jul 4 08:48:03 EDT 2009

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.