# Custom fonts for `/text-on-photo`

This folder is the font library for the **Put Text on Photos** tool.

- Folder on disk: `public/fonts/text-on-photo/`
- Public URL: `/fonts/text-on-photo/`
- Font list loaded by the tool: `/fonts/text-on-photo/fonts.json`

Everything is loaded in the visitor's browser. Font files are served as static
assets and are never uploaded or processed by a server.

## How to add a font

1. Copy your font file into this folder, for example `BebasNeue-Regular.woff2`.
   Supported formats: `.ttf`, `.otf`, `.woff`, `.woff2`.
   **Prefer `.woff2`**: it is roughly 3x smaller than the same font as `.ttf`
   (Galaxie Copernicus: 74.8 KB vs 241.8 KB), which keeps the tool light for
   visitors. Convert with any TTF/OTF to WOFF2 converter before uploading.
2. Open `fonts.json` and add one object to the `fonts` array:

```json
{
  "label": "Bebas Neue",
  "family": "Bebas Neue",
  "file": "/fonts/text-on-photo/BebasNeue-Regular.woff2",
  "weight": "400",
  "style": "normal"
}
```

3. Save the file, then restart the dev server (or redeploy) so the new asset and
   manifest are picked up.

The font appears at the top of the **FONT** tab inside the tool.

## Field reference

| Field    | Required | Description                                                                 |
| :------- | :------: | :-------------------------------------------------------------------------- |
| `label`  | no       | Text shown on the font button. Defaults to `family`.                        |
| `family` | yes      | CSS font-family name used to register the face. Do not include fallbacks.   |
| `file`   | yes      | URL path of the font file, starting with `/fonts/text-on-photo/`.            |
| `weight` | no       | CSS weight served by this file: `400`, `700`, `900`, or a range like `100 900`. |
| `style`  | no       | `normal` (default) or `italic`.                                             |

### Example: separate bold file

```json
{ "label": "Inter", "family": "Inter", "file": "/fonts/text-on-photo/Inter-Regular.woff2", "weight": "400" },
{ "label": "Inter Bold", "family": "Inter", "file": "/fonts/text-on-photo/Inter-Bold.woff2", "weight": "700" }
```

When two entries share the same `family`, the browser picks the matching
`weight` automatically. Both entries will still appear as separate buttons in
the font list, so you can label them clearly.

### Example: variable font

```json
{ "label": "Manrope", "family": "Manrope", "file": "/fonts/text-on-photo/Manrope.woff2", "weight": "200 800" }
```

## Notes

- Keep file names free of spaces; use dashes instead.
- Only registries listed in `fonts.json` are loaded. An invalid entry is skipped
  and logged in the browser console, the rest of the list keeps working.
- System fonts (Arial, Impact, Georgia, Courier New, and others) are always
  available and do not need to be listed here.
