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

Write text on the picture. The height of single text is the same #1194

Closed
wanghousheng opened this issue Dec 3, 2022 · 0 comments
Closed

Comments

@wanghousheng
Copy link

    $text = "上饶市";
    $image = Image::canvas(count(mb_str_split($text))*60, 58);
    $image->text($text, count(mb_str_split($text))*30, 58, function ($font) {
        $font->file(base_path("/fonts/hanzi.ttf"));
        $font->size(58);
        $font->color('#FF3F30');
        $font->align('center');
        
    });
    return $image->response("png");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants