Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad y_offset from hb_buffer_get_glyph_positions (1.1.0 regression) #187

Closed
tasn opened this issue Nov 25, 2015 · 11 comments
Closed

Bad y_offset from hb_buffer_get_glyph_positions (1.1.0 regression) #187

tasn opened this issue Nov 25, 2015 · 11 comments

Comments

@tasn
Copy link

tasn commented Nov 25, 2015

Hey,

There seems to be a regression with Harfbuzz 1.1.0. After updating to 1.1.0 users of Terminology (an EFL based terminal emulator) have been experiencing weird character offsets. We've narrowed down the problem to the y_offset returned by hb_buffer_get_glyph_positions.
For example, for one glyph in the 6x13 bitmap font shipped with my system, I used to get 0 as the y_offset, and now I get -1056 (16px in my case).
There's more info in the original terminology ticket ( https://phab.enlightenment.org/T2865 ), but according to one account, the cause is 44f8275. I personally don't see how that one might be related, but it is.

This break leads to a completely unusable application.

Let me know if you need any other information.

Thanks,
Tom.

@dairt
Copy link

dairt commented Nov 25, 2015

Please check get_glyph_origin_for_direction in hb-font-private.hh

if (!get_glyph_h_origin (glyph, x, y) &&
    get_glyph_v_origin (glyph, x, y))
      {
        hb_position_t dx, dy;
        guess_v_origin_minus_h_origin (glyph, &dx, &dy);
        *x -= dx; *y -= dy;
      }

After 44f8275 the path goes through get_glyph_v_origin instead of the removed get_glyph_h_origin. For some reason the y (y_offset) value comes out wrong here.

Danny.

@behdad
Copy link
Member

behdad commented Nov 25, 2015

Oops. My bad. Will fix.

@tasn
Copy link
Author

tasn commented Nov 25, 2015

@behdad, thanks!
Please also do a bug fixing release. We have a lot of sad terminology users at the moment. :)

@dairt
Copy link

dairt commented Nov 25, 2015

Thanks =)

@behdad
Copy link
Member

behdad commented Nov 25, 2015

On it. I created a slight mess. Will have a fix by the time my flight lands on the other side.

@behdad
Copy link
Member

behdad commented Nov 26, 2015

I'm curious. In hb_shape, I have these lines:


    if (c->font->has_glyph_h_origin_func ())
      for (unsigned int i = 0; i < count; i++)
    c->font->add_glyph_h_origin (info[i].codepoint,
                     &pos[i].x_offset,
                     &pos[i].y_offset);

ie. if glyph_h_origin_func is NOT set, it doesn't do anything. I'm curious why you see a different behavior.

@behdad
Copy link
Member

behdad commented Nov 26, 2015

ie. if glyph_h_origin_func is NOT set, it doesn't do anything. I'm curious why you see a different behavior.

The downstream bug has the answer:

Still not sure, but textgrid differs from textblock in shaping. It passes EVAS_TEXT_PROPS_MODE_NONE, while textblock passes EVAS_TEXT_PROPS_MODE_SHAPE. One uses the "fallback" shaper, while the other uses the "ot" shaper.

@behdad behdad closed this as completed in c41c145 Nov 26, 2015
behdad added a commit that referenced this issue Nov 26, 2015
This was brorken earlier, though, it's really hard to notice it.
Unlike the glyph_h_origin(), an unset glyph_v_origin() does NOT
mean that the vertical origin is at 0,0.

Related to #187
@behdad
Copy link
Member

behdad commented Nov 27, 2015

Release coming.

@behdad
Copy link
Member

behdad commented Nov 27, 2015

Released 1.1.2.

@tasn
Copy link
Author

tasn commented Nov 27, 2015

Thanks man.
On 27 Nov 2015 00:39, "Behdad Esfahbod" notifications@github.com wrote:

Released 1.1.2.


Reply to this email directly or view it on GitHub
#187 (comment).

@gregkh
Copy link

gregkh commented Nov 27, 2015

Fixes the issue for me, many thanks for the quick response.

jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Dec 2, 2015
Overview of changes leading to 1.1.2
Wednesday, November 26, 2015
====================================

- Fix badly-broken fallback shaper that affected terminology.
  harfbuzz/harfbuzz#187
- Fix y_scaling in Graphite shaper.
- API changes:
  * An unset glyph_h_origin() function in font-funcs now (sensibly)
    implies horizontal origin at 0,0.  Ie, the nil callback returns
    true instead of false.  As such, implementations that have a
    glyph_h_origin() that simply returns true, can remove that function
    with HarfBuzz >= 1.1.2.  This results in a tiny speedup.
philb pushed a commit to openembedded/openembedded-core that referenced this issue Dec 8, 2015
  http://cgit.freedesktop.org/harfbuzz/tree/NEWS

Overview of changes leading to 1.1.2
Wednesday, November 26, 2015
====================================

- Fix badly-broken fallback shaper that affected terminology.
  harfbuzz/harfbuzz#187
- Fix y_scaling in Graphite shaper.
- API changes:
  * An unset glyph_h_origin() function in font-funcs now (sensibly)
    implies horizontal origin at 0,0.  Ie, the nil callback returns
    true instead of false.  As such, implementations that have a
    glyph_h_origin() that simply returns true, can remove that function
    with HarfBuzz >= 1.1.2.  This results in a tiny speedup.

Overview of changes leading to 1.1.1
Wednesday, November 24, 2015
====================================

- Build fixes, specially for hb-coretext.

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
daregit pushed a commit to daregit/yocto-combined that referenced this issue May 22, 2024
  http://cgit.freedesktop.org/harfbuzz/tree/NEWS

Overview of changes leading to 1.1.2
Wednesday, November 26, 2015
====================================

- Fix badly-broken fallback shaper that affected terminology.
  harfbuzz/harfbuzz#187
- Fix y_scaling in Graphite shaper.
- API changes:
  * An unset glyph_h_origin() function in font-funcs now (sensibly)
    implies horizontal origin at 0,0.  Ie, the nil callback returns
    true instead of false.  As such, implementations that have a
    glyph_h_origin() that simply returns true, can remove that function
    with HarfBuzz >= 1.1.2.  This results in a tiny speedup.

Overview of changes leading to 1.1.1
Wednesday, November 24, 2015
====================================

- Build fixes, specially for hb-coretext.

(From OE-Core rev: e979cc5816c806ac995365b9d96d34a1ea59342a)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants