i am trying to insert text in pdf using pre used fonts in pdf.
$ import fitz
$ doc = fitz.open('input.pdf')
$ page = doc[0]
$ doc.extract_font()
-> ('invalid-name', '', '', b'')
$ doc.get_page_fonts(0)
-> [(6, 'ttf', 'Type0', 'AHRFAF+Merriweather-Bold', 'F4', 'Identity-H'),
(11, 'ttf', 'Type0', 'ACGAMA+OpenSans-Bold', 'F5', 'Identity-H'),
(16, 'ttf', 'Type0', 'AHEYPR+OpenSans-Regular', 'F6', 'Identity-H'),
(21, 'ttf', 'Type0', 'AXOPEO+Merriweather-Regular', 'F7', 'Identity-H')]
How i can use 'AHRFAF+Merriweather-Bold' font to insert text in pdf. When i try to insert
$ page.insert_text((50, 127), "SINGH", fontname="'AHRFAF+Merriweather-Bold'", fontsize=36, color=color)
-> RuntimeError: FT_New_Memory_Face((null)): unknown file format
Is there any way to insert text using pre used fonts in pdfs.