freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] BDF and FT_Set_Pixel_Sizes


From: Chia-I Wu
Subject: Re: [ft-devel] BDF and FT_Set_Pixel_Sizes
Date: Thu, 12 Jan 2006 20:24:55 +0800
User-agent: Mutt/1.5.11

On Fri, Dec 09, 2005 at 09:30:27AM +0800, Chia-I Wu wrote:
> To remedy this, the definition of FT_Set_Pixel_Sizes is changed to set
> the real height, not the nominal height.  BDF/PCF drivers are also
> updated to reflect this change.
> 
> As you can see, the problem is that other drivers are not updated.  The
> scaling I mentioned in my another mail should be used for scalable font
> drivers.  Sbit needs update too.
Ok, back on this issue :)

Since FT_Set_Pixel_Sizes might set the nominal size or the real
dimension in a unpredictable way, this is the first thing to fix. I
chose to make it always set the nominal size.

This effectively undo one of the changes between 2.1.9 and 2.1.10, which
says:
    - The method  how BDF and PCF  bitmap fonts  are accessed has been
      refined.   Formerly,   FT_Set_Pixel_Sizes  and  FT_Set_Char_Size
      were  synonyms in  FreeType's  BDF and PCF interface.  This  has
      changed now.  FT_Set_Pixel_Sizes  should be  used to  select the
      actual  font dimensions  (the `strike',  which is the sum of the
      `FONT_ASCENT'    and    `FONT_DESCENT'    properties),     while
      FT_Set_Char_Size  selects  the  `nominal' size  (the `PIXELSIZE'
      property).  In both functions, the width parameter is ignored.

Then what if the user wants to set the real dimension?  To meet this
need, I changed the driver interface and combined the `set_char_sizes'
and `set_pixel_sizes' to `request_size', which takes FT_Size_RequestRec
as its argument, which is prototyped by

        typedef struct  FT_Size_RequestRec_
        {
          FT_Size_Request_Type  type;
          FT_F26Dot6            width;
          FT_F26Dot6            height;
          FT_UInt               horiResolution;
          FT_UInt               vertResolution;
        } FT_Size_RequestRec, *FT_Size_Request;

The field `type' can be NOMINAL, REAL_DIMENSION, or more.

Further, I added `select_size' to the driver interface, which selects a
fixed size by its index in available_sizes.  If you imagine how clients
choose a fixed size from the available ones, you will find it useful.
In spite of this, `request_size' still looks into avaiable sizes and
selects one of them if it matches the request, as we had always done.

You can find the detail from the attached file, which is a diff of the
headers.  If everyone agrees on these changes, I'll commit them.

-- 
Regards,
olv

Attachment: changes_by_diff
Description: Text document


reply via email to

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