On Sun, 2008-05-04 at 16:34 +0100, Peter Clifton wrote: > On Sun, 2008-05-04 at 15:22 +0000, Kai-Martin Knaak wrote: > > On Sat, 03 May 2008 15:10:14 +0100, Peter Clifton wrote: > > > > > Yes, that's exactly the right diagnosis. Cairo supports glyphs and > > > fonts, just not ones defined at run-time by the user of its API. (IE. > > > gschem can't yet describe to cairo what it thinks the various glyphs > > > should look like), > > > > I couldn't care less for the font currently used by gschem. It is just > > plain ugly when zoomed in. If it were replaced by a real font, the only > > important property is a compatible font metrics. > > I think gschem's font is a little larger than its metrics claim. Ales > can correct me if I'm wrong, but I believe the code defines a 2pt font > as 26 mils high. (That matches roughly the "real" conversion factor of > 27.7778). I've tried either, but the "Sans" font on my system > consistently comes out smaller than the gschem font.
Judging by the code, which scales line lengths of the primitive font by "size / 2" (size being in points), this would suggest that gschem's primitive font is a 2pt font, and whichever metric corresponds to the notional point size of a font, should measure 26 mils in those glyph definitions. > Looking at its metrics (dig into gschem/src/o_text.c and change the > #undef DEBUG_TEXT #define DEBUG_TEXT), I see that its ascent and height > are quite large compared to the size of the glyphs I'm actually seeing. > > BTW.. Please take a play and see what fonts you like. Search for "Sans" > in o_text.c. > > > > Unfortunately, the glyph caching won't help with zoom either, since the > > > first time you render a glyph at a given size, it will be slow. > > > > A glyph like "a" is reused many times on a view with lots of text. So it > > has to be rendered only once and can be copied for the rest of the > > instances. I'd expect glyph caching to help in this situation. If the > > current view contains only little text, speed is no issue in the first > > place. > > Yes, it helps lots over the case where I was rendering text using lines > (old code, converted to cairo lines). The main thing is that you have up > to 26 x 2 + (extras) glyphs to render for each size you zoom to. That > can take time a noticable time, and is one of the things limiting the > zoom frame-rate. > > Best wishes, > -- Peter Clifton Electrical Engineering Division, Engineering Department, University of Cambridge, 9, JJ Thomson Avenue, Cambridge CB3 0FA Tel: +44 (0)7729 980173 - (No signal in the lab!) _______________________________________________ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user