()
| 39 | def _get_preamble(): |
| 40 | """Prepare a LaTeX preamble based on the rcParams configuration.""" |
| 41 | def _to_fontspec(): |
| 42 | for command, family in [("setmainfont", "serif"), |
| 43 | ("setsansfont", "sans\\-serif"), |
| 44 | ("setmonofont", "monospace")]: |
| 45 | font_path = fm.findfont(family) |
| 46 | path = pathlib.Path(font_path) |
| 47 | yield r" \%s{%s}[Path=\detokenize{%s/}%s]" % ( |
| 48 | command, path.name, path.parent.as_posix(), |
| 49 | f',FontIndex={font_path.face_index:d}' if path.suffix == '.ttc' else '') |
| 50 | |
| 51 | font_size_pt = FontProperties(size=mpl.rcParams["font.size"]).get_size_in_points() |
| 52 | return "\n".join([ |
no test coverage detected
searching dependent graphs…