{"id":13821879,"url":"https://github.com/tomchen/font-template","last_synced_at":"2025-04-30T16:07:17.883Z","repository":{"id":130444977,"uuid":"240963221","full_name":"tomchen/font-template","owner":"tomchen","description":"Simplest way to create your own font with Adobe Illustrator and FontForge 🔤","archived":false,"fork":false,"pushed_at":"2020-12-26T16:21:14.000Z","size":16649,"stargazers_count":101,"open_issues_count":0,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-30T17:44:42.684Z","etag":null,"topics":["adobe-illustrator","ai","font","font-creator","fontforge","template","webfont"],"latest_commit_sha":null,"homepage":"https://font.tomchen.org/font_template","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomchen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-02-16T20:46:12.000Z","updated_at":"2025-03-27T12:31:29.000Z","dependencies_parsed_at":"2023-05-11T04:15:46.411Z","dependency_job_id":null,"html_url":"https://github.com/tomchen/font-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomchen%2Ffont-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomchen%2Ffont-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomchen%2Ffont-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomchen%2Ffont-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomchen","download_url":"https://codeload.github.com/tomchen/font-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251738866,"owners_count":21635890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adobe-illustrator","ai","font","font-creator","fontforge","template","webfont"],"created_at":"2024-08-04T08:01:32.005Z","updated_at":"2025-04-30T16:07:17.809Z","avatar_url":"https://github.com/tomchen.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Font Template: the simplest way to create your own font using Adobe Illustrator and FontForge\r\n\r\nAdobe Illustrator font templates that allow you to edit shapes of glyphs (characters) altogether in one `.ai` file (or in their separate, respective `.ai` files if you want), then export them as `.svg` files, which can be imported into a font file in free and open-source font maker [FontForge](https://fontforge.org/), and generate final production font files (`.otf`, `.ttf`, `.woff`, `.woff2`, etc.).\r\n\r\n\u003cp align=\"center\"\u003e\r\n\u003ca href=\"https://font.tomchen.org/font_template\"\u003eBeautiful version of this tutorial on my website\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n## Files\r\n\r\n* **`font_template.ai`** ([download](https://github.com/tomchen/font-template/raw/master/font_template.ai)): Adobe Illustrator font template for basic and extended symbols and latin letters (significant CP1252 coverage), each glyph has a separate artboard, so that you can easily export each of them as individual glyph SVG file.\r\n* **`font_template_single.ai`** ([download](https://github.com/tomchen/font-template/raw/master/font_template_single.ai)): Adobe Illustrator font template for a single glyph. If you want, you can use this file instead of (or along with) `font_template.ai`.\r\n* **`batch_import_svg.py`** ([open](https://github.com/tomchen/font-template/raw/master/batch_import_svg.py), then \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eS\u003c/kbd\u003e / \u003ckbd\u003eCmd\u003c/kbd\u003e+\u003ckbd\u003eS\u003c/kbd\u003e to save): a python script that can import multiple SVG individual glyph files into FontForge's `.sfd` font file (and can optionally convert it to production font files, i.e. `.otf`, `.ttf`, `.woff`, `.woff2`, etc.)\r\n\r\n(Instead of downloading the files, you may also `git clone `[`https://github.com/tomchen/font-template.git`](https://github.com/tomchen/font-template.git) or [download the whole repository](https://github.com/tomchen/font-template/archive/master.zip))\r\n\r\n(**Make sure you use the latest version of FontForge, which is 20th Anniversary Edition (2020-11-07) ([GitHub Release Page](https://github.com/fontforge/fontforge/releases) or [FontForge.org Download Page](https://fontforge.org/en-US/downloads/)). Old Windows version 20200314 crashes when importing SVG files.**)\r\n\r\n## Usage\r\n\r\nOpen `font_template.ai`, draw your glyphs in the \"Artwork glyph\" layer.\r\n\r\n(It doesn't matter if your glyph is partially and slightly outside its artboard.)\r\n\r\n![AI font template](https://raw.githubusercontent.com/tomchen/font-template/master/img/1-ai_font_template.png)\r\n\r\nAfter finishing drawing the glyphs, hide \"Example glyph\" layer. Click \"File\" -\u003e \"Export\" -\u003e \"Export for Screens\".\r\n\r\n![AI menu export](https://raw.githubusercontent.com/tomchen/font-template/master/img/2-ai_menu_export.png)\r\n\r\nSelect the glyphs you want to export (do not select empty ones), select \"SVG\" format, click \"Export Artboard\".\r\n\r\n![AI export](https://raw.githubusercontent.com/tomchen/font-template/master/img/3-ai_export.png)\r\n\r\nExported individual glyph SVG files are inside an \"SVG\" folder, put it in a folder that also contains the `batch_import_svg.py` script file.\r\n\r\nFor Windows users, run `C:\\Program Files (x86)\\FontForgeBuilds\\fontforge-console.bat`,* navigate to the folder using `cd \u003cFOLDER_PATH\u003e` and execute the Python script using `ffpython batch_import_svg.py`. An `output.sfd` font file will be generated.\r\n\r\nFor Mac or Linux users, `cd \u003cFOLDER_PATH\u003e` and execute `fontforge -lang=py -script batch_import_svg.py`.\r\n\r\n*(\\*: for 64 bit Windows it's `Program Files (x86)`, for 32 bit Windows it's `Program Files`)*\r\n\r\n![FontForge import](https://raw.githubusercontent.com/tomchen/font-template/master/img/4-fontforge_import.png)\r\n\r\nOpen the `output.sfd` font file with FontForge. Adjust glyphs' width (use \u003ckbd\u003eShift\u003c/kbd\u003e key to select all the glyphs you want to adjust width, then, in the menu, select \"Metrics\" -\u003e \"Auto Width\", OR, double click a glyph and manually drag its border line).\r\n\r\n![FontForge adjust width](https://raw.githubusercontent.com/tomchen/font-template/master/img/5-fontforge_adjust_width.png)\r\n\r\nIn the menu, select \"File\" -\u003e \"Generate Fonts...\"\r\n\r\n![FontForge menu generate font](https://raw.githubusercontent.com/tomchen/font-template/master/img/6-fontforge_menu_generate_font.png)\r\n\r\nType in a font name, select a font format (typically TrueType or OpenType), click \"Generate\" button. Then you have your self-made computer font!\r\n\r\n![FontForge generate font](https://raw.githubusercontent.com/tomchen/font-template/master/img/7-fontforge_generate_font.png)\r\n\r\nYou can stop here and do not need to read the following sections.\r\n\r\n## Other optional workflows and tips\r\n\r\n### font_template_single.ai file\r\n\r\nThis font template can be used to draw single glyph and produce single glyph SVG.\r\n\r\nThe following image depicts the guides of a single glyph.\r\n![Font template single description](https://raw.githubusercontent.com/tomchen/font-template/master/template_desc/font_template_single_description.png)\r\n\r\nIn FontForge, select a glyph or open a glyph, then click \"File\" -\u003e \"Import...\", select \"SVG\" as \"Format\", select your single glyph SVG file and import it.\r\n\r\n### batch_import_svg.py file\r\n\r\nModify `batch_import_svg.py` file if you want to open an existing `.sfd` font file, or generate `.otf`, `.ttf`, `.woff`, `.woff2` directly, instead of doing so with FontForge GUI.\r\n\r\n### Export all glyphs as individual SVG files in FontForge\r\n\r\nIn the FontForge menu, click \"File\" -\u003e \"Execute Script\"\r\n\r\nCopy and paste: `SelectWorthOutputting(); foreach Export(\"%e_%n.svg\"); endloop;`\r\n\r\nSelect \"FF\" radial button.\r\n\r\nClick \"OK\" button.\r\n\r\n### Join overlapping paths\r\n\r\nIf a glyph's shape contains multiple overlapping paths, it would be better to join them ([a nice YouTube tutorial](https://www.youtube.com/watch?v=ESj0M0l6Rho)) instead of grouping them or making them a compound path. This step helps to avoid font rendering problems for overlapping paths. However, for seperate (non-overlapping) paths, feel free to use \"group\" (\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eG\u003c/kbd\u003e) or \"compound path\" (\"Object\" -\u003e \"Compound Path\" -\u003e \"Make\").\r\n\r\n### Use existing free and open-source font file\r\n\r\nInstead of creating a font file with FontForge from scrach, it's sometimes a good idea to use an existing free and open-source font file as a base and fallback font. Typical open-source fonts with good glyph coverage are Adobe's [Source Sans Pro](https://github.com/adobe-fonts/source-sans-pro/tree/release/TTF) and [Source Serif Pro](https://github.com/adobe-fonts/source-serif-pro/tree/release/TTF). Choose a weight such as \"Regular\", depending on your needs. Open the font file with FontForge, edit it to create your font. However, if you use an existing font, you may need to edit not only A-Z, a-z but also their [ligatures](https://fontforge.org/docs/tutorial/editexample4.html#creating-a-ligature) such as \"ff\" and \"fi\".\r\n\r\n### Do not use empty glyphs\r\n\r\nWhen you select glyphs in Illustrator's \"Export for Screens\" window, you should not select empty glyphs, otherwise, you will see \"I'm sorry this file is too complex for me to understand (or is erroneous)\" warning when you execute `batch_import_svg.py` script. Nevertheless, it will not stop and will continue to generate the `output.sfd` file.\r\n\r\n### Update your font_template.ai before 2020-08-19\r\n\r\nOn 19 August 2020, the project's `font_template.ai` file was updated (many artboard names were changed, e.g. `44 ,` were changed to `44 comma`) to fix an [Unicode filename issue](https://github.com/tomchen/font-template/issues/3). If you have downloaded `font_template.ai` before 2020-08-19 and made your `.ai` file based on the old version, you may optionally** update the artboard names in your `font_template.ai` using *either* of the following methods:\r\n\r\n* Copy your \"Artwork glyph\" layer (and any other layers you have added) from your old `.ai` file to the latest `font_template.ai`\r\n* *Or* execute [**`/other_files/update_artboard_names.js`**](https://github.com/tomchen/font-template/raw/master/other_files/update_artboard_names.js) in Illustrator: open your `.ai` file in Adobe Illustrator, in the menu, click \"File\" -\u003e \"Scripts\" -\u003e \"Other Script...\", find and select the downloaded `update_artboard_names.js` file, click \"Open\"\r\n\r\nAfter the update, delete and regenerate your glyph SVG files in `SVG` folder.\r\n\r\n*(\\*\\*: If you are using the old version but your glyphs are limited to basic [ASCII characters](https://en.wikipedia.org/wiki/ASCII#Character_set) therefore will not encounter any SVG Unicode filename related problem, you may opt not to update your `.ai` file)*\r\n\r\n### Web fonts (alphabet or icon)\r\n\r\nOnce you have your own font, you can use it on your web pages (including websites, web applications, Electron-compiled cross-plateform Desktop applications, or even React Native / NativeScript mobile app).\r\n\r\nYour font can be alphabet font or monochrome icon font. If you want to show color icons, use SVG or PNG.\r\n\r\nPut your `.woff2` and `.woff` font files (`my_font.woff2` and `my_font.woff` in the example) in your CSS folder and insert the following code in your CSS file (it [supports](https://css-tricks.com/snippets/css/using-font-face/#practical-level-of-browser-support) IE9+):\r\n\r\n```css\r\n@font-face {\r\n  font-family: 'MyFont';\r\n  src: url('my_font.woff2') format('woff2'),\r\n       url('my_font.woff') format('woff');\r\n}\r\n```\r\n\r\n(If you do not want to [support any IE](https://caniuse.com/#search=woff2), you can delete the `.woff` file and use only `.woff2` (the smallest and latest format))\r\n\r\nThen use your customized `font-family` name ('MyFont' in the example):\r\n\r\n```css\r\n.my-special-font {\r\n  font-family: 'MyFont', sans-serif;\r\n  color: yellow;\r\n  font-size: 20px;\r\n}\r\n```\r\n\r\nHTML:\r\n\r\n```html\r\n\u003cspan class=\"my-special-font\"\u003eB\u003c/span\u003e\r\n```\r\n\r\nIf it is a monochrome icon font, the letter B in the HTML code will be shown as the monochrome icon mapping to the letter B. Although web developers usually use characters in Unicode [Private Use Area](https://en.wikipedia.org/wiki/Private_Use_Areas) such as U+EEA0 and U+F2BB instead of basic latin letters and other commonly-used characters over semantics / SEO / accessibility concerns, nobody prevents you from using latin letters. To address those concerns, you may semantically identify a font icon by adding `role` and `aria-label` attributes to your HTML element:\r\n\r\n```html\r\n\u003cspan role=\"img\" aria-label=\"A bag\" class=\"my-special-font\"\u003eB\u003c/span\u003e\r\n```\r\n\r\n## Real-world example\r\n\r\n* [Erathian language font in the universe of *(Heroes of) Might and Magic* game series](https://github.com/might-and-magic/erathian-font)\r\n\r\n## References and credits\r\n\r\n* [How to Design a custom font using Illustrator and FontForge](https://www.schoolofmotion.com/blog/custom-font-illustrator-fontforge)  \r\n*This project is highly inspired by the fantastic article above which has its own single glyph template, although my template here has different guide proportion, and the native artboard export in lieu of a 3rd-party MultiExporter is used in the font creation flow described by this project.*\r\n* [Font creation template](https://community.fontself.com/t/font-creation-template/165)  \r\n*This project is highly inspired by Fontself community's awesome template, as my template picks the same glyphs and has the same order. However, my template is a total remake, and does not require Fontself software.*\r\n* [Notes on dumping SVG outlines into a FontForge file](https://gist.github.com/psmay/fd3e7e91893f6012b262)\r\n* [FontForge: Export a font's individual glyphs into svg files in batch?](https://stackoverflow.com/questions/56179680/fontforge-export-a-fonts-individual-glyphs-into-svg-files-in-batch)\r\n* [How to import fontforge to python in windows 7](https://stackoverflow.com/questions/23365299/how-to-import-fontforge-to-python-in-windows-7)\r\n* [AGL (Adobe Glyph List) glyphlist.txt](https://github.com/adobe-type-tools/agl-aglfn/blob/master/glyphlist.txt)\r\n* [Using @font-face](https://css-tricks.com/snippets/css/using-font-face/#practical-level-of-browser-support)\r\n* [Semantically identifying a font icon with role=\"img\"](https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA24.html)\r\n\r\n## License\r\n\r\n[MIT License](https://github.com/tomchen/font-template/blob/master/LICENSE) for everything in this repository\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomchen%2Ffont-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomchen%2Ffont-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomchen%2Ffont-template/lists"}