From c7e378c40fa4b762d43c141c13e91b0a7bc6958f Mon Sep 17 00:00:00 2001 From: Krishav Gulati Date: Wed, 15 Apr 2026 15:10:36 -0400 Subject: [PATCH 1/2] DOC: Add thumbnail for font_indexing gallery example --- doc/_static/font_indexing_thumbnail.svg | 529 +++++++++++++++++++++++ galleries/examples/misc/font_indexing.py | 4 +- 2 files changed, 532 insertions(+), 1 deletion(-) create mode 100644 doc/_static/font_indexing_thumbnail.svg diff --git a/doc/_static/font_indexing_thumbnail.svg b/doc/_static/font_indexing_thumbnail.svg new file mode 100644 index 000000000000..e1f0ca9066f5 --- /dev/null +++ b/doc/_static/font_indexing_thumbnail.svg @@ -0,0 +1,529 @@ + + + + + + + + 2026-04-15T15:01:58.541399 + image/svg+xml + + + Matplotlib v3.10.8, https://matplotlib.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/galleries/examples/misc/font_indexing.py b/galleries/examples/misc/font_indexing.py index 31388737bcae..0a87a721c57b 100644 --- a/galleries/examples/misc/font_indexing.py +++ b/galleries/examples/misc/font_indexing.py @@ -5,12 +5,14 @@ This example shows how the font tables relate to one another. """ +# sphinx_gallery_thumbnail_path = '_static/font_indexing_thumbnail.svg' import os import matplotlib from matplotlib.ft2font import FT2Font, Kerning + font = FT2Font( os.path.join(matplotlib.get_data_path(), 'fonts/ttf/DejaVuSans.ttf')) font.set_charmap(0) @@ -33,4 +35,4 @@ print('AV', font.get_kerning(glyphd['A'], glyphd['V'], Kerning.DEFAULT)) print('AV', font.get_kerning(glyphd['A'], glyphd['V'], Kerning.UNFITTED)) print('AV', font.get_kerning(glyphd['A'], glyphd['V'], Kerning.UNSCALED)) -print('AT', font.get_kerning(glyphd['A'], glyphd['T'], Kerning.UNSCALED)) +print('AT', font.get_kerning(glyphd['A'], glyphd['T'], Kerning.UNSCALED)) \ No newline at end of file From e19e040d3a1e3ed1f4e594455febedcf62474e12 Mon Sep 17 00:00:00 2001 From: Krishav Gulati Date: Wed, 15 Apr 2026 16:24:46 -0400 Subject: [PATCH 2/2] DOC: Add newline at end of font_indexing.py --- galleries/examples/misc/font_indexing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galleries/examples/misc/font_indexing.py b/galleries/examples/misc/font_indexing.py index 0a87a721c57b..808ea7da7b78 100644 --- a/galleries/examples/misc/font_indexing.py +++ b/galleries/examples/misc/font_indexing.py @@ -35,4 +35,4 @@ print('AV', font.get_kerning(glyphd['A'], glyphd['V'], Kerning.DEFAULT)) print('AV', font.get_kerning(glyphd['A'], glyphd['V'], Kerning.UNFITTED)) print('AV', font.get_kerning(glyphd['A'], glyphd['V'], Kerning.UNSCALED)) -print('AT', font.get_kerning(glyphd['A'], glyphd['T'], Kerning.UNSCALED)) \ No newline at end of file +print('AT', font.get_kerning(glyphd['A'], glyphd['T'], Kerning.UNSCALED))