X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com Message-ID: <51C0AB6C.5090404@sonic.net> Date: Tue, 18 Jun 2013 11:48:12 -0700 From: Dave Curtis User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 MIME-Version: 1.0 To: geda-user AT delorie DOT com Subject: Re: [geda-user] gschem text measure References: <51BE355E DOT 5040600 AT sonic DOT net> <51BE73B7 DOT 4020905 AT sonic DOT net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: geda-user AT delorie DOT com On 06/18/2013 09:34 AM, Edward Hennessy wrote: > Sent from my iPhone > > On Jun 18, 2013, at 3:17 AM, Roland Lutz wrote: > >> In my opinion, the way text measurements are handled in gEDA is somewhat broken. > I would like to see the behavior centering text vertically in gschem changed. Right now, it uses a function of the inked rectangle. So, when centering the words "hello" and "goodbye" vertically, each winds up with a different y coordinate for the baseline, because of the descenders. > > I would rather text was centered between the baseline of the bottom row of text and the cap height of the top row of text. This way, the baseline of text would be centered vertically, on a pin for example, regardless of wether the text contains descenders or not. > > The only way I know to obtain the cap height is to measure it. For example, measuring the inked rectangle from a capital letter with a flat top, like H or I. > > Does anyone else have thoughts on centering text vertically? > > Ed > Look at the way Cairo renders text. Each font has four lines, I forget all the names, but for what you want, you would ignore the ascent and descent and use the baseline and the ummm.... foo-line (not it's real name :) You can get those numbers from Cairo functions. You could whip up a quick Python program to get the numbers for a font of interest. Google some Cairo text rendering tutorials and it should all show up. I've spent a few minutes over the last couple of days looking at gschem text rendering, and it does a lot of work to munge Cairo font metrics into something that has reasonable backwards compatibility with old gschem text rendering. So, the behavior you are seeing is a feature :) For what I want, I need to figure out how to scale a font so that the "y advance" number matches with gschem's way of measuring the world. Or at least to within a few percent, since for laying out a symbol all the interesting anchor points get rounded up to a grid unit (100 mil) boundary anyway. I just want to avoid overlap, mainly. -dave