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
fontMetricsmethod with the QCalendarWidget object.
Syntax : calendar.fontMetrics()
Argument : It takes no argument
Return : It return QFontMetrics object
Below is the implementation
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.