by encoding as integers all float values that have no decimal portion.
This optimization is expected to reduce the file size of CFF2 fonts that have intermediate masters.
Related to https://github.com/adobe-type-tools/afdko/issues/444
Many thanks to @cjchapman for the help on the fixed point math
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.
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
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
I'm also unimpressed by the copy-pasted bounds logic in hhea and vhea,
and the fact that that's coded in there instead of calling a function
on CFF / glyf tables respectively.
The split-glyf-to-one-glyph-per-file feature is only partially implemented,
as it was discussed here:
https://github.com/fonttools/fonttools/issues/153#issuecomment-346677171
I need to cut a bugfix release today, but I don't want to ship this as is.
I prefer to temporarily rever, tag a release from master branch, then
revert it again to its present state so that bamidei can complete his
work.
---
Revert "[glyf] make splitGlyphs output more compact"
This reverts commit d08d635a93289982b028aacd3b9039fbe742f3e8.
Revert "more whitespace"
This reverts commit bd030f61c6b360fd360632bbc6c19abb057c9a24.
Revert "minor whitespace"
This reverts commit f2a8c787b13b92ae0e0f61477e584316144747c7.
Revert "Merge pull request #1035 from bamidei/split_g_l_y_f_to_one_per_file"
This reverts commit 17b89d9dde7691dbbb6815efba92eff446af62ac, reversing
changes made to b8482d9666f08d3603ee93d3ca52931550f715fc.
This also fixes fonttools/fonttools/issues/1030.
Although the roundtrip is generally possible when a VariationStore is built from source font data using the Superpolator model, it is possible to build region definitions that do not follow this model. Behdad cited the Skia "Q" example, where the tail of the Q is affected by two regions defined as:
min=0 peak=0.5 max=0.51 delta=+10
min=0.49 peak=0.5 max=0.51 delta=-10
We don't need to cast to int when using the round function from py23,
as this is a backport of python3's built-in round and thus it returns
an int when called with a single argument.
For reproducible builds, check the presence of SOURCE_DATE_EPOCH
environment variable and use it for the time stamp. This affects the
head.modified (and head.created in merge.py).
See https://reproducible-builds.org/specs/source-date-epoch/