iOS: Modify a font height, width, and spacing independently when creating PDF -


in ios app need use specific font each character needs taller, thinner, , spacing closed fit correctly. possible stretch/squish font programmatically?

when you're adding text pdf file there multiple ways influence how text going appear. generic way (and way might sufficient you) scale text matrix:

void cgcontextsettextmatrix ( cgcontextref c, cgaffinetransform t ); 

as mentioned in comment @mkl, can provide matrix scale in y direction while scaling down in x direction. effect letters stretched out vertically , squished horizontally.

normally expect don't have touch spacing in case, spacing "squished" other characters.

just in case isn't sufficient, pdf provide way change spacing between characters too:

void cgcontextsetcharacterspacing ( cgcontextref context, cgfloat spacing ); 

while apple's description talks "additional space" add between characters, pdf specification , suspect apple's implementation result allows spacing value both positive , negative. negative value have effect of moving characters closer together.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -