To avoid the 'No handlers could be fonud' message, from now on, one should always
configure logging in one's scripts or applications.
logging.basicConfig, or fontTools.configLogger (with some predefined defaults
useful for fonttools scripts) can be used to quickly configure logging.
Read the python docs for more advanced logging usage.
Oops. Was introduced when I last changed modeling.
The problem was, for checking that a previous master m is outside the current
influence box of the current master, I was doing "not (lower < m[loc] < upper)".
This is wrong, where lower,peak,upper is the support of previous master.
This fails if lower == peak == m[loc], or m[loc] == peak == upper.
Fixes https://github.com/fonttools/fonttools/issues/1269#issuecomment-397655016
So we now round towards +Infinity in:
- floatToFixed (which fully examplify that quotes from OT spec)
- psCharStrings: when packing floats as fixed 16.16
- t2CharStringPen: when rounding coordinates and advance widths
- subset: when rounding advance widths to compute average
- TupleVariation: rounding gvar deltas
- _g_l_y_f: when rounding coordinates: both in GlyphComponent.{x,y}
and for GlyphCoordinates.toInt()
- _h_m_t_x: for rounding horiz/vert metrics
- varLib: rounding horiz metrics and deltas
Instead of memoizing the tuple of <lookup-idx,current-glyphs>, use a mapping of
lookup-idx->current-glyphs instead. Saves some work. Speeds up 5%ish on
NotoNastaliqUrdu-Regular.
It doesn't make sense to add components that reference non-existing base glyphs
(ie. glyphs not in the input glyphSet, hence missing from the generated glyf table).
Even if we let them in here, it will fail immediately as soon as we attempt to
compile this glyf table containing 'dangling' component references.
Better to warn and skip.
in _checkFloat (used whenever we're about to update the inner array) we check whether the value exceeds a short integer, and if so we convert the array to floats.
Also, we make sure we call __setitem__ (which in turn calls _checkFloat) instead of updating the inner array directly in the rest of the math methods.
the logger name is constant (based on the user class's name and module)
so we can cache it.
(this means the LogMixin will only work on regular dict-based classes,
not on 'slotted' classes. But that's ok