Skip to content

Conversation

@Kumataro
Copy link
Contributor

@Kumataro Kumataro commented Oct 18, 2021

Fix #3078

freetype wrapper was calling harfbuzz library in the wrong sequence.
So incorrect guess which is text will be LTR(Left to Right)is happen.
This patch fix it. Correct calling sequence is *1.
This text will be drawn correctly with RTL(Right to Left).

However, it seems that harfbuzz alone is not able to support bidi. *2
So that freetype wrapper cannot draw text with a mixture of LTR and RTL.

And it is difficult for me to test many languages/fonts/texts.
I could only create a patch that wasn't effective enough. I'm sorry.

*1) https://harfbuzz.github.io/a-simple-shaping-example.html
*2) https://harfbuzz.github.io/what-harfbuzz-doesnt-do.html

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake
force_builders=Custom
build_image:Custom=ubuntu-gapi-freetype:16.04
buildworker:Custom=linux-1

Copy link
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ bug ] Emgu-CV-4.5.3 [ & OpenCV ] : Freetype2 class dont show correctly utf8 text

4 participants