# Font Generators

Example generators for creating fonts programmatically in different styles.

## Generators

### Pixel Font Generator

Creates pixel-art style fonts from 2D grid definitions.

```javascript
const { generatePixelFont, generateSimplePixelFont } = require('./pixel-font-generator.js');

// Simple usage with predefined characters
const font = generateSimplePixelFont('MyPixelFont');

// Custom grids
const grids = {
  'A': [
    [0, 1, 1, 1, 0],
    [1, 0, 0, 0, 1],
    [1, 1, 1, 1, 1],
    // ...
  ]
};
const font = generatePixelFont('CustomPixel', grids, {
  cellSize: 50,
  unitsPerEm: 1000
});
```

### Geometric Font Generator

Creates fonts using simple geometric shapes (rectangles, circles, lines).

```javascript
const { generateGeometricFont } = require('./geometric-font-generator.js');

const font = generateGeometricFont('GeometricFont', {
  thickness: 50,
  unitsPerEm: 1000
}, ['A', 'B', 'C', '0', '1', '2']);
```

### Path Font Generator

Creates fonts from SVG path data.

```javascript
const { generatePathFont } = require('./path-font-generator.js');

const paths = {
  'A': 'M 100 0 L 500 0 L 300 700 Z',
  'B': 'M 100 0 L 100 700 L 400 700 Q 500 700 500 600 Z'
};

const font = generatePathFont('PathFont', paths);
```

### Algorithmic Font Generator

Creates fonts using algorithms (noise, fractals, procedural generation).

```javascript
const { generateAlgorithmicFont } = require('./algorithmic-font-generator.js');

// Noise-based organic shapes
const font = generateAlgorithmicFont('OrganicFont', {
  algorithm: 'noise',
  noiseScale: 0.1,
  noiseAmplitude: 20
});

// Fractal-based patterns
const font = generateAlgorithmicFont('FractalFont', {
  algorithm: 'fractal',
  iterations: 3
});
```

## Usage

All generators return a `FontDefinition` object that can be:
- Serialized to JSON
- Exported to TTF/WOFF using the export modules
- Used in the font preview tool

## Examples

See the `examples/` directory for complete examples using these generators.
