Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@CristJian

Description

@CristJian

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions