Skip to content

Commit

Permalink
Merge pull request #12 from soheylfarzane/master
Browse files Browse the repository at this point in the history
به روز رسانی فایل فارسی نویسی
  • Loading branch information
mahmoud-eskandari authored Mar 30, 2024
2 parents 6d42f77 + 9ce254f commit 0eaeac2
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ Gd image example
imagettftext ( $image , $size , $angle , $x , $y ,$color , $fontfile , $text );
```
<p align="center"><a href="#">نمونه فارسی نویسی با فونت دانا<img src="./example-1.png" alt="Image"></a></p>
<p align="center"><a href="#">نمونه فارسی نویسی با فونت کلمه<img src="./example-2.png" alt="Image"></a></p>

Binary file added example-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 28 additions & 11 deletions lib/PersianRender.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ class PersianRender {
'إ' => ['', '', ''],
'ئ' => ['', '', ''],
'ة' => ['', '', ''],
'ء' => ['ء', '', '']
'ء' => ['ء', '', ''],
'ٌ' => ['ٌ', 'ٌ', 'ٌ'],
'ً' => ['', 'ً', ''],
'َ' => ['','' ,'َ'],
'ُ' => ['', '','ُ'],
'ِ' => ['', '','ِ'],
'ـ' => ['ـ','ـ','ـ']
];

private static $latinAlphabet = [
Expand Down Expand Up @@ -168,24 +174,35 @@ class PersianRender {
'' => '',
'0' => '۰',
'۰' => '۰',
'1' => '۱',
'٠' => '۰',
'1' => '1',
'۱' => '۱',
'2' => '۲',
'١' => '۱',
'2' => '2',
'۲' => '۲',
'3' => '۳',
'٢' => '۲',
'3' => '3',
'۳' => '۳',
'4' => '۴',
'٣' => '۳',
'4' => '4',
'۴' => '۴',
'5' => '۵',
'۴' => '۴',
'5' => '5',
'۵' => '۵',
'۵' => '۵',
'6' => '۶',
'6' => '6',
'۶' => '۶',
'۶' => '۶',
'7' => '۷',
'7' => '7',
'۷' => '۷',
'8' => '۸',
'٧' => '۷',
'8' => '8',
'۸' => '۸',
'9' => '۹',
'۹' => '۹'
'٨' => '۸',
'9' => '9',
'٩' => '۹',
'۹' => '۹',
'ـ' => 'ـ'
];

private static $numbers = [
Expand Down

0 comments on commit 0eaeac2

Please sign in to comment.