Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text rotation #63

Open
ahmedalnaqaa opened this issue Aug 9, 2020 · 2 comments
Open

Text rotation #63

ahmedalnaqaa opened this issue Aug 9, 2020 · 2 comments

Comments

@ahmedalnaqaa
Copy link

Hello Everyone,

Is there a solution for rotating the text?

Thanks

@bostrom
Copy link
Owner

bostrom commented Aug 10, 2020

Hello @ahmedalnaqaa. There's no built in solution for text rotation at the moment, and I myself don't have much time to look into it, but I'm happy to accept PRs 🙂

@ronaldaug
Copy link

ronaldaug commented Sep 16, 2021

I try to rotate with jimp and it does work with just a few steps. However, it rotates the whole image instead of text.

const textToImage = require('text-to-image');
const Jimp = require('jimp');

async function rotateImage(img,name) {
    const image        = await Jimp.read(img);
    const rotate_angle = 10;
    image.rotate(rotate_angle).write('hello/'+name+'.png');
}
  
textToImage.generate('Hello world').then(datauri=>{
    let buff    = datauri.substring(22);
    const image = Buffer.from(buff,'base64');
    rotateImage(image,"filename");
})

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

No branches or pull requests

3 participants