diff --git a/Lib/fontTools/varLib/interpolatable.py b/Lib/fontTools/varLib/interpolatable.py index fca21c459..f03e94620 100644 --- a/Lib/fontTools/varLib/interpolatable.py +++ b/Lib/fontTools/varLib/interpolatable.py @@ -322,8 +322,10 @@ def test_gen( # If contour-order is wrong, adjust it matching = matchings[m1idx] - if matching is not None and m1: # m1 is empty for composite glyphs - m1 = [m1[i] for i in matching] + if ( + matching is not None and m1Isomorphisms + ): # m1 is empty for composite glyphs + m1Isomorphisms = [m1Isomorphisms[i] for i in matching] m1Vectors = [m1Vectors[i] for i in matching] m1VectorsNormalized = [m1VectorsNormalized[i] for i in matching] recording1 = [recording1[i] for i in matching] diff --git a/Lib/fontTools/varLib/interpolatablePlot.py b/Lib/fontTools/varLib/interpolatablePlot.py index 3f68e436a..eef4a4716 100644 --- a/Lib/fontTools/varLib/interpolatablePlot.py +++ b/Lib/fontTools/varLib/interpolatablePlot.py @@ -107,6 +107,7 @@ class InterpolatablePlot: /O\ / \ """ + yay = r""" \o/ """ def __init__(self, out, glyphsets, names=None, **kwargs): self.out = out @@ -501,7 +502,6 @@ class InterpolatablePlot: if any( pt in ( - "nothing", "wrong_start_point", "contour_order", "kink", @@ -677,6 +677,8 @@ class InterpolatablePlot: emoticon = self.underweight elif "overweight" in problem_types: emoticon = self.overweight + elif "nothing" in problem_types: + emoticon = self.yay self.draw_emoticon(emoticon, x=x, y=y) if show_page_number: @@ -1062,7 +1064,7 @@ class InterpolatablePlot: font_ascent = font_extents[0] for line in text: extents = cr.text_extents(line) - text_width = max(text_width, extents.width) + text_width = max(text_width, extents.x_advance) text_height += font_line_height if not text_width: return diff --git a/Lib/fontTools/varLib/interpolatableTestStartingPoint.py b/Lib/fontTools/varLib/interpolatableTestStartingPoint.py index e630b2c95..9f742a14f 100644 --- a/Lib/fontTools/varLib/interpolatableTestStartingPoint.py +++ b/Lib/fontTools/varLib/interpolatableTestStartingPoint.py @@ -9,7 +9,7 @@ def test_starting_point(glyph0, glyph1, ix, tolerance, matching): m0Vectors = glyph0.greenVectors m1Vectors = [glyph1.greenVectors[i] for i in matching] - starting_point = 0 + proposed_point = 0 reverse = False min_cost = first_cost = 1 @@ -96,7 +96,10 @@ def test_starting_point(glyph0, glyph1, ix, tolerance, matching): min_cost_idx, min_cost = min(enumerate(costs), key=lambda x: x[1]) first_cost = costs[0] if min_cost < first_cost * tolerance: - this_tolerance = min_cost / first_cost - proposed_point = new_contour1[min_cost_idx][1] + # Don't report this + # min_cost = first_cost + # reverse = False + # proposed_point = 0 # new_contour1[min_cost_idx][1] + pass - return starting_point, reverse, min_cost, first_cost + return proposed_point, reverse, min_cost, first_cost