On Fri, Jan 16, 2009 at 10:06:29PM -0800, Alan Irwin wrote: > On 2009-01-16 23:43-0000 Andrew Ross wrote: > > > If it is any consolation I can confirm your report on my Ubuntu system. > > Example 24 has not been updated since mid 2006 other than for a const > > char * tidy-up. The cookbook in in the example does say to use -drvopt > > smooth=0 so I suspect this is an old bug. > > Sorry, my eyes somehow missed that -drvopt smooth=0 in the instructions, but > now that I am up to speed on those instructions, I agree it must be a > longstanding workaround for a bug since the smooth=1 case works everywhere > else we have unicode test. > > > I am still at a loss though as > > to the cause. Looking in gd.c and plfreetype.c the smooth_text variable > > appears in very few places - principally in the call to FT_Load_Char. > > There is nothing obviously wrong to me. > > Thanks for taking a look.
I've pinned down the problem, but I'm not quite sure why the code is written the way it is. The problem arises in src/plfreetype.c in FT_PlotChar. There are two different code paths depending on whether the pixel mode is mono (i.e. no anti-aliasing) or not. However, the first path is also taken if icol0 = 0, i.e. the background colour. I can't quite see the logic for this. Normally is is not a problem since you wouldn't display text in the background colour. Example 24 however plots 4 coloured bands so you can't see the background, then switches to the background colour to print the text. The crazy fonts arise because the code assumes a mono font - i.e. each pixel is represented by one bit. This is not the case for the anti-aliased text in the background colour. I've just commented out this special case for icol0 = 0. I don't quite see why it was there in the first place. This fixes example 24. Perhaps someone better familiar with the freetype code could say why this was done originally? Andrew ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel