# ttf2eot

Convert TrueType and OpenType (SFNT) fonts into the legacy Internet Explorer
EOT format.

The crate reads the `OS/2`, `head`, and `name` tables, builds an 82-byte EOT
header, appends the four name strings as UTF-16LE, then appends the input font
verbatim. It does no compression and no glyph processing.

## Installation

```toml
[dependencies]
ttf2eot = "0.1"
```

## Usage

```rust
let ttf = std::fs::read("font.ttf").unwrap();
let eot = ttf2eot::ttf2eot(&ttf).expect("valid SFNT font");
std::fs::write("font.eot", eot).unwrap();
```

`ttf2eot` returns an error when the `OS/2`, `head`, or `name` table is missing,
or when the input is too short to read a structure it needs. The input is read
only and never modified.

## Notes

EOT output is little-endian. SFNT input is big-endian. The function swaps each
name code unit from big-endian to little-endian and copies the font payload byte
for byte. Internet Explorer requires the full name to begin with the family
name. This crate does not enforce that constraint.

## License

Licensed under the [MIT license](LICENSE).
