[HarfBuzz] problem with hb_ot_layout_lookup_would_substitute

Werner LEMBERG wl at gnu.org
Thu Jan 2 02:17:54 PST 2014


[harfbuzz 0.9.25]

Please tell me why the attached program returns zero and not true.

In font `pala.ttf' (version 5.00), GSUB lookup 1 (part of the `smcp'
feature) maps glyph `f' to glyph 1107, so there is definitely a
substitution.  However, `hb_ot_layout_lookup_would_substitute' returns
zero, which irritates me.  A bug?

And what's the function of the last argument of this function,
`zero_extent'?


    Werner
-------------- next part --------------
#include <ft2build.h>
#include FT_FREETYPE_H

#include <hb.h>
#include <hb-ot.h>
#include <hb-ft.h>


int
main(void)
{
  FT_Library ft_library;
  FT_Face ft_face;

  hb_face_t* hb_face;

  const char* filename = "pala.ttf";
  hb_codepoint_t c = 'f';


  FT_Init_FreeType(&ft_library);
  FT_New_Face(ft_library, filename, 0, &ft_face);

  hb_face = hb_ft_face_create(ft_face, NULL);

  return hb_ot_layout_lookup_would_substitute(hb_face, 1, &c, 1, 1);
}


More information about the HarfBuzz mailing list