Conversation
|
|
||
| pub fn has_non_zero(&self, tag: Tag) -> bool { | ||
| self.get(tag).unwrap_or_default().to_f64() != 0.0 | ||
| } |
There was a problem hiding this comment.
New behavior seems testable but no new tests
| "expected only 1 or 2 in partSelection, found '{other}'" | ||
| ))), | ||
| }) | ||
| .collect::<Result<_, _>>()?; |
There was a problem hiding this comment.
Is it valid to have 2 entries that both have the same SmartComponentValue, e.g. 2 Min's?
There was a problem hiding this comment.
a given layer could be at the min of two different axes, if that's what you mean?
| _ => layer.shapes.push(shape), | ||
| }; | ||
| } | ||
| } |
There was a problem hiding this comment.
This feels more gross than it perhaps has to be?
| Some(335) | ||
| ); | ||
| } | ||
| } |
There was a problem hiding this comment.
Should we test some defective smart components?
There was a problem hiding this comment.
I've ported the tests from fonttools, although that doesn't provide a ton of coverage of malformed inputs. It doesn't seem like this stuff is really used much in the wild after all, so I'm inclined to just get this in as a checkpoint, and if we run into problems we can flesh it out more.
| *range.start() | ||
| } else { | ||
| *range.end() | ||
| }; |
There was a problem hiding this comment.
Is the assumption that there are exactly two and they must be min and max? We don't seem to actually check this?
There was a problem hiding this comment.
The python refs are much appreciated but ... this is fairly hard to follow. Lots of noise for iters and maps and such that make it hard to see the logic. Maybe moving some of that into helper methods and/or adding comments might help?
| .collect() | ||
| } | ||
|
|
||
| //https://github.com/fonttools/fonttools/blob/03a3c8ed9e/Lib/fontTools/varLib/models.py#L47 |
There was a problem hiding this comment.
The citation makes me wonder if this belongs somewhere in the var model code?
rsheeter
left a comment
There was a problem hiding this comment.
LGTM subject to addressing comments where feasible
31e91fe to
b088ae2
Compare
This is a checkpoint of an initial basic implementation, based on glyphsLib.
b088ae2 to
a611cca
Compare
- clarify some names and docs - start porting fonttools test cases
67f4f18 to
7a4ac82
Compare
7a4ac82 to
7f3de32
Compare
This is a checkpoint, and only glyphs3 sources are supported. (I believe that smart components might also exist in glyphs2 sources)