syllable/shaping 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

syllable/shaping

Composer 安装命令:

composer require syllable/shaping

包简介

Syllable Font Shaping Library for Arabic/Persian Texts

README 文档

README

Syllable Font Shaping Library is an implementation of font shaping algorithm for Arabic/Persian texts. It replaces Unicode code-points in a text with their presentation forms in correct order, to leverage font rendering libraries, such as FreeType—and also PHP extensions which use FreeType, e.g. GD—to render Arabic/Persian texts correctly.

Pleas keep in mind that this library does not change the words order, since it may depend on the placements of the line-breaks, which this library does not understand. So, you would need to handle the words order later.

Note. This is still a work in progress and due for breaking changes, and may or may not be ready to be used in production.

Quick Start

This is a simple example for using the Shaper class:

use Syllable\Shaping\Shaper;

$shaper = new Shaper();
$shapedText = $shaper->shape('نموذج', Shaper::RTL);

The second parameter of the shape method is optional and specifies the direction of the flow of the text. It helps the shaping algorithm to place punctuations and enclosing marks in the correct shape and order if the given text is within a larger context. If you do not determine the direction, it will make a guess based on the given text.

License

Syllable Font Shaping Library is made public under the MIT license.

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固