2022-07-13 21:28:43 +00:00
|
|
|
//
|
|
|
|
// 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/
|
|
|
|
|
2024-05-29 17:04:37 +00:00
|
|
|
package textshaping ;import (_b "github.com/unidoc/garabic";_e "golang.org/x/text/unicode/bidi";_df "strings";);
|
2022-07-13 21:28:43 +00:00
|
|
|
|
|
|
|
// ArabicShape returns shaped arabic glyphs string.
|
2024-05-29 17:04:37 +00:00
|
|
|
func ArabicShape (text string )(string ,error ){_c :=_e .Paragraph {};_c .SetString (text );_ee ,_ea :=_c .Order ();if _ea !=nil {return "",_ea ;};for _g :=0;_g < _ee .NumRuns ();_g ++{_f :=_ee .Run (_g );_cd :=_f .String ();if _f .Direction ()==_e .RightToLeft {var (_db =_b .Shape (_cd );
|
|
|
|
_fa =[]rune (_db );_cc =make ([]rune ,len (_fa )););_bd :=0;for _bc :=len (_fa )-1;_bc >=0;_bc --{_cc [_bd ]=_fa [_bc ];_bd ++;};_cd =string (_cc );text =_df .Replace (text ,_df .TrimSpace (_f .String ()),_cd ,1);};};return text ,nil ;};
|