mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2025-01-25 03:32:02 +02:00
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:
parent
4b269b2776
commit
66b29f6d54
10
font-patcher
10
font-patcher
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user