Commit 0264fde
committed
text: Fetch line height metrics from the used font itself
We follow the process from [the CSS Inline Layout
module](https://www.w3.org/TR/css-inline-3/), specifically:
1. The default ascent and descent come from the `OS/2` font table, or
failing that, the `hhea` table, with final fallback to the
measurement we used to do.
2. If `linespacing` (cf line height in CSS) is normal, then we do as
before and size each line based on the maximum ascent/descent of its
contents. Additionally, apply the line gap from the font metrics as
half-leading around each line.
3. If `linespacing` is a float, then scale it by font size of the first
available font, and keep it fixed for each line.1 parent b1cf5d4 commit 0264fde
689 files changed
Lines changed: 16643 additions & 16039 deletions
File tree
- lib
- matplotlib
- tests/baseline_images
- test_agg_filter
- test_arrow_patches
- test_artist
- test_axes
- test_bbox_tight
- test_collections
- test_colorbar
- test_colors
- test_constrainedlayout
- test_contour
- test_dates
- test_figure
- test_ft2font
- test_image
- test_legend
- test_lines
- test_mathtext
- test_offsetbox
- test_patches
- test_patheffects
- test_path
- test_png
- test_polar
- test_quiver
- test_simplification
- test_spines
- test_subplots
- test_table
- test_text
- test_tightlayout
- test_triangulation
- test_units
- test_widgets
- mpl_toolkits
- axes_grid1/tests/baseline_images/test_axes_grid1
- axisartist/tests/baseline_images
- test_axis_artist
- test_axislines
- test_floating_axes
- test_grid_helper_curvelinear
- mplot3d/tests/baseline_images
- test_axes3d
- test_legend3d
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Loading
0 commit comments