Alto Font reads font files and exposes their metadata, glyph metrics, outlines, and variable-font axes. It does not shape text, apply kerning, or draw glyphs.
<?php
use Alto\Font\Font;
$font = Font::fromFile(__DIR__.'/fonts/Inter-Regular.woff2');
$family = $font->metadata()->family;
$advanceWidth = $font->getMetrics('A')->advanceWidth;Introduction
- Installation: install the package and check its runtime requirements.
- Getting started: load a font and inspect one glyph.
Fonts
- Formats: understand supported containers, outlines, and optional WOFF2 requirements.
- Discovery: find the best matching font in directories or the operating system.
- Metadata: inspect names, descriptors, dimensions, and licensing fields.
- Glyphs: resolve characters to glyphs and read metrics and outlines.
- Variations: inspect axes and select a variable-font instance.
Alto Font reports facts stored in fonts. Text layout, fallback, bidirectional text, shaping, and rendering belong to higher-level packages.