Skip to content
This repository has been archived by the owner on Feb 28, 2019. It is now read-only.

Rotating Text #35

Open
oliverburton opened this issue Mar 16, 2018 · 3 comments
Open

Rotating Text #35

oliverburton opened this issue Mar 16, 2018 · 3 comments

Comments

@oliverburton
Copy link

Hi,
I had an issue where text would not rotate with a custom font using this library. I resolved by modifying the APi.text method

Below transformationMatrix = [f2(c), f2(s), f2(s * -1), f2(c)];

I added
xtra = [f2(c), f2(s), f2(s * -1), f2(c), ''].join(" ") + "";
mode = 'Tm';

I declared mode at the top of method and initialised to Td

I then modified the args passed into the out function as folllows:

out('BT\n/' + activeFontKey + ' ' + activeFontSize + ' Tf\n' + // font face, style, size
activeFontSize * lineHeightProportion + ' TL\n' + // line spacing
textColor + '\n' + xtra + f2(x * k) + ' ' + f2((pageHeight - y) * k) + ' ' + mode + '\n' + text + ' Tj\nET');

(added xtra and modified mode)
Looks to be working for me, hope this helps somebody!

@ytheekshana
Copy link

ytheekshana commented Apr 14, 2018

Thanks Bro, Exactly what I needed... Works Perfectly

@laice
Copy link

laice commented May 8, 2018

This does allow rotating for me, but changes from my custom font to Times

@lukasbayard
Copy link

@oliverburton do you have a full example for that? I didn't got this to run.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants