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

Set 2 fonts with different text in the same draw function? #54

Open
CristJian opened this issue May 17, 2020 · 0 comments
Open

Set 2 fonts with different text in the same draw function? #54

CristJian opened this issue May 17, 2020 · 0 comments

Comments

@CristJian
Copy link

Hi, how can I display 2 different fonts in the same text separated by a new line?

$font1 = "font1.ttf";
$font2 = "font2.ttf";
$text1 = "text";
$text2 = "text2";

$box = new Box($im);
$box->setFontFace($font1);
$box->setFontColor(new Color(255, 255, 255));
$box->setTextShadow(new Color(0, 0, 0, 50), 2, 2);
$box->setFontSize(35);
$box->setBox(100, 150, 500, 400);
$box->setTextAlign('center', 'center');
$box->draw($text1."\n".$text2); // here only displays the second text with the font1

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

1 participant