Choose a style for a font

Hello, I am new here so please forgive me if I do something wrong here.

I am trying to select a style for a system font to be set in rcParams, for example, “Bold” style of “Noto Sans CJK SC”. Here is the information of the installed font:

$ fc-list | grep "Noto Sans CJK SC"                
/usr/share/fonts/noto-cjk/NotoSansCJK.otf: Noto Sans CJK SC:style=Thin,Regular
/usr/share/fonts/noto-cjk/NotoSansCJK.otf: Noto Sans CJK SC:style=Black
/usr/share/fonts/noto-cjk/NotoSansCJK.otf: Noto Sans CJK SC:style=Regular
/usr/share/fonts/noto-cjk/NotoSansCJK.otf: Noto Sans CJK SC
/usr/share/fonts/noto-cjk/NotoSansCJK.otf: Noto Sans CJK SC:style=DemiLight
/usr/share/fonts/noto-cjk/NotoSansCJK.otf: Noto Sans CJK SC:style=Light
/usr/share/fonts/noto-cjk/NotoSansCJK.otf: Noto Sans CJK SC:style=Medium
/usr/share/fonts/noto-cjk/NotoSansCJK.otf: Noto Sans CJK SC:style=Bold

And the output figure of the code below:

import matplotlib.pyplot as plt

plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = ['Noto Sans CJK SC']
plt.rcParams['font.weight'] = 'bold'

plt.title('测试标题')
plt.show()

is like:

It seems that matplotlib chooses a thin style of this font, even if I have set font.weight to bold. So how to set a different style for the font? Thanks for all your replies.

It looks like all styles are supported by the same font. This means it is either a font collection, or is a variable font. We do not yet support either of these types of fonts, and just pick the first one in the collection.

If you use mplcairo, then you should be able to select fonts like these:

Thanks for your reply. I will take a look on it.