# eu-ai-label-iconfont


<img src="icons/LABEL_AI GENERATED_black.svg" width="200"/>

> [!NOTE]
> This code was generated with the assistance of a generative AI system (Qwen3.6 or other large language model).
> Please review and test it before using it in production.

AI Content Label Icons for desktop and web.

This repository provides a way of using the icons recommended by the EU for marking AI content by packaging them as an icon font.
It uses the icons published in the [EU AI content labelling icons collection](https://digital-strategy.ec.europa.eu/en/policies/eu-icons-labelling-ai-generated-content).
This project is an independent packaging effort and is **not related to, affiliated with, or endorsed by the European Union**.

## Installation

### Desktop (macOS, Windows, Linux)

**macOS:**
1. Double-click `fonts/eu-ai-label-iconfont.ttf`
2. Click "Install Font" in Font Book

**Windows:**
1. Right-click `fonts/eu-ai-label-iconfont.ttf`
2. Select "Install"

**Linux:**
```bash
cp fonts/eu-ai-label-iconfont.ttf ~/.local/share/fonts/
fc-cache -fv
```

### Web

#### NPM

Install the package:

```bash
npm install eu-ai-label-iconfont
```

Import the CSS in your project:

```javascript
import 'eu-ai-label-iconfont/dist/eu-ai-label-iconfont.css';
```

#### Manual

Copy `dist/` files to your web assets folder:

```bash
cp dist/eu-ai-label-iconfont.{ttf,woff2,css} your-project/assets/
```

## Usage

### Typing (Ligatures)

This font uses **OpenType ligatures** — type the text and the icon renders automatically:

| Type      | Renders as      |
|-----------|-----------------|
| `ai`      | AI icon         |
| `aim`     | AI Modified icon|
| `aig`     | AI Generated icon|

The mapping is **case-insensitive**: `AIM`, `AiM`, `AIG` all work.

**Works in:** Microsoft Word, Google Docs, LibreOffice, macOS TextEdit, and any app supporting OpenType fonts.

### Direct HTML/CSS

```html
<!-- Direct insertion -->
<span class="ai-icon" style="font-size: 48px; color: #0066cc;">&#xE001;</span>
<span class="ai-icon" style="font-size: 48px; color: #0066cc;">&#xE002;</span>
<span class="ai-icon" style="font-size: 48px; color: #0066cc;">&#xE003;</span>
```

### CSS Classes

```css
@font-face {
  font-family: 'eu-ai-label-iconfont';
  src: url('eu-ai-label-iconfont.ttf') format('truetype');
}

.ai-icon {
  font-family: 'eu-ai-label-iconfont';
  display: inline-block;
}

/* Optional utility classes */
.ai-icon--sm { font-size: 16px; }
.ai-icon--md { font-size: 24px; }
.ai-icon--lg { font-size: 32px; }
.ai-icon--xl { font-size: 48px; }

.ai-icon--black { color: #000000; }
.ai-icon--white { color: #ffffff; }
.ai-icon--blue { color: #0066CC; }
.ai-icon--red { color: #CC0000; }
```

### Python

```python
from fontTools.ttLib import TTFont

font = TTFont('eu-ai-label-iconfont.ttf')
cmap = font.getBestCmap()
# {0xE001: 'ai.general', 0xE002: 'ai.modified', 0xE003: 'ai.generated'}
```

## Character Reference

| Icon         | Unicode  | HTML Entity     | CSS Content       | Ligature |
|--------------|----------|-----------------|-------------------|----------|
| AI           | U+E001   | `&#xE001;`      | `"\\e001"`        | `ai`     |
| AI Modified  | U+E002   | `&#xE002;`      | `"\\e002"`        | `aim`    |
| AI Generated | U+E003   | `&#xE003;`      | `"\\e003"`        | `aig`    |

## Color & Size

The icons render in whatever color you set:

```css
/* Change color */
.ai-icon { color: #0066cc; }

/* Change size */
.ai-icon { font-size: 48px; }
```

## Files

```
eu-ai-label-iconfont/
├── fonts/
│   ├── eu-ai-label-iconfont.ttf          # Truetype font (desktop)
│   ├── eu-ai-label-iconfont.html          # Interactive demo
│   ├── eu-ai-label-iconfont.css           # CSS utility classes
│   └── build-font.py               # Build script (Python 3.12+)
└── icons/                           # SVG source files (EU AI Act icons)
    ├── LABEL_AI_black.svg
    ├── LABEL_AI MODIFIED_black.svg
    └── LABEL_AI GENERATED_black.svg
```

## Building

```bash
cd fonts/
pip3 install -r requirements.txt
python3 build-font.py
```

## License & Attribution

**Icons:** Designed by the [European Union](https://artificialintelligenceact.europa.eu/) under the EU Artificial Intelligence Act. The icon designs remain the property of the European Union and are released under the [EUPL (European Union Public License)](https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12).

**Repository:** This repository (build script, fonts, documentation) was entirely generated by AI. The code and font files may be used freely.

**Usage:** Anyone may use these font files for any purpose without permission, as the underlying icon designs are from the EU AI Act public consultation materials. The EU retains all rights to the original icon designs per the EUPL.

## Demo

Open `fonts/eu-ai-label-iconfont.html` in a browser for an interactive demo showing all icons at various sizes and colors.

## Transparency in Fonts

Standard desktop fonts (TTF/OTF) do **not** support transparency. The glyphs are solid shapes that render in whatever color you specify via `color` in CSS or the Color picker in desktop apps. This is why the SVG sources use `fill="currentColor"` (or are treated as solid shapes) — the color is always user-determined.

If you need transparent icons on the web, use the SVG files directly instead of the font.
