Mail Archives: geda-user/2013/07/16/15:09:37
On 07/16/2013 09:13 AM, Roland Lutz wrote:
> On Thu, 27 Jun 2013, Dave Curtis wrote:
>> I'm not very familiar with Cairo, but I've managed to come up with
>> something that appears to work, but it relies heavily on a magic
>> number that I arrived at empirically.
>
>> _gschemScalingConstant = 10000.0/555.0 # Magic number
>
> Maybe you are interested in this constant from
> libgeda/src/o_text_basic.c:
>
> /*! \brief Scale factor between legacy gschem font units and
> postscript points.
> *
> * \par Description
> * gschem fonts are nominally specified in points, however there is a
> * difference in how the specified font size corresponds to the
> metrics of
> * the font when compared to typical typographic usage.
> *
> * The following factor was impirically determined to approximately
> match the
> * cap-height between the legacy gschem font, and fonts rendered
> using pango.
> */
> #define GEDA_FONT_FACTOR 1.3
>
> This factor has been empirically determined, too; it's 1.3, not 18,
> though, so this is probably not exactly what you are looking for.
Thanks for the code snippet. It must somehow be scaling something
different, because 1.3 is not very close to 18. That's a bit of a mystery.
I note that their comment is looking at the cap-height of the fonts. In
my case, I was only interested in the text width measurement. So I
arrived at my magic number by measuring in gschem the width of "The
quick brown fox..." in both caps and lower case, in 10 and 8 point
Ariel. It turns out that my symbols are looking pretty decent with that
scaling. I wish I knew why, but I'll take it.
Thanks!
-dave
>
> Roland
>
- Raw text -