[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Font scaling [Was: XML file format - Linux vs Windows]



On Wed, 19 Jun 2002, Lars Clausen wrote:

> We have, and I did in fact make a renderer that uses it.  If you take the
> 0.90 tarball and compile with --enable-freetype, you can see pretty
> antialiased TrueType fonts.

I started out to try this, but am running into a SEGV :-(  I haven't
looked too closely at it yet, so I'm not sure whether its dia (0.90) or
freetype (2.0.9).
Here's the stacktrace, in case anyone recognises it:

Program received signal SIGSEGV, Segmentation fault.
0x4036f610 in ps2_hints_apply () from /usr/lib/libfreetype.so.6
(gdb) where
#0  0x4036f610 in ps2_hints_apply () from /usr/lib/libfreetype.so.6
#1  0x403517ca in FT_Get_Postscript_Name () from /usr/lib/libfreetype.so.6
#2  0x080a2d55 in dia_add_freetype_font ()
#3  0x4024ddaf in g_hash_table_foreach () from /usr/lib/libglib-1.2.so.0
#4  0x080a3504 in font_init ()
#5  0x0806fc53 in app_init ()
#6  0x0809b5a7 in main ()
#7  0x4041a5b0 in __libc_start_main () from /lib/libc.so.6

If I find anything more, I'll let you know.  (FWIW, I'm pretty sure that
we use FT_Get_Postscript_Name() when printing, and it works for us :-/)

> However, I failed to get even that to scale
> linearly.  I've tried without hinting and bitmaps, but the scaling is still
> odd.  An example diagram is at
> <URL:http://shasta.cs.uiuc.edu/~lrclause/Dia/BrownFox.dia>
> and a screenshot of the freetype/libart display at
> <URL:http://shasta.cs.uiuc.edu/~lrclause/Dia/BrownFox-freetype.png>
> The purple boxes are the bounding boxes, which scale linearly.

I think we've had similar problems.  If I recall, one of the things to be
very careful about is the numeric types, when working with Freetype.  It
kindof looks a problem with a double/float size being truncated to an
integer somewhere.
I'm pretty sure it works though, as we are constantly rescaling our text.
(In fact, our text is rarely drawn at the same size twice!  zoom in/out, etc)

> If you want to fiddle with it, look in lib/font.c and and
> app/render_libart.c.  I'm running out of ideas for what to do.

I'll look through the code and see if I see anything obvious.  Until I get
past that SEGV though, I won't be able to try anything :-(
Ian



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] Mail converted by Mofo Magic and the Flying D

 
All trademarks and copyrights are the property of their respective owners.

Other Directory Sites: SeekWonder | Directory Owners Forum

GuideSMACK