[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Devel] RE: glyphs with no pixels are not tolerated by the renderers
From: |
Graham Asher |
Subject: |
[Devel] RE: glyphs with no pixels are not tolerated by the renderers |
Date: |
Tue, 14 Jan 2003 09:18:26 -0000 |
Yesterday I said this:
<<<<<<
Working on the GhostScript-to-FreeType bridge today I found that a certain
PostScript file was failing because it contained glyphs with outlines that
produced empty bitmaps. The problem is that in ft_raster1_render in
ftrend1.c, the statement
if ( FT_ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) )
goto Exit;
creates a buffer into which the bitmap is rendered. It succeeds if (pitch *
height) is zero, but of course in that case bitmap->buffer remains null. The
function ft_black_render in ftraster.c is then called, but it returns an
error when running this statement:
if ( !target_map || !target_map->buffer )
return Raster_Err_Invalid;
My fix is to change lines 194-5 of ftrend1.c from
/* render outline into the bitmap */
error = render->raster_render( render->raster, ¶ms );
to
/* render outline into the bitmap if outline is of non-zero size */
if ( bitmap->buffer )
error = render->raster_render( render->raster, ¶ms );
This solves the problem.
Also, although no difficulty has occurred with anti-aliased rendering, I
suggest making the same change to ftsmooth.c: lines 198-199 are also changed
to exactly the same replacement lines.
I'd be grateful for comments or suggestions of a simpler fix.
>>>>>>
I'd like to modify my views based on what I have found out since then. The
empty bitmaps were produced by outlines for which all points were (0,0).
This was caused by an erroneous font transformation in my code. However, I
still believe the changes mentioned above should be done, because it's not
the job of a renderer to reject any legal outline; and any sequence of
points should be legal for an outline. This policy is in line with the
general principles of modularisation and context-free-ness.
Graham Asher
- [Devel] EPOC and true type fonts, Amir Kamal, 2003/01/02
- RE: [Devel] EPOC and true type fonts, Graham Asher, 2003/01/05
- [Devel] unpatented hinting system for Dynalab fonts, etc, Graham Asher, 2003/01/07
- Re: [Devel] unpatented hinting system for Dynalab fonts, etc, David Turner, 2003/01/08
- RE: [Devel] unpatented hinting system for Dynalab fonts, etc, Graham Asher, 2003/01/08
- [Devel] glyphs with no pixels are not tolerated by the renderers, Graham Asher, 2003/01/13
- [Devel] RE: glyphs with no pixels are not tolerated by the renderers,
Graham Asher <=
- Re: [Devel] glyphs with no pixels are not tolerated by the renderers, Werner LEMBERG, 2003/01/15
- Re: [Devel] glyphs with no pixels are not tolerated by the renderers, David Turner, 2003/01/16
- RE: [Devel] glyphs with no pixels are not tolerated by the renderers, Graham Asher, 2003/01/16
- [Devel] pixel size, hinting and scaling, Graham Asher, 2003/01/14
- Re: [Devel] pixel size, hinting and scaling, David Turner, 2003/01/16
- RE: [Devel] pixel size, hinting and scaling, Graham Asher, 2003/01/17
- Re: [Devel] pixel size, hinting and scaling, David Turner, 2003/01/17
- RE: [Devel] pixel size, hinting and scaling, Graham Asher, 2003/01/17
- Re: [Devel] pixel size, hinting and scaling, David Turner, 2003/01/17
- [Devel] Leaking FT_Glyph_To_Bitmap, Patrick Hoffmann, 2003/01/17