# Font Compare Tool: Two Fonts Side by Side | FontsLike

Interactive font comparison tool to inspect letterforms side by side, stacked, or overlaid with outlines. Measures in-browser typography metrics via Canvas 2D TextMetrics and calculates full commercial licence diffs across 8 permission axes.

## Features & Comparison Modes
- **Side by Side:** Parallel comparison columns for Font A and Font B with identical text and font size.
- **Stacked Rows:** Aligned horizontal tracks to inspect vertical metrics, ascender heights, and cap-height consistency.
- **Overlay Outlines:** Font B outline drawn over Font A outline on an arcade checkerboard canvas in `--pink` and `--link` outlines, sharing identical baselines and sizing.
- **In-Browser Font Metrics:** Real-time extraction of x-height to cap-height ratio, average character width, ascender height, descender depth, and capital height ('H') using browser-native Canvas 2D TextMetrics.
- **Licence Permissions Diff:** Automatic diffing of rights across commercial work, logos, web @font-face, app/game embedding, font modification, sharing, selling, and attribution. Differing rows are highlighted.
- **Reference Font Licensing Guard:** Reference fonts (Arial, Calibri, Times New Roman, Helvetica, etc.) are strictly described only; files are never hosted, requested, or rendered in web pages.

## Machine URL Format & Parameters
AI agents and client applications can construct direct comparison URLs:
```
https://fontslike.com/compare/?a={slug_a}&b={slug_b}&t={sample_text}
```

### URL Query Parameters
- `a`: Slug of Font A (must be an open font from `/api/fonts.json`, default `roboto`).
- `b`: Slug of Font B (open font from `/api/fonts.json` or reference font from `/data/reference-fonts.json`, default `open-sans`).
- `t`: Custom sample preview text (string up to 300 characters, URL encoded).

## Machine API & Endpoints
- Web Tool: https://fontslike.com/compare/
- Page Markdown Twin: https://fontslike.com/compare.md
- Page JSON Twin: https://fontslike.com/api/pages/compare.json
- Font Directory Index: https://fontslike.com/api/fonts.json
- Search Index: https://fontslike.com/api/search-index.json
- Licences Data: https://fontslike.com/api/licences.json
