Ejemplo n.º 1
0
#FLM: Interpol Preview

"""This script draws all incremental interpolations 
between 1% and 99% of a selected glyph into a new font.
It requires two open source fonts in FontLab."""

from robofab.interface.all.dialogs import SelectFont, OneList, ProgressBar
from robofab.world import NewFont

src1 = SelectFont('Select source font one:')
if src1:
	src2 = SelectFont('Select source font two:')
	if src2:
		# collect a list of all compatible glyphs
		common = []
		for glyphName in src1.keys():
			if src2.has_key(glyphName):
				if src1[glyphName].isCompatible(src2[glyphName]):
					common.append(glyphName)
		common.sort()
		selName = OneList(common, 'Select a glyph:')
		if selName:
			dest = NewFont()
			g1 = src1[selName]
			g2 = src2[selName]
			count = 1
			bar = ProgressBar('Interpolating...', 100)
			# add the sourec one glyph for reference
			dest.newGlyph(selName + '_000')
			dest[selName + '_000'].width = src1[selName].width
			dest[selName + '_000'].appendGlyph(src1[selName])
Ejemplo n.º 2
0
#FLM: Interpol Preview
"""This script draws all incremental interpolations 
between 1% and 99% of a selected glyph into a new font.
It requires two open source fonts in FontLab."""

from robofab.interface.all.dialogs import SelectFont, OneList, ProgressBar
from robofab.world import NewFont

src1 = SelectFont('Select source font one:')
if src1:
    src2 = SelectFont('Select source font two:')
    if src2:
        # collect a list of all compatible glyphs
        common = []
        for glyphName in src1.keys():
            if src2.has_key(glyphName):
                if src1[glyphName].isCompatible(src2[glyphName]):
                    common.append(glyphName)
        common.sort()
        selName = OneList(common, 'Select a glyph:')
        if selName:
            dest = NewFont()
            g1 = src1[selName]
            g2 = src2[selName]
            count = 1
            bar = ProgressBar('Interpolating...', 100)
            # add the sourec one glyph for reference
            dest.newGlyph(selName + '_000')
            dest[selName + '_000'].width = src1[selName].width
            dest[selName + '_000'].appendGlyph(src1[selName])
            dest[selName + '_000'].mark = 1
Ejemplo n.º 3
0
# [h] check compatibility for interpolation

# imports

from robofab.interface.all.dialogs import SelectFont
from hTools2.modules.interpol import check_compatibility

# get fonts

f1 = SelectFont()
f2 = SelectFont()

# get glyphs

if len(f1.selection) > 0:
    glyph_names = f1.selection
else:
    glyph_names = f1.keys()

# run!

check_compatibility(f2, f1, names=glyph_names, report=False)