golang/freetype

Right-to-Left Languages

dc0d opened this issue · 3 comments

dc0d commented

How can freetype be used with RTL languages?

It renders the letters only in their capital form and draw them left to right.

@dc0d any luck on implementing that?

dc0d commented

@MohsenElgendy Gave up on freetype and done the job using some imagemagic tricks.

You can use this approach:

rtl := goarabic.ToGlyph(text)
_, err = c.DrawString(goarabic.Reverse(text), pt)

the goarabic package does not fully support persian characters(گ چ پ ژ), you can use my fork till then: my fork of goarabic