Simon Cozens | 27 Nov 03:33 2014

Unsure how to use HB output to combine characters

I don't know if this is a HB question or a general font/PDF question,
but I am trying to shape some Tibetan text with combining characters and
I can't get it working.

When I try to shape the diglyph སྐ (TIBETAN LETTER SA U+0F66, TIBETAN
SUBJOINED LETTER KA U+0F90) in the Kokonor font I get back two glyph
values, 118 and 160:

1: (སྐ)
1: <U+0F66,U+0F90>
1: [118=0+1539|160=0+0]

The glyph_pos structures (using a scaled font via hb_ft_font_create) for
each glyph look like this:

{ x_advance = 375, y_advance = 0, x_offset = 0, y_offset = 0 }
{ x_advance = 0, y_advance = 0, x_offset = 0, y_offset = 0 }

That all seems fine, I think. (I'm confused why I should be advancing
after the first glyph and then not after the combining character, but I
don't think that's actually the problem here.)

Next I output that glyph string in my PDF document, where it looks like
"Td[<007600a0>]TJ". (I have been spending too much time reading PDF
documents in a text editor this week.)

What I see in my output is two separate glyphs next to each other, ས
(TIBETAN LETTER SA U+0F66) and ྐ (TIBETAN SUBJOINED LETTER KA U+0F90)
with the "hello I am a combining character" dotted circle around it.
Shouldn't the combination be its own glyph in the font? How do I say in
(Continue reading)

Travis CI | 21 Nov 00:06 2014

Passed: behdad/harfbuzz#434 (0.9.36 - c0e95ab)

behdad / harfbuzz (0.9.36)
Build #434 passed.
2 minutes and 41 seconds
Behdad Esfahbod c0e95ab Changeset →
  0.9.36
System message:

We just switched the default image for OS X jobs to our new image including Xcode 6.1. See our blog post for a full list of changes.

Would you like to test your private code?

Travis Pro could be your new best friend!

_______________________________________________
HarfBuzz mailing list
HarfBuzz <at> lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz
Behdad Esfahbod | 21 Nov 00:02 2014

harfbuzz: Changes to 'refs/tags/0.9.36'

Tag '0.9.36' created by Behdad Esfahbod <behdad <at> behdad.org> at 2014-11-20 22:42 -0800

0.9.36
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEABECAAYFAlRubloACgkQn+4E5dNTERUiYwCdFpw6UGKCcJb2cjQ6GUIZlkPP
ZysAnAxJVkR/uXVNIfDX4YB4JtgzdrnF
=IZJH
-----END PGP SIGNATURE-----

Changes since 0.9.35-52:
---
 0 files changed
---
_______________________________________________
HarfBuzz mailing list
HarfBuzz <at> lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz
Behdad Esfahbod | 21 Nov 00:02 2014

harfbuzz: Branch 'master'

 NEWS         |   12 ++++++++++++
 configure.ac |    2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit c0e95abc5f3f14121483b71f10837828a3a1d73a
Author: Behdad Esfahbod <behdad <at> behdad.org>
Date:   Thu Nov 20 14:42:24 2014 -0800

    0.9.36

diff --git a/NEWS b/NEWS
index adc8f69..21390c6 100644
--- a/NEWS
+++ b/NEWS
 <at>  <at>  -1,3 +1,15  <at>  <at> 
+Overview of changes leading to 0.9.36
+Thursday, November 20, 2014
+=====================================
+
+- First time that three months went by without a release since
+  0.9.2 was released on August 10, 2012!
+- Fix performance bug in hb_ot_collect_glyphs():
+  https://bugzilla.mozilla.org/show_bug.cgi?id=1090869
+- Add basic vertical-text support to hb-ot-font.
+- Misc build fixes.
+
+
 Overview of changes leading to 0.9.35
 Saturday, August 13, 2014
 =====================================
diff --git a/configure.ac b/configure.ac
index b9e82d9..d8b7a03 100644
--- a/configure.ac
+++ b/configure.ac
 <at>  <at>  -1,6 +1,6  <at>  <at> 
 AC_PREREQ([2.64])
 AC_INIT([HarfBuzz],
-        [0.9.35],
+        [0.9.36],
         [http://bugs.freedesktop.org/enter_bug.cgi?product=harfbuzz],
         [harfbuzz],
         [http://harfbuzz.org/])
_______________________________________________
HarfBuzz mailing list
HarfBuzz <at> lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz
James Clark | 12 Nov 02:46 2014

Re: Thai text render issue in Android L

กระฎุมพี is in the Royal Institute dictionary and is actually used (e.g. http://th.wikipedia.org/wiki/%E0%B8%8A%E0%B8%99%E0%B8%8A%E0%B8%B1%E0%B9%89%E0%B8%99%E0%B8%81%E0%B8%A3%E0%B8%B0%E0%B8%8E%E0%B8%B8%E0%B8%A1%E0%B8%9E%E0%B8%B5). So if a font doesn't handle SARA U and SARA UU (and PHINTHU) beneath consonants DO CHADA and TO PATAK, I would say that is a font bug.

James

On Tue, Nov 11, 2014 at 11:59 PM, Ed Trager <ed.trager-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hi,

To the best of my knowledge, it seems extremely unlikely that U+0E0E THAI CHARACTER DO CHADA would have U+0E39 THAI CHARACTER SARA UU ( or U+0E38 THAI CHARACTER SARA U for that matter ) appear below it.

I can't think of any Central Thai words that would have that kind of spelling; and it seems even more unlikely that any of the minority languages would use DO CHADA at all.

Therefore, it seems very likely that the font designers did not specify an anchoring position point for SARA U or SARA UU appearing below consonants such as DO CHADA or U+0E0F THAI CHARACTER TO PATAK.

- Ed


On Mon, Nov 10, 2014 at 10:16 PM, Nguyễn Đức An <annd1985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

Dear Harfbuzz developers,
We have an issue with Thai text render in Android L. When input U+0E0E and U+0E39, it displays wrong (please see the attach screen).
I checked Thai Noto font (Google font) and Samsung Thai (Samsung font), issue happens with both of them.
As i read the source of Harfbuzz, Thai reshaping only does separate SARA AM to NIKHAHIT & SARAA. So maybe the problem is not came from Harfbuzz.
Any help is welcome.
Thank you.


_______________________________________________
HarfBuzz mailing list
HarfBuzz <at> lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz



_______________________________________________
HarfBuzz mailing list
HarfBuzz-PD4FTy7X32lNgt0PjOBp9w@public.gmane.orgp.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz


_______________________________________________
HarfBuzz mailing list
HarfBuzz <at> lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz
Roozbeh Pournader | 11 Nov 20:00 2014
Picon

Re: Thai text render issue in Android L

With the latest HarfBuzz and Noto Sans Thai, I'm seeing the result I'm attaching, which appears correct to me (and the same as Android Kitkat result you've attached).

But I see the same as what you are seeing on Android Lollipop. So this appears to be a bug somewhere in Android rather than HarfBuzz or Noto Sans.

Please file a bug at https://source.android.com/source/report-bugs.html and send us a link to it. Thanks.

On Tue, Nov 11, 2014 at 8:59 AM, Ed Trager <ed.trager-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hi,

To the best of my knowledge, it seems extremely unlikely that U+0E0E THAI CHARACTER DO CHADA would have U+0E39 THAI CHARACTER SARA UU ( or U+0E38 THAI CHARACTER SARA U for that matter ) appear below it.

I can't think of any Central Thai words that would have that kind of spelling; and it seems even more unlikely that any of the minority languages would use DO CHADA at all.

Therefore, it seems very likely that the font designers did not specify an anchoring position point for SARA U or SARA UU appearing below consonants such as DO CHADA or U+0E0F THAI CHARACTER TO PATAK.

- Ed


On Mon, Nov 10, 2014 at 10:16 PM, Nguyễn Đức An <annd1985-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

Dear Harfbuzz developers,
We have an issue with Thai text render in Android L. When input U+0E0E and U+0E39, it displays wrong (please see the attach screen).
I checked Thai Noto font (Google font) and Samsung Thai (Samsung font), issue happens with both of them.
As i read the source of Harfbuzz, Thai reshaping only does separate SARA AM to NIKHAHIT & SARAA. So maybe the problem is not came from Harfbuzz.
Any help is welcome.
Thank you.


_______________________________________________
HarfBuzz mailing list
HarfBuzz <at> lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz



_______________________________________________
HarfBuzz mailing list
HarfBuzz-PD4FTy7X32lNgt0PjOBp9w@public.gmane.orgp.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz


_______________________________________________
HarfBuzz mailing list
HarfBuzz <at> lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz
Nguyễn Đức An | 11 Nov 04:16 2014
Picon

Thai text render issue in Android L

Dear Harfbuzz developers,
We have an issue with Thai text render in Android L. When input U+0E0E and U+0E39, it displays wrong (please see the attach screen).
I checked Thai Noto font (Google font) and Samsung Thai (Samsung font), issue happens with both of them.
As i read the source of Harfbuzz, Thai reshaping only does separate SARA AM to NIKHAHIT & SARAA. So maybe the problem is not came from Harfbuzz.
Any help is welcome.
Thank you.

_______________________________________________
HarfBuzz mailing list
HarfBuzz <at> lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz
Behdad Esfahbod | 10 Nov 00:36 2014

Slides from IUC

These are slides from the talk Roozbeh and I did at Internationalization &
Unicode Conference last week in Santa Clara, called: "Unicode, OpenType, and
Fonts: Closing the Circle".  The slides were not designed for reading, and
unfortunately IUC does not record talks :(.  We hope to do a recorded version
later this year.

  http://goo.gl/FSIQuC

Cheers,
--

-- 
behdad
http://behdad.org/
_______________________________________________
HarfBuzz mailing list
HarfBuzz <at> lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz
Konstantin Ritt | 4 Nov 08:18 2014
Picon

Re: HB-NG and Qt

The issue appears on Windows indeed. The problematic font was "Tahoma".
See more details at https://bugreports.qt-project.org/browse/QTBUG-41931 (not that many, though).
The proposed `fontEngine->doKerning(..)` is used either in the HB-old path in case the shaper item's `kerning_applied` flag appears to be unset after shaping, though there is no similar thing in HB-NG, so I don't think applying additional kerning blindly is a good solution in general.
All `doKerning()` method does is loads the kerning pairs from the font's ('k', 'e', 'r', 'n') table and applies kerning metrics. I believe it is quite the same HB does.
 
Regards,
Konstantin

2014-11-04 10:51 GMT+04:00 Behdad Esfahbod <behdad-muU0i0fqO+Mdnm+yROfE0A@public.gmane.org>:
Hi Konstantin?

Which font exactly?

The rule in HarfBuzz-ng is, if the font has *any* GPOS, then the old-style
kern table is not applied.  This is not exactly what OpenType recommends, but
is a cleaner approach than applying old-style kern if the GPOS table has no
'kern' feature.

At any rate, we need to see what font exactly this is happening with, and what
Uniscribe does.

IIRC, some fonts shipped with Windows XP or 7 could hit this problem, but
hardly any other font we know about.

Cheers,
behdad

PS.  If you write to the list, others can chime in.  Specifically, Jonathan
knows a lot about these as they highly care about Windows experience.

On 14-11-03 10:43 PM, Konstantin Ritt wrote:
> Hi Behdad,
>
>
> As you may know, we've switched to HB-NG as of Qt 5.4 alpha, which is a good
> news, of course.
> However we didn't drop the HB-old path and it is possible to switch to it,
> which is very handy for comparing the shaping/rendering results between HB-NG
> and HB-old, BTW.
>
> Now, here is a bug report https://bugreports.qt-project.org/browse/QTBUG-41931
> about kerning issue with some fonts.
> I was proposing a quick possible solution w/o expecting it to help... but it
> helped, so I'm in doubts:
>  ~2 years ago you answered that NG supports both old and new style kerning
> just fine (even better than HB-old) by enabling the kern feature, so my code
> currently is:
> {code}
> const hb_feature_t features[1] = {
>     { HB_TAG('k','e','r','n'), !!kerningEnabled, 0, uint(-1) }
> };
> const int num_features = 1;
> shapedOk = hb_shape_full(hb_font, buffer, features, num_features, 0);
> {code}
> but then, I don't understand why applying the old-style kerning manually on
> top of HB's results solves the raised issue. Am I missing something?
>
> Best regards,
> Konstantin

--
behdad
http://behdad.org/

_______________________________________________
HarfBuzz mailing list
HarfBuzz <at> lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz
ff.feng | 30 Oct 03:50 2014
Picon

How many unicode make up a glyph?

Hi !

I'm developing a font engine with harfbuzz & freetype for Cambodia.
I can get the correct glyph index array and position array by harfbuzz.
That's sweet.

Now I got a problem : I'm wondering how many unicode(UTF16) form a glyph?
(If I specify a item in the glyph index array from hb_buffer_get_glyph_infos)

thanks a lot & sorry for my poor English.


Best regards,

**********************************************************************

The preceding e-mail message (including any attachments) may contain confidential information intended for a specific individual and purpose.If you are not an intended recipient of this message, please notify the sender by replying to this message and then delete it from your system.Use,dissemination, distribution, or reproduction of this message by unintended recipients is not authorized and may be unlawful.

**********************************************************************

 

_______________________________________________
HarfBuzz mailing list
HarfBuzz <at> lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz
Behdad Esfahbod | 29 Oct 19:24 2014

harfbuzz: Branch 'master'

 src/hb-ot-layout-gsubgpos-private.hh |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

New commits:
commit fde3e4a423871463c883cb969e99c29cb6f69f6b
Author: Behdad Esfahbod <behdad <at> behdad.org>
Date:   Wed Oct 29 11:23:08 2014 -0700

    In hb_ot_collect_glyphs(), don't recurse to a lookup more than once

    Otherwise, we might process a lookup thousands of times, with no
    benefit.  This pathological case was hit by Noto Nastaliq Urdu Draft
    in Firefox's code to determine whether space glyph is involved in
    any GSUB/GPOS rules.  A test page is at http://behdad.org/urdu

    See:
    https://bugzilla.mozilla.org/show_bug.cgi?id=1090869

diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh
index 546ff4b..7106870 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos-private.hh
 <at>  <at>  -168,6 +168,10  <at>  <at>  struct hb_collect_glyphs_context_t
     if (output == hb_set_get_empty ())
       return HB_VOID;

+    /* Return if new lookup was recursed to before. */
+    if (recursed_lookups.has (lookup_index))
+      return HB_VOID;
+
     hb_set_t *old_before = before;
     hb_set_t *old_input  = input;
     hb_set_t *old_after  = after;
 <at>  <at>  -181,6 +185,8  <at>  <at>  struct hb_collect_glyphs_context_t
     input  = old_input;
     after  = old_after;

+    recursed_lookups.add (lookup_index);
+
     return HB_VOID;
   }

 <at>  <at>  -190,6 +196,7  <at>  <at>  struct hb_collect_glyphs_context_t
   hb_set_t *after;
   hb_set_t *output;
   recurse_func_t recurse_func;
+  hb_set_t recursed_lookups;
   unsigned int nesting_level_left;
   unsigned int debug_depth;

 <at>  <at>  -205,8 +212,16  <at>  <at>  struct hb_collect_glyphs_context_t
 			      after  (glyphs_after  ? glyphs_after  : hb_set_get_empty ()),
 			      output (glyphs_output ? glyphs_output : hb_set_get_empty ()),
 			      recurse_func (NULL),
+			      recursed_lookups (),
 			      nesting_level_left (nesting_level_left_),
-			      debug_depth (0) {}
+			      debug_depth (0)
+  {
+    recursed_lookups.init ();
+  }
+  ~hb_collect_glyphs_context_t (void)
+  {
+    recursed_lookups.fini ();
+  }

   void set_recurse_func (recurse_func_t func) { recurse_func = func; }
 };
_______________________________________________
HarfBuzz mailing list
HarfBuzz <at> lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/harfbuzz

Gmane