// // Copyright 2020 FoxyUtils ehf. All rights reserved. // // This is a commercial product and requires a license to operate. // A trial license can be obtained at https://unidoc.io // // DO NOT EDIT: generated by unitwist Go source code obfuscator. // // Use of this source code is governed by the UniDoc End User License Agreement // terms that can be accessed at https://unidoc.io/eula/ package textshaping ;import (_e "github.com/unidoc/garabic";_a "golang.org/x/text/unicode/bidi";_b "strings";); // ArabicShape returns shaped arabic glyphs string. func ArabicShape (text string )(string ,error ){_be :=_a .Paragraph {};_be .SetString (text );_f ,_g :=_be .Order ();if _g !=nil {return "",_g ;};for _fb :=0;_fb < _f .NumRuns ();_fb ++{_de :=_f .Run (_fb );_beb :=_de .String ();if _de .Direction ()==_a .RightToLeft {var (_c =_e .Shape (_beb ); _bebe =[]rune (_c );_bg =make ([]rune ,len (_bebe )););_ff :=0;for _ef :=len (_bebe )-1;_ef >=0;_ef --{_bg [_ff ]=_bebe [_ef ];_ff ++;};_beb =string (_bg );text =_b .Replace (text ,_b .TrimSpace (_de .String ()),_beb ,1);};};return text ,nil ;};