freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] TODO


From: Werner LEMBERG
Subject: Re: [Devel] TODO
Date: Sun, 22 Jun 2003 16:55:45 +0200 (CEST)

> After some thinking I believe that the `width' value has a very
> limited meaning: It can be only used as an enumeration value to
> identify different strikes if the height is the same.  Its real
> value is meaningless.

I've now revised FreeType's bitmap handling to be consistent for all
drivers (see ChangeLog for more details).  Below the new descriptions
of the relevant functions (from freetype.h).  Please test.


    Werner


PS: It is now possible to select any bitmap strike in a FNT file.  The
    code first checks the height only, then it tries to find a better
    hit by checking the width also.


======================================================================


  /*************************************************************************/
  /*                                                                       */
  /* <Struct>                                                              */
  /*    FT_Bitmap_Size                                                     */
  /*                                                                       */
  /* <Description>                                                         */
  /*    An extremely simple structure used to model the size of a bitmap   */
  /*    strike (i.e., a bitmap instance of the font for a given            */
  /*    resolution) in a fixed-size font face.  This is used for the       */
  /*    `available_sizes' field of the @FT_FaceRec structure.              */
  /*                                                                       */
  /* <Fields>                                                              */
  /*    height :: The character height in pixels.                          */
  /*                                                                       */
  /*    width  :: The character width in pixels.  For drivers which        */
  /*              contain a single bitmap strike only (BDF, PCF) this      */
  /*              field is always equal to `height'.  To get the           */
  /*              (maximum) width of a bitmap strike use                   */
  /*              `face->size->metrics.max_advance' after a call to        */
  /*              @FT_Set_Pixel_Sizes.                                     */
  /*                                                                       */


  /*************************************************************************/
  /*                                                                       */
  /* <Function>                                                            */
  /*    FT_Set_Pixel_Sizes                                                 */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Sets the character dimensions of a given face object.  The width   */
  /*    and height are expressed in integer pixels.                        */
  /*                                                                       */
  /*    If one of the character dimensions is zero, its value is set equal */
  /*    to the other.                                                      */
  /*                                                                       */
  /* <InOut>                                                               */
  /*    face         :: A handle to the target face object.                */
  /*                                                                       */
  /* <Input>                                                               */
  /*    pixel_width  :: The character width, in integer pixels.            */
  /*                                                                       */
  /*    pixel_height :: The character height, in integer pixels.           */
  /*                                                                       */
  /* <Return>                                                              */
  /*    FreeType error code.  0 means success.                             */
  /*                                                                       */
  /*                                                                       */
  /* <Note>                                                                */
  /*    The values of `pixel_width' and `pixel_height' correspond to the   */
  /*    pixel values of the _typographic_ character size, which are NOT    */
  /*    necessarily the same as the dimensions of the glyph `bitmap        */
  /*    cells'.                                                            */
  /*                                                                       */
  /*    The `character size' is really the size of an abstract square      */
  /*    called the `EM', used to design the font.  However, depending      */
  /*    on the font design, glyphs will be smaller or greater than the     */
  /*    EM.                                                                */
  /*                                                                       */
  /*    This means that setting the pixel size to, say, 8x8 doesn't        */
  /*    guarantee in any way that you will get glyph bitmaps that all fit  */
  /*    within an 8x8 cell (sometimes even far from it).                   */
  /*                                                                       */
  /*    For bitmap fonts, `pixel_height' usually is a reliable value for   */
  /*    the height of the bitmap cell.  Drivers for bitmap font formats    */
  /*    which contain a single bitmap strike only (BDF, PCF) ignore        */
  /*    `pixel_width'.                                                     */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]