<div dir="ltr">Thanks for the quick reply.<div><br></div><div>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: <a href="http://dev.w3.org/csswg/css3-linebox/">http://dev.w3.org/csswg/css3-linebox/</a>.</div>

<div><br></div><div>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:</div>

<div><br></div><div><div><font face="courier new, monospace">hb_bool_t</font></div><div><font face="courier new, monospace">hb_font_get_extents (hb_font_t          *font,</font></div><div><font face="courier new, monospace">                     hb_direction_t      direction,</font></div>

<div><font face="courier new, monospace">                     hb_script_t         script,</font></div><div><font face="courier new, monospace">                     hb_language_t       language,</font></div><div><font face="courier new, monospace">                     const hb_feature_t *features,</font></div>

<div><font face="courier new, monospace">                     unsigned int        num_features,</font></div><div><font face="courier new, monospace">                     hb_position_t      *min_extent,</font></div><div><font face="courier new, monospace">                     hb_position_t      *max_extent);</font></div>

<div><br></div><div><font face="courier new, monospace">typedef enum {</font></div><div><font face="courier new, monospace">  HB_BASELINE_ROMAN        = HB_TAG ('r', 'o', 'm', 'n'),</font></div>

<div><font face="courier new, monospace">  HB_BASELINE_IDEOGRAPHIC  = HB_TAG ('i', 'd', 'e', 'o'),</font></div><div><font face="courier new, monospace">  HB_BASELINE_MATHEMATICAL = HB_TAG ('m', 'a', 't', 'h'),</font></div>

<div><font face="courier new, monospace">  HB_BASELINE_HANGING      = HB_TAG ('h', 'a', 'n', 'g'),</font></div><div><font face="courier new, monospace">  /* etc */</font></div><div><font face="courier new, monospace">  HB_BASELINE_INVALID     = HB_TAG_NONE</font></div>

<div><font face="courier new, monospace">} hb_baseline_t;</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">hb_baseline_t</font></div><div><font face="courier new, monospace">hb_face_get_baseline (hb_face_t     *face,</font></div>

<div><font face="courier new, monospace">                      hb_direction_t direction,</font></div><div><font face="courier new, monospace">                      hb_script_t    script);</font></div><div><font face="courier new, monospace"><br>

</font></div><div><font face="courier new, monospace">hb_bool_t</font></div><div><font face="courier new, monospace">hb_font_get_baseline_position (hb_font_t     *font,</font></div><div><font face="courier new, monospace">                               hb_direction_t direction,</font></div>

<div><font face="courier new, monospace">                               hb_baseline_t  baseline,</font></div><div><font face="courier new, monospace">                               hb_position_t *position /* OUT */);</font></div>

<div><br></div><div>Does that look roughly in the right direction to you?<br></div></div><div><br></div><div>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.</div>

<div><br></div><div>James</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 22, 2013 at 2:12 AM, Behdad Esfahbod <span dir="ltr"><<a href="mailto:behdad@behdad.org" target="_blank">behdad@behdad.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 13-08-21 07:22 AM, James Clark wrote:<br>
> Does HarfBuzz do anything with the OpenType BASE table?<br>
<br>
</div>It doesn't.<br>
<div class="im"><br>
>  If not, how in the<br>
> grand scheme of things does the BASE table get used?<br>
<br>
</div>BASE is not used in the Free Software text stack at all.  Every time I read<br>
the spec to try to understand how to implement it I got confused and gave up.<br>
<br>
behdad<br>
<br>
<br>
> James<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
behdad<br>
<a href="http://behdad.org/" target="_blank">http://behdad.org/</a><br>
</font></span></blockquote></div><br></div>