[HarfBuzz] BASE table

James Clark jjc at jclark.com
Thu Aug 22 05:56:44 PDT 2013


Thanks for the quick reply.

It sounds like implementing BASE for HarfBuzz might be a nice project for
somebody. As you probably know, it's needed for CSS Level 3 Line Layout:
http://dev.w3.org/csswg/css3-linebox/.

I've read the spec several times over the years and I believe I understand
it: the GPOS/GSUB stuff you've already implemented seems much harder to me.
 I was thinking of something like this for the API:

hb_bool_t
hb_font_get_extents (hb_font_t          *font,
                     hb_direction_t      direction,
                     hb_script_t         script,
                     hb_language_t       language,
                     const hb_feature_t *features,
                     unsigned int        num_features,
                     hb_position_t      *min_extent,
                     hb_position_t      *max_extent);

typedef enum {
  HB_BASELINE_ROMAN        = HB_TAG ('r', 'o', 'm', 'n'),
  HB_BASELINE_IDEOGRAPHIC  = HB_TAG ('i', 'd', 'e', 'o'),
  HB_BASELINE_MATHEMATICAL = HB_TAG ('m', 'a', 't', 'h'),
  HB_BASELINE_HANGING      = HB_TAG ('h', 'a', 'n', 'g'),
  /* etc */
  HB_BASELINE_INVALID     = HB_TAG_NONE
} hb_baseline_t;

hb_baseline_t
hb_face_get_baseline (hb_face_t     *face,
                      hb_direction_t direction,
                      hb_script_t    script);

hb_bool_t
hb_font_get_baseline_position (hb_font_t     *font,
                               hb_direction_t direction,
                               hb_baseline_t  baseline,
                               hb_position_t *position /* OUT */);

Does that look roughly in the right direction to you?

Another way to do it would be to set the dominant font and script on the
hb_buffer, and then hb_shape could deal with the baseline adjustments. This
would be a bit easier to use, but I suspect would provide insufficient
flexibility for some clients.

James


On Thu, Aug 22, 2013 at 2:12 AM, Behdad Esfahbod <behdad at behdad.org> wrote:

> On 13-08-21 07:22 AM, James Clark wrote:
> > Does HarfBuzz do anything with the OpenType BASE table?
>
> It doesn't.
>
> >  If not, how in the
> > grand scheme of things does the BASE table get used?
>
> BASE is not used in the Free Software text stack at all.  Every time I read
> the spec to try to understand how to implement it I got confused and gave
> up.
>
> behdad
>
>
> > James
>
> --
> behdad
> http://behdad.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/harfbuzz/attachments/20130822/219ac89c/attachment.html>


More information about the HarfBuzz mailing list