Skip to content

Instantly share code, notes, and snippets.

@borodean
Last active October 31, 2021 14:21
Show Gist options
  • Select an option

  • Save borodean/b86fb59bafb5e4e82db0 to your computer and use it in GitHub Desktop.

Select an option

Save borodean/b86fb59bafb5e4e82db0 to your computer and use it in GitHub Desktop.
FontForge Single Character Font
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# fontforge -lang=py -script script.py
import fontforge
font = fontforge.font()
font.encoding = 'UnicodeFull'
font.design_size = 16
font.em = 2048
font.ascent = 1638
font.descent = 410
font.familyname = 'NotFound'
font.fontname = 'NotFound'
font.fullname = 'NotFound'
font.autoWidth(0, 0, 2048)
glyph = font.createChar(0x20)
glyph.width = 569
for char in set(u'Страница не найдена').difference(' '):
glyph = font.createChar(ord(char))
glyph.importOutlines('no-glyph.svg')
glyph.left_side_bearing = glyph.right_side_bearing = 16
glyph.round()
font.generate('build/NotFound.woff')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment