I would like to extract font of a cell containing rich text ,which means in same cell there is a text in bold and another text in italic enter image description here, I worked with openpyxl and I tried with bellow code but I got an incorrect result: False
import openpyxl
path="doc.xlsx"
wb_obj = openpyxl.load_workbook(path)
sheet_obj = wb_obj.active
cell_obj = sheet_obj.cell(row = 5, column = 5)
print(cell_obj.font.bold)
Further to the comment A textblock may be a whole word, two or more words or part of the word depending on where the font changes exist. Its also possible you might see the space character [between words] as a separate textblock if the space inherits the default font and not the style of the previous or next word.
For example, given the following text in the cell

we would expect 3 textblocks, one for each word.
To obtain the font details you might want to loop the text blocks using a for loop and print out the font style for each text block as shown;
In the example code Either 'b' or 'bold' can be used to access the textblock bold state;
e.g.
font_style.band
font_style.boldreturn the status of bolding in the text block. The same goes for italic where either
.ior.italiccan be used and for underline,.uor.underlinecan be used.and the output would be
You can see the trailing spaces for each word is included in the word block but it may be separate as mentioned so you could include a check for that in the loop if its a problem.
As mentioned each block separates the font styles so if in the same example the first word 'bold' had the 'l' only underlined (no other font changes) this would change that textblock into three separate blocks made up of the characters in the word.
Example