afaztech/glyphify 问题修复 & 功能扩展

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

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

afaztech/glyphify

Composer 安装命令:

composer require afaztech/glyphify

包简介

A PHP font generator supporting Persian and Latin scripts with 100+ unique font styles

README 文档

README

PHP font generator supporting Persian and Latin with 50+ unique font styles.

Overview

Glyphify is a comprehensive text styling library that transforms ordinary text into various Unicode-based font styles. It supports both Persian and Latin scripts, offering over 50 different font mappings including mathematical symbols, decorative styles, and specialized Persian fonts. Perfect for social media posts, creative writing, and any application requiring styled text.

Donate

Table of Contents

Features

  • Multi-script Support: Fully supports Persian (Arabic script) and Latin text
  • 50+ Font Styles: Includes bold, italic, circled, squared, fraktur, script, and more
  • Persian Specialization: Dedicated Persian fonts with proper character mapping and contextual forms
  • Smart Text Detection: Automatically detects Persian, English, or mixed text
  • Finglish Transliteration: Converts Persian text to Finglish (Persian in Latin script)
  • Flexible Output: Generate styled text as array, JSON, or CSV
  • Configurable Options: Control Persian, Latin, Finglish, and all-fonts modes
  • Lightweight: No external dependencies, pure PHP implementation

Requirements

  • PHP 7.4 or higher
  • JSON extension (enabled by default)
  • Multibyte string support (PHP's mbstring extension)

Installation

Install via Composer:

composer require afaztech/glyphify

Or clone the repository directly:

git clone https://github.com/AfazTech/glyphify.git
cd glyphify
composer install

Usage

Basic Usage

<?php

require_once __DIR__ . '/vendor/autoload.php';

use AfazTech\Glyphify\Glyphify;

// Create instance with your text
$glyphify = new Glyphify("Hello World");

// Generate all available fonts
$results = $glyphify->generate();

// Display styled text
$glyphify->display();

// Get specific font
$specific = $glyphify->generate('Bold');

Configuration Options

$config = [
    'persian' => true,     // Enable Persian font generation
    'latin' => true,       // Enable Latin font generation
    'finglish' => true,    // Enable Finglish transliteration
    'all_fonts' => false,  // Generate ALL fonts at once
];

$glyphify = new Glyphify("Your text here", $config);

Output Formats

// Get as array
$array = $glyphify->getArray();

// Get as JSON
$json = $glyphify->toJson();

// Get as CSV
$csv = $glyphify->toCsv();

// Display in CLI
$glyphify->display();

Methods

Method Description
generate(?string $fontName = null): array Generate styled text. If font name provided, returns only that font
getArray(): array Returns the last generated output array
toJson(?string $fontName = null): string Returns output as JSON
toCsv(?string $fontName = null): string Returns output as CSV
display(?string $fontName = null): void Displays output in CLI with formatting
getFontNames(): array Returns all available font names
getFontByName(string $name): ?array Returns specific font configuration
getAllFonts(): array Returns all font configurations
getLatinFontNames(): array Returns only Latin font names
getPersianFontNames(): array Returns only Persian font names
getPersianStyledFontNames(): array Returns only Persian styled font names

Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License. See the LICENSE file for more information.

Built with ❤️ by AfazTech

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固