File tree Expand file tree Collapse file tree 4 files changed +28
-13
lines changed
Filter options
Expand file tree Collapse file tree 4 files changed +28
-13
lines changed
Original file line number Diff line number Diff line change @@ -285,3 +285,11 @@ Qt and wx backends no longer create a status bar by default
285
285
The coordinates information is now displayed in the toolbar, consistently with
286
286
the other backends. This is intended to simplify embedding of Matplotlib in
287
287
larger GUIs, where Matplotlib may control the toolbar but not the status bar.
288
+
289
+ :rc: `text.hinting ` now supports names mapping to FreeType flags
290
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
291
+ :rc: `text.hinting ` now supports the values "default", "no_autohint",
292
+ "force_autohint", and "no_hinting", which directly map to the FreeType flags
293
+ FT_LOAD_DEFAULT, etc. The old synonyms (respectively "either", "native",
294
+ "auto", and "none") are still supported. To get normalized values, use
295
+ `.backend_agg.get_hinting_flag `, which returns integer flag values.
Original file line number Diff line number Diff line change 54
54
55
55
def get_hinting_flag ():
56
56
mapping = {
57
+ 'default' : LOAD_DEFAULT ,
58
+ 'no_autohint' : LOAD_NO_AUTOHINT ,
59
+ 'force_autohint' : LOAD_FORCE_AUTOHINT ,
60
+ 'no_hinting' : LOAD_NO_HINTING ,
57
61
True : LOAD_FORCE_AUTOHINT ,
58
62
False : LOAD_NO_HINTING ,
59
63
'either' : LOAD_DEFAULT ,
60
64
'native' : LOAD_NO_AUTOHINT ,
61
65
'auto' : LOAD_FORCE_AUTOHINT ,
62
- 'none' : LOAD_NO_HINTING
63
- }
66
+ 'none' : LOAD_NO_HINTING ,
67
+ }
64
68
return mapping [mpl .rcParams ['text.hinting' ]]
65
69
66
70
Original file line number Diff line number Diff line change @@ -691,9 +691,11 @@ def _validate_hinting(s):
691
691
"True or False is deprecated since %(since)s and will be removed "
692
692
"%(removal)s; set it to its synonyms 'auto' or 'none' instead." )
693
693
return s
694
- if s .lower () in ('auto' , 'native' , 'either' , 'none' ):
695
- return s .lower ()
696
- raise ValueError ("hinting should be 'auto', 'native', 'either' or 'none'" )
694
+ return ValidateInStrings (
695
+ 'text.hinting' ,
696
+ ['default' , 'no_autohint' , 'force_autohint' , 'no_hinting' ,
697
+ 'auto' , 'native' , 'either' , 'none' ],
698
+ ignorecase = True )(s )
697
699
698
700
699
701
validate_pgf_texsystem = ValidateInStrings (
Original file line number Diff line number Diff line change 292
292
# Adobe Postscript (PSSNFS) font packages may also be
293
293
# loaded, depending on your font settings.
294
294
295
- #text.hinting: auto # May be one of the following:
296
- # - none: Perform no hinting
297
- # - auto: Use FreeType's autohinter
298
- # - native: Use the hinting information in the
299
- # font file, if available, and if your
300
- # FreeType library supports it
301
- # - either: Use the native hinting information,
302
- # or the autohinter if none is available.
295
+ ## FreeType hinting flag ("foo" corresponds to FT_LOAD_FOO); may be one of the following:
296
+ ## - default: Use the font's native hinter if possible, else FreeType's auto-hinter.
297
+ ## ("either" is a synonym).
298
+ ## - no_autohint: Use the font's native hinter if possible, else don't hint.
299
+ ## ("native" is a synonym.)
300
+ ## - force_autohint: Use FreeType's auto-hinter. ("auto" is a synonym.)
301
+ ## - no_hinting: Disable hinting. ("none" is a synonym.)
302
+ #text.hinting: force_autohint
303
+
303
304
#text.hinting_factor: 8 # Specifies the amount of softness for hinting in the
304
305
# horizontal direction. A value of 1 will hint to full
305
306
# pixels. A value of 2 will hint to half pixels etc.
You can’t perform that action at this time.
0 commit comments