Metadata-Version: 2.4
Name: egyptian-mdc
Version: 0.1.4
Summary: A Python standalone Manuel de Codage (MdC) rendering engine for Egyptian hieroglyphs
Author-email: Inga Krazhan <ingakrazhan1@gmail.com>
License: LGPL
Keywords: egyptian,hieroglyphs,manuel-de-codage,mdc,jsesh
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: Text Processing :: Fonts
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Pillow>=9.0.0
Requires-Dist: resvg-py>=0.1.0
Dynamic: license-file

# egyptian-mdc

Python library for rendering Egyptian hieroglyphs using Manuel de Codage (MdC) notation. Built with JSesh-compatible SVG glyphs.

## Installation

```bash
pip install egyptian-mdc
```


## Quick Start
```python
from egyptian_mdc import render_mdc_to_image

# Render a single sign
img = render_mdc_to_image("G1")
img.save("sign.png")

# Render a text with vertical and horizontal composition
img = render_mdc_to_image("N35:X1*X1")
img.save("composition.png")

# Multi-line text with line breaks
img = render_mdc_to_image("G1-O1:Z2!A2-D21:N35")
img.save("multiline.png")
```

## Features
✅ Full support for Manuel de Codage (MdC) notation

✅ Vertical composition (:) with adaptive spacing

✅ Horizontal composition (*) with lower edge alignment

✅ Multi-line texts with ! separator

✅ Cartouches (< >)

✅ Automatic sign classification (LARGE/WIDE/TALL/SMALL)

✅ Custom sign classification via manual_overrides.json

✅ Uses JSesh-compatible SVG glyphs


## Sign Classes

The library classifies hieroglyphs into four groups:
- **LARGE** — full quadrat size signs (e.g., G1, A1)
- **WIDE** — broad signs that fill width (e.g., D21, N35)
- **TALL** — narrow signs centered in quadrat (e.g., M17)
- **SMALL** — small signs (e.g., X1, Z1)

## Advanced Usage

### Custom sign classification

Create `manual_overrides.json` in the package directory:

```json
{
    "X7": "TALL",
    "W122": "LARGE",
    "Z1": "SMALL"
}
```

### Adjusting font size

```python
img = render_mdc_to_image("G1", font_size=200)
```

### Limitations

- Ligatures (`&`) are not yet supported
- Complex modifiers (rotation, scaling) are not yet implemented


### Credits

- SVG glyphs from [JSesh](https://github.com/rosmord/jsesh) by Serge Rosmorduc
- Python implementation by Inga Krazhan

### License
This project is licensed under the LGPL License.

