aboutsummaryrefslogtreecommitdiff
path: root/unipdf/textshaping
diff options
context:
space:
mode:
authorleshe4ka46 <alex9102naid1@ya.ru>2025-10-19 14:47:59 +0300
committerleshe4ka46 <alex9102naid1@ya.ru>2025-10-19 14:47:59 +0300
commite17a425dfb3382310fb5863f516dacdca9f44956 (patch)
tree7babb3048d0eb20aa1e68e9b29c2acfa794ab96f /unipdf/textshaping
parent091963a50c3bb2926f559f01c49e8f5bd03d2bfd (diff)
fuck the unipdf licencing
Diffstat (limited to 'unipdf/textshaping')
-rw-r--r--unipdf/textshaping/textshaping.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/unipdf/textshaping/textshaping.go b/unipdf/textshaping/textshaping.go
new file mode 100644
index 0000000..23f80d0
--- /dev/null
+++ b/unipdf/textshaping/textshaping.go
@@ -0,0 +1,16 @@
+//
+// 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 (_a "github.com/unidoc/garabic";_ba "golang.org/x/text/unicode/bidi";_f "strings";);
+
+// ArabicShape returns shaped arabic glyphs string.
+func ArabicShape (text string )(string ,error ){_d :=_ba .Paragraph {};_d .SetString (text );_ag ,_c :=_d .Order ();if _c !=nil {return "",_c ;};for _e :=0;_e < _ag .NumRuns ();_e ++{_bac :=_ag .Run (_e );_fb :=_bac .String ();if _bac .Direction ()==_ba .RightToLeft {var (_ec =_a .Shape (_fb );
+_g =[]rune (_ec );_ff =make ([]rune ,len (_g )););_gd :=0;for _gf :=len (_g )-1;_gf >=0;_gf --{_ff [_gd ]=_g [_gf ];_gd ++;};_fb =string (_ff );text =_f .Replace (text ,_f .TrimSpace (_bac .String ()),_fb ,1);};};return text ,nil ;}; \ No newline at end of file