Change bearing to int, since an int is expected

I keep seeing this warning when running `font-patcher`, and realised this is a relatively simple fix. This property expects and `int`, but a `float` is passed and implicitly cast.

This squelches the deprecation warning, and keeps the code future-proof too.

```
/nerd/font-patcher:823: DeprecationWarning: an integer is required (got type float).  Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
  glyph.left_side_bearing = 0.0
/nerd/font-patcher:825: DeprecationWarning: an integer is required (got type float).  Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
  glyph.right_side_bearing = 0.0
```
This commit is contained in:
Hugo Barrera 2020-04-22 12:52:07 +02:00 committed by Hugo Osvaldo Barrera
parent 4b269b2776
commit 66b29f6d54

View file

@ -817,12 +817,12 @@ class font_patcher:
def remove_glyph_neg_bearings(self, glyph):
""" Sets passed glyph's bearings 0.0 if they are negative. """
""" Sets passed glyph's bearings 0 if they are negative. """
try:
if glyph.left_side_bearing < 0.0:
glyph.left_side_bearing = 0.0
if glyph.right_side_bearing < 0.0:
glyph.right_side_bearing = 0.0
if glyph.left_side_bearing < 0:
glyph.left_side_bearing = 0
if glyph.right_side_bearing < 0:
glyph.right_side_bearing = 0
except:
pass