Re: PangoF2 in win32 not applying GSUB - Fixed.

Thanks Tml,

 This fixed the issue for me, now the GSUBs are working properly in win32.
I just commented out the portion in pango_ot_info_get() in 

PangoOTInfo *
pango_ot_info_get (FT_Face face)
  PangoOTInfo *info;

  if (G_LIKELY (face-> && face->generic.finalizer == pango_ot_info_finalizer))
    return face->;
      if (face->generic.finalizer)
        face->generic.finalizer (face->;

      info = face-> = g_object_new (PANGO_TYPE_OT_INFO, NULL);
      face->generic.finalizer = pango_ot_info_finalizer;

      info->face = face;

	  if (face->stream->base != NULL) {
	hb_blob_t *blob;

	blob = hb_blob_create ((const char *) face->stream->base,
			       (unsigned int) face->stream->size,
			       NULL, NULL);
	info->hb_face = hb_face_create_for_data (blob, face->face_index);
	hb_blob_destroy (blob);
      } else 
	info->hb_face = hb_face_create_for_tables (_get_table, NULL, info);

      hb_face_set_unicode_funcs (info->hb_face, hb_glib_get_unicode_funcs ());

      /* XXX this is such a waste if not SFNT */
      if (!hb_ot_layout_has_font_glyph_classes (info->hb_face))
	synthesize_class_def (info);

  return info;

Warm Regds,
Ravi Kiran.

--- On Mon, 3/1/10, Tor Lillqvist <tml iki fi> wrote:

> From: Tor Lillqvist <tml iki fi>
> Subject: Re: PangoF2 in win32 not applying GSUB.
> To: "Ravi Kiran." <kiranps yahoo com>
> Cc: gtk-i18n-list gnome org
> Date: Monday, March 1, 2010, 10:41 AM
> I think I found the cause to the
> problem. Pango assumes that the
> FT_StreamRec::base field, if non-zero, points to the whole
> font file
> read or mapped into memory. See pango_ot_info_get(). As
> such this is
> correct according to FreeType documentation, as said in
> ftsystem.h,
> "base :: For memory-based streams, this is the address of
> the first
> stream byte in memory.  This field should always be
> set to NULL for
> disk-based streams."
> Now, for some reason the base field is not set to NULL on
> Windows when
> pango_ot_info_get() gets called, even if the FT stream is
> not
> memory-based. (FreeType doesn't contain code to map fonts
> into memory
> on Windows, even if the API as such is almost as easy to
> use as mmap()
> &co.)
> Freetype, a bit dangerously, uses the FT_StreamRec::base
> field
> internally while reading stuff from the font file, setting
> it in
> FT_Stream_EnterFrame() and resetting it to NULL in
> FT_Stream_ExitFrame(). Before pango_ot_info_get() gets
> called,
> FT_Stream_EnterFrame() has been called but the
> corresponding call to
> FT_Stream_ExitFrame() doesn't seem to have happened yet.
> Whether this is a bug in FreeType, a Windows- or
> MinGW-specific
> problem, or whether Pango uses FreeType in some
> wrong/undefined way,
> no idea.
> So face->stream->base is non-NULL and Pango thinks it
> is a
> memory-based stream even if base points to some random
> buffer with
> just a part of the font file.
> A quick fix is to make the code in pango_ot_info_get()
> always use the
> "else" branch on Windows, and then indeed for instance in
> GIMP's text
> tool Arabic shaping works again, and hopefully also your
> Telugu
> problem is solved. At least the result looks different.
> I now notice that FreeType 2.3.12 has been released, but it
> doesn't
> seem to work any differently.
> --tml

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]