PyQt5 QCalendarWidget – Accessing Font Metrics
In this article we will see how we can get the font metrics of the QCalendarWidget. A font is a particular size, weight and style of a typeface. Each font was a matched set of type, one piece for each glyph. By changing font we can change the style of the text present in the calendar. We can change/set font using setFont method. Font metrics calculate the size of characters and strings for a given font of calendar.
In order to do this we will use fontMetrics method with the QCalendarWidget object. Syntax : calendar.fontMetrics() Argument : It takes no argument Return : It return QFontMetrics object
Below is the implementation