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

[API] Drawer->text takes AbstractFont as parameter #493

Open
piotaixr opened this issue Apr 11, 2016 · 2 comments
Open

[API] Drawer->text takes AbstractFont as parameter #493

piotaixr opened this issue Apr 11, 2016 · 2 comments

Comments

@piotaixr
Copy link

Shouldn't it be taking a FontInterface instead?

My code looks like this:

$text = 'blah';
$font = $this->imagine->font($this->fontPath, 12, $image->palette()->color('#FFFFFF'));
$image->draw()->text($text, $font, new Point(1,1));

But PhpStorm complains about the type of $font (expects AbstractFont, got FontInterface). Am I doing sth wrong?

EDIT: using version 0.6.3

@vinikey
Copy link

vinikey commented Aug 6, 2019

Hello!

Is it possible to make 2-3 examples about the use of draw()->text, cause is really difficult to understand the doc page (https://imagine.readthedocs.io/en/stable/usage/drawing.html#text) and what do you mean with the Font class, since we have only AbstractFont and FontInterface classes.

Text on images is one of the most important tasks on image manipulation and any help on this would be so appreciated!

Thank you!

@mlocati
Copy link
Collaborator

mlocati commented Aug 6, 2019

we have only AbstractFont and FontInterface classes.

Nope: we also have the Imagine\Gd\Font, Imagine\Imagick\Font, and Imagine\Gmagick\Font classes:

image

In order to see some examples, you can look at the tests (this one for example).

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

No branches or pull requests

3 participants