8000 Specify font number for TTC fonts · matplotlib/matplotlib@4107501 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4107501

Browse files
aitikguptaQuLogic
authored andcommitted
Specify font number for TTC fonts
1 parent 9caa261 commit 4107501

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/matplotlib/backends/_backend_pdf_ps.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ def get_glyphs_subset(fontfile, characters):
3737
options = subset.Options(glyph_names=True, recommended_glyphs=True)
3838

3939
# prevent subsetting FontForge Timestamp and o 6C44 ther tables
40-
options.drop_tables += ['FFTM', 'PfEd']
40+
options.drop_tables += ['FFTM', 'PfEd', 'BDF']
41+
42+
# if fontfile is a ttc, specify font number
43+
if fontfile.endswith(".ttc"):
44+
options.font_number = 0
4145

4246
with subset.load_font(fontfile, options) as font:
4347
subsetter = subset.Subsetter(options=options)

0 commit comments

Comments
 (0)
0