fonttools / fontbakery

🧁 A font quality assurance tool for everyone
https://fontbakery.readthedocs.io
Apache License 2.0
534 stars 99 forks source link

[com.google.fonts/check/interpolation_issues] ZeroDivisionError #4742

Closed justvanrossum closed 1 month ago

justvanrossum commented 1 month ago

Observed behaviour

ERROR Failed with ZeroDivisionError: float division by zero                 

           File                                                                
         "/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-package   
         fontbakery/checkrunner.py", line 213, in _run_check                   
             subresults = list(subresults)                                     
                          ^^^^^^^^^^^^^^^^                                     
           File                                                                
         "/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-package   
         fontbakery/checks/universal/__init__.py", line 2260, in               
         com_google_fonts_check_interpolation_issues                           
             results = interpolation_test(glyphsets, names=names)              
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^              
           File                                                                
         "/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-package   
         fontTools/varLib/interpolatable.py", line 585, in test                
             for glyphname, problem in test_gen(*args, **kwargs):              
           File                                                                
         "/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-package   
         fontTools/varLib/interpolatable.py", line 337, in test_gen            
             this_tolerance, proposed_point, reverse = test_starting_point(    
                                                       ^^^^^^^^^^^^^^^^^^^^    
           File                                                                
         "/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-package   
         fontTools/varLib/interpolatableTestStartingPoint.py", line 52, in     
         test_starting_point                                                   
             correlation = vector[5] / abs(vector[0])                          
                           ~~~~~~~~~~^~~~~~~~~~~~~~~~                          

         ``` [code: failed-check]                                              

   Result: ERROR

Expected behaviour

If this is caused by an error in outlines, a FAIL might be appropriate.

Resources and steps needed to reproduce

I can't publically share the font. I'll try to find the glyph that is causing this.

justvanrossum commented 1 month ago

Sorry, this appears to be a fonttools issue. Opened an issue there.

felipesanches commented 1 month ago

thanks!