Re: [ft-devel] BDF and FT_Set_Pixel_Sizes

2005-12-07 Thread Werner LEMBERG
  How do you come to this conclusion?  The original BDF
  specification (found in the X11 distribution) says that both
  FONT_ASCENT and FONT_DESCENT are *logical* values.  They don't
  guarantee that all bitmap glyphs are within this range.

 Still, then we should set y_scale to 8 / (face-ascender +
 face-descender) in, for example, Set_Pixel_Sizes in ttdriver.c,
 shouldn't we?

I'm not sure -- and too lazy to really think about it :-) Do you
encounter problems with bitmap sizes?

 I found docs/CHANGES mentions this change and it says
 FT_Set_Pixel_Size is used to select actual font dimensions (the
 `strike'), not the nominal size.  Maybe my question is what actual
 font dimensions mean?

Well, if the font contains an 8x16 bitmap, the parameters are `8' and
`16'.  This is to get a unified interface to all bitmap formats,
including Windows FNT.  Note that the ppem values in WinFNT files are
normally incorrect.

BTW, your latest changes to the SFNT driver broke FNT files with
multiple faces (this is, if they contain more than a single bitmap
font).  Reason is that the check for `face_index' in the SFNT driver
is done before validation of the font format -- the driver incorrectly
returns SFNT_Err_Bad_Argument instead of the correct
SFNT_Err_Unknown_File_Format.  I've fixed that now.


Werner


___
Freetype-devel mailing list
Freetype-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype-devel


RE: [ft-devel] BDF and FT_Set_Pixel_Sizes

2005-12-06 Thread Turner, David
Hello,


  I also have a (maybe stupid) question.  Why don't we simply have
 
  FT_Set_Pixel_Sizes( face, w, h )
  {
  FT_Set_Char_Size( face, w, h, 72, 72 ):
  }
 
  ?
 (More looking forward to comments on this question actually)


The question isn't stupid at all. The difference comes from the TrueType
bytecode specification, which makes a specific distinction between these
two scaling modes.

I can't remember the details though...


Also, it should be FT_Set_Char_Size( face, w*64, h*64, 72, 72 ) :-)

- David Turner
- The FreeType Project  (www.freetype.org)

PS: By the way, thanks a *lot* for your optimizations and bug fix
on the cmap processing code. Great work !

 --
 Regards,
 olv


 ___
 Freetype-devel mailing list
 Freetype-devel@nongnu.org
 http://lists.nongnu.org/mailman/listinfo/freetype-devel

***
Information contained in this email message is confidential and may be 
privileged, and is intended only for use of the individual or entity named 
above. If the reader of this message is not the intended recipient, or the 
employee or agent responsible to deliver it to the intended recipient, you are 
hereby notified that any dissemination, distribution or copying of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the [EMAIL PROTECTED] and destroy the 
original message.
***



___
Freetype-devel mailing list
Freetype-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype-devel


Re: [ft-devel] BDF and FT_Set_Pixel_Sizes

2005-12-06 Thread Chia-I Wu
Hi,

 The question isn't stupid at all. The difference comes from the TrueType
 bytecode specification, which makes a specific distinction between these
 two scaling modes.
 I can't remember the details though...
Hmm... the truetype driver doesn't seem to distinguish them.  Is it
unimplemented or something?

-- 
Regards,
olv


___
Freetype-devel mailing list
Freetype-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype-devel


Re: [ft-devel] BDF and FT_Set_Pixel_Sizes

2005-12-05 Thread Chia-I Wu
On Sat, Dec 03, 2005 at 04:15:09PM +0800, Chia-I Wu wrote:
 I find these two paragraphs conflicting.  If we use the sum of
 FONT_ASCENT and FONT_DESCENT to match against, then all glyphs are
 within the 8x8 cell, provided FT_Set_Pixel_Size( face, 8, 8 ) returns
 success.  Or put it in another way, it means when the face is scalable,
 we should set
   x_scale = 8 / ( face-bbox.xMax - faec-bbox.xMin ),
   y_scale = 8 / ( face-bbox.yMax - faec-bbox.yMin ),
 so that all glyphs are within the 8x8 cell.  And this is really not
 intuitive.
Any comment?

I found this mail

http://lists.gnu.org/archive/html/freetype-devel/2004-07/msg00011.html

and BDF_Set_Pixel_Sizes was changed because otherwise
FTC_Manager_LookupSize would return error if we set

  scaler.width  = face-available_sizes-width;
  scaler.height = face-available_sizes-height;
  scaler.pixel  = TRUE;

But shouldn't the scaler be set up like this:

  scaler.width  = face-available_sizes-x_ppem;
  scaler.height = face-available_sizes-y_ppem;
  scaler.pixel  = TRUE;

?

 I also have a (maybe stupid) question.  Why don't we simply have
 
 FT_Set_Pixel_Sizes( face, w, h )
 {
   FT_Set_Char_Size( face, w, h, 72, 72 ):
 }
 
 ?
(More looking forward to comments on this question actually)

-- 
Regards,
olv


___
Freetype-devel mailing list
Freetype-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype-devel


[ft-devel] BDF and FT_Set_Pixel_Sizes

2005-12-03 Thread Chia-I Wu
Hi,

According to the document,

quote
This means that setting the pixel size to, say, 8x8 doesn't guarantee in
any way that you get glyph bitmaps that all fit within an 8x8 cell
(sometimes even far from it).

...

For BDF and PCF formats, this function uses the sum of the `FONT_ASCENT'
and `FONT_DESCENT' properties of the bitmap font.
/quote

I find these two paragraphs conflicting.  If we use the sum of
FONT_ASCENT and FONT_DESCENT to match against, then all glyphs are
within the 8x8 cell, provided FT_Set_Pixel_Size( face, 8, 8 ) returns
success.  Or put it in another way, it means when the face is scalable,
we should set
x_scale = 8 / ( face-bbox.xMax - faec-bbox.xMin ),
y_scale = 8 / ( face-bbox.yMax - faec-bbox.yMin ),
so that all glyphs are within the 8x8 cell.  And this is really not
intuitive.

I also have a (maybe stupid) question.  Why don't we simply have

FT_Set_Pixel_Sizes( face, w, h )
{
FT_Set_Char_Size( face, w, h, 72, 72 ):
}

?

-- 
Regards,
olv


___
Freetype-devel mailing list
Freetype-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype-devel