|
| 1 | +# Emoji Pack Generator |
| 2 | + |
| 3 | +A flexible, configuration-driven system for generating emoji resource packs from various sources. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- **JSON Configuration**: Define emoji pack sources, structure, and output formats via JSON |
| 8 | +- **Multiple Source Support**: Currently supports GitHub repositories |
| 9 | +- **Flexible Input Structure**: Support for wildcard patterns in folder structures |
| 10 | +- **Multiple Output Formats**: Currently supports Minecraft resource packs |
| 11 | +- **Skin Tone & Style Support**: Generate packs for different styles and skin tones |
| 12 | +- **Backward Compatibility**: Legacy FluentUI script still works |
| 13 | + |
| 14 | +## Quick Start |
| 15 | + |
| 16 | +### Using the New Configuration System |
| 17 | + |
| 18 | +1. **Generate a pack using an existing configuration:** |
| 19 | + ```bash |
| 20 | + python emoji_pack_generator.py --config configs/fluentui-3d-only.json --download |
| 21 | + ``` |
| 22 | + |
| 23 | +2. **Generate for specific style/skin tone:** |
| 24 | + ```bash |
| 25 | + python emoji_pack_generator.py --config configs/fluentui-3d-only.json --style 3D --skin-tone Dark --download |
| 26 | + ``` |
| 27 | + |
| 28 | +3. **Use existing downloaded files:** |
| 29 | + ```bash |
| 30 | + python emoji_pack_generator.py --config configs/fluentui-3d-only.json --extract-to ./cache/assets/ |
| 31 | + ``` |
| 32 | + |
| 33 | +### Using the Legacy System |
| 34 | + |
| 35 | +The original fluentui-emoji.py still works for backward compatibility: |
| 36 | + |
| 37 | +```bash |
| 38 | +# Legacy mode (deprecated) |
| 39 | +python fluentui-emoji.py --download --style 3D --skin-tone Default |
| 40 | + |
| 41 | +# Legacy mode with new configuration |
| 42 | +python fluentui-emoji.py --config configs/fluentui-3d-only.json --style 3D --skin-tone Default |
| 43 | +``` |
| 44 | + |
| 45 | +## Configuration |
| 46 | + |
| 47 | +### Example Configuration Files |
| 48 | + |
| 49 | +- `configs/fluentui-3d-only.json` - FluentUI emojis, 3D style only |
| 50 | +- `configs/fluentui-emoji.json` - FluentUI emojis, all styles (includes SVG) |
| 51 | +- `configs/twemoji-example.json` - Example Twemoji configuration |
| 52 | + |
| 53 | +### Configuration Schema |
| 54 | + |
| 55 | +See [CONFIG_SCHEMA.md](CONFIG_SCHEMA.md) for detailed documentation of the JSON schema. |
| 56 | + |
| 57 | +### Basic Configuration Structure |
| 58 | + |
| 59 | +```json |
| 60 | +{ |
| 61 | + "name": "Pack Name", |
| 62 | + "source": { |
| 63 | + "type": "github", |
| 64 | + "repository": "owner/repo-name", |
| 65 | + "branch": "main", |
| 66 | + "folder": "assets" |
| 67 | + }, |
| 68 | + "input_structure": { |
| 69 | + "metadata_file": "metadata.json", |
| 70 | + "image_folders": ["{style}", "{skin_tone}/{style}"], |
| 71 | + "image_extensions": ["png"], |
| 72 | + "styles": ["3D", "Color", "Flat"], |
| 73 | + "skin_tones": ["Default", "Dark", "Light"] |
| 74 | + }, |
| 75 | + "output": { |
| 76 | + "type": "minecraft_resource_pack", |
| 77 | + "pack_format": 15, |
| 78 | + "description_template": "{name} {style}-{skin_tone} Pack", |
| 79 | + "output_directory": "./packs/{name}-{style}-{skin_tone}" |
| 80 | + }, |
| 81 | + "file_processing": { |
| 82 | + "filename_from_metadata": "unicode", |
| 83 | + "character_from_metadata": "glyph" |
| 84 | + }, |
| 85 | + "font_config": { |
| 86 | + "provider_type": "bitmap", |
| 87 | + "height": 7, |
| 88 | + "ascent": 7 |
| 89 | + } |
| 90 | +} |
| 91 | +``` |
| 92 | + |
| 93 | +## Command Line Options |
| 94 | + |
| 95 | +### emoji_pack_generator.py |
| 96 | + |
| 97 | +``` |
| 98 | +--config CONFIG Path to JSON configuration file (required) |
| 99 | +--extract-to DIR Extraction directory (default: ./cache/assets/) |
| 100 | +--style STYLE Emoji style (overrides config) |
| 101 | +--skin-tone TONE Skin tone (overrides config) |
| 102 | +--download Force download of assets |
| 103 | +--commit HASH Specific commit hash to download |
| 104 | +``` |
| 105 | + |
| 106 | +### fluentui-emoji.py (Legacy) |
| 107 | + |
| 108 | +``` |
| 109 | +--repo-url URL GitHub repository URL |
| 110 | +--folder-name NAME Folder name in repository |
| 111 | +--extract-to DIR Extraction directory |
| 112 | +--skin-tone TONE Skin tone |
| 113 | +--style STYLE Emoji style |
| 114 | +--download Force download of assets |
| 115 | +--config CONFIG Use JSON configuration (recommended) |
| 116 | +``` |
| 117 | + |
| 118 | +## Creating Custom Configurations |
| 119 | + |
| 120 | +1. **Create a new JSON configuration file** based on the schema |
| 121 | +2. **Define your source repository** and folder structure |
| 122 | +3. **Configure input patterns** with wildcard support |
| 123 | +4. **Set up output format** and naming conventions |
| 124 | +5. **Test with a small subset** before full generation |
| 125 | + |
| 126 | +### Wildcard Support |
| 127 | + |
| 128 | +The system supports these wildcards in folder patterns: |
| 129 | +- `{style}` - Matches any style from the configuration |
| 130 | +- `{skin_tone}` - Matches any skin tone from the configuration |
| 131 | + |
| 132 | +Example: `["{style}", "{skin_tone}/{style}"]` will match both: |
| 133 | +- `3D/` and `Default/3D/` |
| 134 | +- `Color/` and `Dark/Color/` |
| 135 | + |
| 136 | +## File Structure |
| 137 | + |
| 138 | +``` |
| 139 | +emoji_pack/ |
| 140 | +├── emoji_pack_generator.py # New configuration-based generator |
| 141 | +├── fluentui-emoji.py # Legacy script with backward compatibility |
| 142 | +├── configs/ # Configuration files |
| 143 | +│ ├── fluentui-3d-only.json # FluentUI 3D only (recommended) |
| 144 | +│ ├── fluentui-emoji.json # FluentUI all styles |
| 145 | +│ └── twemoji-example.json # Example Twemoji config |
| 146 | +├── CONFIG_SCHEMA.md # Configuration schema documentation |
| 147 | +├── cache/ # Downloaded assets cache |
| 148 | +└── packs/ # Generated resource packs |
| 149 | +``` |
| 150 | + |
| 151 | +## Supported Input Formats |
| 152 | + |
| 153 | +- **PNG images** - Ready for Minecraft resource packs |
| 154 | +- **SVG images** - Requires conversion to PNG (not implemented yet) |
| 155 | +- **Metadata JSON** - For emoji information and mapping |
| 156 | + |
| 157 | +## Supported Output Formats |
| 158 | + |
| 159 | +- **Minecraft Resource Pack** - Complete pack with textures and font JSON |
| 160 | + |
| 161 | +## Known Limitations |
| 162 | + |
| 163 | +1. **SVG Support**: SVG files are detected but not converted to PNG automatically |
| 164 | +2. **Single Source Type**: Only GitHub repositories supported currently |
| 165 | +3. **Minecraft Format Only**: Only Minecraft resource pack output implemented |
| 166 | + |
| 167 | +## Contributing |
| 168 | + |
| 169 | +To add support for new source types or output formats: |
| 170 | + |
| 171 | +1. Extend the `EmojiPackProcessor` class |
| 172 | +2. Add new configuration options to the schema |
| 173 | +3. Update validation in `EmojiPackConfig` |
| 174 | +4. Test with example configurations |
| 175 | + |
| 176 | +## Examples |
| 177 | + |
| 178 | +### Generate FluentUI 3D Pack |
| 179 | +```bash |
| 180 | +python emoji_pack_generator.py --config configs/fluentui-3d-only.json --download |
| 181 | +``` |
| 182 | + |
| 183 | +### Generate for Specific Skin Tone |
| 184 | +```bash |
| 185 | +python emoji_pack_generator.py --config configs/fluentui-3d-only.json --skin-tone Dark |
| 186 | +``` |
| 187 | + |
| 188 | +### Use Specific Commit |
| 189 | +```bash |
| 190 | +python emoji_pack_generator.py --config configs/fluentui-3d-only.json --commit abc123 --download |
| 191 | +``` |
| 192 | + |
| 193 | +The generated packs will be in the `packs/` directory and can be installed as Minecraft resource packs. |
0 commit comments