MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / set_fontfeatures

Method set_fontfeatures

lib/matplotlib/text.py:1207–1238  ·  view source on GitHub ↗

Set the feature tags to enable on the font. Parameters ---------- features : list of str, or tuple of str, or None A list of feature tags to be used with the associated font. These strings are eventually passed to HarfBuzz, and so all `string

(self, features)

Source from the content-addressed store, hash-verified

1205 self.stale = True
1206
1207 def set_fontfeatures(self, features):
1208 """
1209 Set the feature tags to enable on the font.
1210
1211 Parameters
1212 ----------
1213 features : list of str, or tuple of str, or None
1214 A list of feature tags to be used with the associated font. These strings
1215 are eventually passed to HarfBuzz, and so all `string formats supported by
1216 hb_feature_from_string()
1217 <https://harfbuzz.github.io/harfbuzz-hb-common.html#hb-feature-from-string>`__
1218 are supported. Note though that subranges are not explicitly supported and
1219 behaviour may change in the future.
1220
1221 For example, if your desired font includes Stylistic Sets which enable
1222 various typographic alternates including one that you do not wish to use
1223 (e.g., Contextual Ligatures), then you can pass the following to enable one
1224 and not the other::
1225
1226 fp.set_features([
1227 'ss01', # Use Stylistic Set 1.
1228 '-clig', # But disable Contextural Ligatures.
1229 ])
1230
1231 Available font feature tags may be found at
1232 https://learn.microsoft.com/en-us/typography/opentype/spec/featurelist
1233 """
1234 _api.check_isinstance((Sequence, None), features=features)
1235 if features is not None:
1236 features = tuple(features)
1237 self._features = features
1238 self.stale = True
1239
1240 def set_fontvariant(self, variant):
1241 """

Callers 1

_test_text_featuresFunction · 0.80

Calls

no outgoing calls

Tested by 1

_test_text_featuresFunction · 0.64