#!/usr/bin/python # vim: set shiftwidth=4 tabstop=8 autoindent expandtab: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/.
# To install what you need, on Ubuntu, # sudo apt-get install python-fontforge
import fontforge
# generate a set of fonts, each with our special glyph at one codepoint, # and nothing else for codepoint in range(ord("A"), ord("D") + 1): for mark, width in [("", 1500), ("2", 1800)]:
charname = chr(codepoint)
f = fontforge.font()
n = "Mark" + mark + charname
f.fontname = n
f.familyname = n
f.fullname = n
f.copyright = "Copyright (c) 2008-2020 Mozilla Corporation"
g = f.createChar(ord(" "), "space")
g.width = 1000
g = f.createChar(codepoint, charname)
g.importOutlines("mark" + mark + "-glyph.svg")
g.width = width
f.generate("mark" + mark + charname + ".ttf")
f.generate("mark" + mark + charname + ".otf")
for codepoint in range(ord("A"), ord("A") + 1): for mark, width in [("", 1500), ("2", 1800)]: for uposname, upos in [("low", -350), ("high", -50)]:
charname = chr(codepoint)
f = fontforge.font()
n = "Mark" + mark + charname
f.fontname = n
f.familyname = n
f.fullname = n
f.descent = 400
f.upos = upos
f.uwidth = 100
f.copyright = "Copyright (c) 2008-2020 Mozilla Corporation"
g = f.createChar(ord(" "), "space")
g.width = 1000
g = f.createChar(codepoint, charname)
g.importOutlines("mark" + mark + "-glyph.svg")
g.width = width
# font with a known line-height (which is greater than winascent + windescent).
f = fontforge.font()
lineheight = 1500
n = "MarkA-lineheight" + str(lineheight)
f.fontname = n
f.familyname = n
f.fullname = n
f.copyright = "Copyright (c) 2008-2011 Mozilla Corporation"
g = f.createChar(ord(" "), "space")
g.width = 1000
g = f.createChar(ord("A"), "A")
g.importOutlines("mark-glyph.svg")
g.width = 1500
# Fonts with known winHeight and typoLineHeight such that winHeight is much # larger than typoLineHeight.
f = fontforge.font()
typoLineHeight = 2700
winHeight = 6000
n = "MarkA-lineheight" + str(winHeight)
n = n + "-typolineheight" + str(typoLineHeight)
f.fontname = n
f.familyname = n
f.fullname = n
f.copyright = "Copyright (c) 2008-2015 Mozilla Corporation"
g = f.createChar(ord(" "), "space")
g.width = 1000
g = f.createChar(ord("A"), "A")
g.importOutlines("mark-glyph.svg")
g.width = 1500
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.