tecnickcom / tc-lib-unicode-data
PHP library containing Unicode definitions
Fund package maintenance!
Requires
- php: ^8.2
Requires (Dev)
- carthage-software/mago: 1.47.6
- pdepend/pdepend: ^2.16
- phpunit/phpunit: ^11.5 || ^12.5 || ^13.3
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.7.1
- 2.7.0
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.0
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.53
- 2.0.52
- 2.0.51
- 2.0.49
- 2.0.48
- 2.0.46
- 2.0.45
- 2.0.44
- 2.0.42
- 2.0.41
- 2.0.40
- 2.0.39
- 2.0.38
- 2.0.37
- 2.0.36
- 2.0.35
- 2.0.34
- 2.0.33
- 2.0.31
- 2.0.30
- 2.0.29
- 2.0.28
- 2.0.27
- 2.0.26
- 2.0.24
- 2.0.23
- 2.0.22
- 2.0.21
- 2.0.20
- 2.0.19
- 2.0.18
- 2.0.17
- 2.0.16
- 2.0.15
- 2.0.14
- 2.0.13
- 2.0.12
- 2.0.11
- 2.0.10
- 2.0.8
- 2.0.7
- 2.0.6
- 1.7.33
- 1.7.32
- 1.7.31
- 1.7.29
- 1.7.28
- 1.7.27
- 1.7.26
- 1.7.25
- 1.7.23
- 1.7.22
- 1.7.21
- 1.7.20
- 1.7.19
- 1.7.18
- 1.7.17
- 1.7.16
- 1.7.15
- 1.7.14
- 1.7.13
- 1.7.12
- 1.7.11
- 1.7.10
- 1.7.9
- 1.7.8
- 1.7.7
- 1.7.6
- 1.7.5
- 1.7.4
- 1.7.3
- 1.7.0
- 1.6.11
- 1.6.10
- 1.6.9
- 1.6.8
- 1.6.7
- 1.6.6
- 1.6.5
- 1.6.4
- 1.6.3
- 1.6.2
- 1.6.0
- 1.5.1
- 1.5.0
- 1.4.23
- 1.4.22
- 1.4.21
- 1.4.20
- 1.4.19
- 1.4.18
- 1.4.17
- 1.4.16
- 1.4.15
- 1.4.14
- 1.4.13
- 1.4.12
- 1.4.11
- 1.4.10
- 1.4.9
- 1.4.8
- 1.4.7
- 1.4.6
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.0
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.4
- 1.1.3
- 1.1.1
- 1.1.0
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2026-09-05 07:33:35 UTC
README
Unicode data tables, mappings and constants for PHP text processing.
💖 Part of the tc-lib-pdf / TCPDF ecosystem (100M+ installs). Sponsor its maintenance →
Overview
tc-lib-unicode-data provides the Unicode lookup tables, mappings and constants used by tc-lib-unicode and related libraries.
| Namespace | \Com\Tecnick\Unicode\Data |
| Author | Nicola Asuni info@tecnick.com |
| License | GNU LGPL v3 - see LICENSE |
| API docs | https://tcpdf.org/docs/srcdoc/tc-lib-unicode-data |
| Packagist | https://packagist.org/packages/tecnickcom/tc-lib-unicode-data |
Features
Classes
| Class | Content |
|---|---|
Type |
Bidi_Class of every code point, with getType() and getBidiClass() |
BidiClass |
Backed enum of the strong, weak and neutral bidirectional classes |
Constant |
Code points of the bidirectional formatting characters and of some common separators |
Pattern |
Regular expressions matching right-to-left and Arabic text |
Mirror |
Mirrored form of the characters mirrored in a right-to-left context |
Bracket |
Paired brackets, by opening and by closing code point |
Arabic |
Joining types, presentation forms and ligatures, with getJoiningType() |
Encoding |
Character code to glyph name maps of 22 font encodings |
Latin |
Unicode to Latin1 character substitutions |
Identity |
CMap stream for the Identity-H encoding |
Requirements
- PHP 8.2 or later
- Composer
Installation
composer require tecnickcom/tc-lib-unicode-data
Quick Start
<?php require_once __DIR__ . '/vendor/autoload.php'; echo \Com\Tecnick\Unicode\Data\Type::getType(0x05D0); // R echo \Com\Tecnick\Unicode\Data\Arabic::getJoiningType(0x0628); // D echo \Com\Tecnick\Unicode\Data\Encoding::MAP['cp1252'][128]; // Euro
Type::getBidiClass() returns the same class as a BidiClass enum case, and null for the explicit formatting codes (LRE, LRO, RLE, RLO, PDF, LRI, RLI, FSI, PDI).
Generated data
Type, Pattern, Mirror, Bracket and Arabic are generated from the Unicode Character Database by tools/generate.php; Type::UNICODE_VERSION reports the version they derive from.
| Class | UCD source |
|---|---|
Type |
extracted/DerivedBidiClass.txt |
Pattern |
extracted/DerivedBidiClass.txt |
Mirror |
BidiMirroring.txt |
Bracket |
BidiBrackets.txt |
Arabic |
ArabicShaping.txt, UnicodeData.txt |
Type::UNI only lists the code points whose Bidi_Class is not L; Type::getType() resolves any code point, including the blocks whose unassigned code points default to R, AL or ET.
To rebuild the tables from a UCD release:
make gendata UCDVERSION=17.0.0 make qa
Development
make deps
make help
make qa
Packaging
make rpm make deb
For system packages, bootstrap with:
require_once '/usr/share/php/Com/Tecnick/Unicode/Data/autoload.php';
Contributing
Contributions are welcome. Please review CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SECURITY.md.