MCPcopy
hub / github.com/matplotlib/matplotlib / score_style

Method score_style

lib/matplotlib/font_manager.py:1374–1389  ·  view source on GitHub ↗

Return a match score between *style1* and *style2*. An exact match returns 0.0. A match between 'italic' and 'oblique' returns 0.1. No match returns 1.0.

(self, style1, style2)

Source from the content-addressed store, hash-verified

1372 return 1.0
1373
1374 def score_style(self, style1, style2):
1375 """
1376 Return a match score between *style1* and *style2*.
1377
1378 An exact match returns 0.0.
1379
1380 A match between 'italic' and 'oblique' returns 0.1.
1381
1382 No match returns 1.0.
1383 """
1384 if style1 == style2:
1385 return 0.0
1386 elif (style1 in ('italic', 'oblique')
1387 and style2 in ('italic', 'oblique')):
1388 return 0.1
1389 return 1.0
1390
1391 def score_variant(self, variant1, variant2):
1392 """

Callers 1

_findfont_cachedMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected