bugThe FreeType Project - Bugs: bug #34706, CBox rounding results in...

 
 

bug #34706: CBox rounding results in monochrome bitmaps with 0 width for small fonts

Submitted by:  Victor Travieso <vtravieso>
Submitted on:  Mon 31 Oct 2011 03:51:32 PM UTC  
 
Severity: 3 - NormalItem Group: Incorrect behaviour
Status: InvalidPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 31 Oct 2011 10:22:02 PM UTC, comment #1:

IMHO your observation is invalid. The `gasp' table in the font says the following (I'm looking at Segoe UI version 1.00):

ppem <= 8: no grid-fit, anti-alias
9 <= ppem <= 19: grid-fit, anti-alias
20 <= ppem : grid-fit, anti-alias

In other words, this font is never intended to be rendered in monochrome mode. A look at the plain-ugly GDI rendering confirms this (I really wonder how you could override the gasp settings on Windows :-)

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Mon 31 Oct 2011 03:51:32 PM UTC, original submission:

Observed under Windows, with segoeui.ttf and a size of 8 ppem. Rendering in monochrome at small character sizes ends up with a width 0 and empty bitmaps for the glyph.

The problem seems to come from the grid fitting of the control box in ftrend1.c:165, which rounds the cbox instead of using floor/ceil:

/* undocumented but confirmed: bbox values get rounded */
#if 1
cbox.xMin = FT_PIX_ROUND( cbox.xMin );
cbox.yMin = FT_PIX_ROUND( cbox.yMin );
cbox.xMax = FT_PIX_ROUND( cbox.xMax );
cbox.yMax = FT_PIX_ROUND( cbox.yMax );
#else
cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
cbox.xMax = FT_PIX_CEIL( cbox.xMax );
cbox.yMax = FT_PIX_CEIL( cbox.yMax );
#endif

The old code for grid fitting with floor/ceil doesn't suffer from this. Alternatively, rounding the cbox in the vertical direction only seems to give results closer to GDI rendering and doesn't suffer the 0 width problem.

See attached captures from ftview:
ft_segoe_8pix_mono - current behaviour with missing i, l and other images
ft_segoe_8pix_mono_old - old grid fitting code with floor/ceil.
ft_segoe_8pix_mono_roundYonly - round in Y direction, floor/ceil in X
gdi_segoe_8pix_mono - rendering the same size with GDI for comparison

Victor Travieso <vtravieso>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #24256:  ft_segoe_8pix_mono.PNG added by vtravieso (54KiB - image/png - Output from ftview)
file #24257:  ft_segoe_8pix_mono_old.PNG added by vtravieso (41KiB - image/png - Output from ftview)
file #24258:  ft_segoe_8pix_mono_roundYonly.PNG added by vtravieso (61KiB - image/png - Output from ftview)
file #24259:  gdi_segoe_8pix_mono.png added by vtravieso (450B - image/png - Output from ftview)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by wl (Posted a comment)
  • -unavailable- added by vtravieso (Submitted the item)
  • -unavailable- added by vtravieso (freetype 0 width bitmaps)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 31 Oct 2011 10:22:02 PM UTCwlStatusNone=>Invalid
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed
    Mon 31 Oct 2011 03:51:32 PM UTCvtraviesoAttached File-=>Added ft_segoe_8pix_mono.PNG, #24256
      Attached File-=>Added ft_segoe_8pix_mono_old.PNG, #24257
      Attached File-=>Added ft_segoe_8pix_mono_roundYonly.PNG, #24258
      Attached File-=>Added gdi_segoe_8pix_mono.png, #24259
      Carbon-Copy-=>Added vtravieso

    Back to the top


    Powered by Savane 3.1-cleanup1