PHPackages                             maxsem/hiero - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. maxsem/hiero

ActiveLibrary[Image &amp; Media](/categories/media)

maxsem/hiero
============

Egyptian hieroglyphic text to SVG renderer

v0.2.1(2w ago)03MITPHPPHP &gt;=8.3CI passing

Since Jul 10Pushed 1w agoCompare

[ Source](https://github.com/MaxSem/hiero)[ Packagist](https://packagist.org/packages/maxsem/hiero)[ RSS](/packages/maxsem-hiero/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (11)Versions (4)Used By (0)

Egyptian Hieroglyphics to SVG renderer in pure PHP
==================================================

[](#egyptian-hieroglyphics-to-svg-renderer-in-pure-php)

It renders [Manuel de Codage](https://www.catchpenny.org/codage/) markup with [Gardiner Codes](https://www.unicode.org/L2/L2005/05313-Gardiner28-57.pdf).

[![Example output](doc/example.svg)](doc/example.svg)

Installation
============

[](#installation)

```
composer install maxsem/hiero

```

Fonts
=====

[](#fonts)

To render something, you need a font, which for this package is a set of SVG files along with some metadata. You can make one out of a TTF font:

```
bin/build-font.php path/to/font.ttf destination/dir

```

You'll need Python and FontForge module for it to export SVGs from fonts.

Usage
=====

[](#usage)

```
// All these parameters are optional
$options = new Options(
    throwOnErrors: true,       // See #Error handling
    logErrorBacktraces: false, // See #Error handling
    maxTokens: 1000,           // Maximum number of tokens to parse/render or null for no limit. MaxTokensException will be thrown if exceeded. Protects against resource exhaustion.
    color: 'black',            // Hieroglyph color: valid CSS color or null to not set and default to black.
    background: 'white',       // Background: CSS color or null for transparent.

    // Content of the rendered SVG's  tag or null to not set. Will be overridden by the options above.
    style: '.cartouche { color: red }' // color the cartouche red
);

$font = Font::fromPath('path/to/font');
// Or
$font = Font::fromComposerPackage('package/name');

$mdc = new ManuelDeCodage($options, $font);

$renderOutput = $mdc->parseAndRender('< D10:G16-A46\-C2-L1 >');

file_put_contents('result.svg', $renderOuptut->svg);
```

Error handling
==============

[](#error-handling)

All errors specific to the package are `instanceof HieroException`. For problems related to user input, both parsing and rendering stages can be configured to either throw exceptions or return a list of `Error` objects. If configuerd to throw exceptions, descendants of `LocalizableException` will be thrown. All these errors contain an error code and an optional list of parameters that can be fed into an external localization framework. See the `ErrorCodes` class for possible codes.

Development
===========

[](#development)

- If it isn't tested, it doesn't work.
- Prefer immutable data classes with readonly properties to getters and setters.
- Run all the tests with `make`.
- Minimum supported PHP version is [the one used by Wikimedia wikis](https://en.wikipedia.org/wiki/Special:Version).

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance97

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~15 days

Total

3

Last Release

17d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/077617b74b3b4f887a24df9aec02f54d0964e872ae4a5520f841a7086aeb7031?d=identicon)[MaxSem](/maintainers/MaxSem)

---

Top Contributors

[![MaxSem](https://avatars.githubusercontent.com/u/1260606?v=4)](https://github.com/MaxSem "MaxSem (64 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/maxsem-hiero/health.svg)

```
[![Health](https://phpackages.com/badges/maxsem-hiero/health.svg)](https://phpackages.com/packages/maxsem-hiero)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.9k556.2M21.6k](/packages/laravel-framework)[symfony/symfony

The Symfony PHP framework

31.4k87.4M2.2k](/packages/symfony-symfony)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k257.3M12.5k](/packages/symfony-framework-bundle)[illuminate/database

The Illuminate Database package.

2.8k55.8M13.4k](/packages/illuminate-database)[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.2B15.3k](/packages/symfony-console)[symfony/error-handler

Provides tools to manage errors and ease debugging PHP code

2.7k714.7M958](/packages/symfony-error-handler)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
