when working with custom fonts, is is often necessary to calculate the bounds of a block of text. there is a function exported from ttf.h, ttfGetExtents which does this, requiring a struct of type ttf_t. I can get such a struct by calling ttfCreate, but I also need to embed it into the PDF document using pdfioFileCreateFontObjFromFile. this function already calls ttfCreate under the hood, and destroys it.
It would be convenient if there were a way to access the underlying ttf_t struct from the call to pdfioFileCreateFontObjFromFile. or alternatively, embed a font into the PDF directly from the ttf_t obtained from ttfCreate.
when working with custom fonts, is is often necessary to calculate the bounds of a block of text. there is a function exported from
ttf.h
,ttfGetExtents
which does this, requiring a struct of typettf_t
. I can get such a struct by callingttfCreate
, but I also need to embed it into the PDF document usingpdfioFileCreateFontObjFromFile
. this function already callsttfCreate
under the hood, and destroys it.It would be convenient if there were a way to access the underlying
ttf_t
struct from the call topdfioFileCreateFontObjFromFile
. or alternatively, embed a font into the PDF directly from thettf_t
obtained fromttfCreate
.