PHP Myanmar Font

v1.0.0 2023-01-20 17:44 UTC

README

Run tests Packagist Downloads

Font

PHP Myanmar Font for Laravel Myanmar Tools

Installation

composer require laravel-myanmar-tools/font

Usage

Check Unicode Font

use LaravelMyanmarTools\Font\Font;

$font = new Font;
$font->isUnicodeFont('မြန်မာပြည်'); // return true

Check Zawgyi Font

use LaravelMyanmarTools\Font\Font;

$font = new Font;
$font->isZawgyiFont('ျမန္မာျပည္'); // return true

Detect Myanmar Font

use LaravelMyanmarTools\Font\Font;

$font = new Font;
$font->detectMyanmarFont('မြန်မာပြည်'); // return "unicode"
$font->detectMyanmarFont('ျမန္မာျပည္'); // return "zawgyi"

Zawgyi To Unicode

use LaravelMyanmarTools\Font\Font;

$font = new Font;
$font->zgToUni('ျမန္မာျပည္'); // return "မြန်မာပြည်"

Unicode To Zawgyi

use LaravelMyanmarTools\Font\Font;

$font = new Font;
$font->zgToUni('မြန်မာပြည်'); // return "ျမန္မာျပည္"

Customize

use LaravelMyanmarTools\Font\Font;

$font = new Font;

$font::macro('isNumber', function(string $str) {
   return is_numeric($str);
});

$font->isNumber('12345'); // return true

Testing

composer test

Credit