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: Thu, 19 Jun 2003 08:53:21 +0200 (CEST)

> IIRC there currently exist the following FreeType2 font drivers that
> support (embedded) bitmaps and their behaviour is as follows.
> Please correct me if I'm wrong:
>
> driver |truetype|bdf   |pcf   |winfnt
> -------+--------+------+------+------
> units  |ppi     |pixels|pixels|pixels
> reports|Y*Y     |Y*Y   |Y*Y   |X*Y

Why do you think that the units `width' and `height' for embedded
bitmap strikes in TrueType fonts are ppi?  For example, the output of

  ftdump mincho.ttc

shows the following:

  ...
  font type entries
     FreeType driver: truetype
     sfnt wrapped:    yes
     type:            scalable, fixed size
     direction:       horizontal, vertical
     fixed width:     no
     ...

  fixed size
     0: height 12, width 12
     1: height 13, width 13
     2: height 14, width 14
     ...

For this font, the strikes are really quadratic so that height and
width are identical.  Similar to other formats, the dimensions are in
pixels.

> ppi means pixels per inch (or something similar).  pixels means the
> character bounding box in pixels. X*Y means width*height of the
> bounding box, Y*Y means that the width is lost, overwritten by the
> height (which matters if you want to use the width as pixel width of
> a fixed-width bitmap font, for proportional fonts this is not very
> important).

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.  Reasons:

  . For fixed-width fonts you can get the width from the font's
    bounding box, so the `width' field is redundant.

  . For proportional fonts it is impossible to extract a value which
    means the same for each font format.  Obviously it doesn't make
    sense to specify the largest width in the font, and it is black
    art to compute the average width: Some font formats use all glyphs
    to get the average, others only a subset.

    A solution would be to compute an average width by ourselves, but
    IMHO this is far too expensive either in time (if all glyphs are
    used to get the average) or in code size (to identify/guess a
    subset based on the script).

> IMHO its not possible to change the winfnt driver to ppi instead of
> pixels since there is no resolution info in the fnt files?

It is not clear to me what you want to do here.  Please explain.

> In future when FreeType2 will support bitmap-only truetype fonts it
> may be an issue how the driver reports the bitmap sizes.

This is something completely different.  Here we have to trust the
font designer that he has set up the right font dimensions.


    Werner



reply via email to

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