wpilibsuite / sphinxext-opengraph

Sphinx extension to generate unique OpenGraph metadata
https://sphinxext-opengraph.readthedocs.io
Other
69 stars 25 forks source link

Bundled Roboto font does not support Japanese (social images) #108

Closed zhudotexe closed 8 months ago

zhudotexe commented 1 year ago

Hello! We're using sphinxext-opengraph to generate meta tags for a new project we're working on that happens to have two katakana characters in its name. When we try to generate social images, these appear as unknown characters:

summary_index_5a47e8a8

and we see this warning from matplotlib in the terminal:

sphinxext/opengraph/socialcards.py:168: UserWarning: Glyph 12459 (\N{KATAKANA LETTER KA}) missing from current font.             
  fig.savefig(path, facecolor=None)

I see that there's a comment in the code suggesting that allowing users to customize the font is planned:

# socialcards.py#L185
# TODO: Currently the `font` parameter above does nothing
#   Should instead make it possible to load remote fonts or local fonts
#   if a user specifies.

but as of v0.8.2 it is not possible to.