swen100 /
cairo
| 1 | <?php |
||
| 2 | |||
| 3 | use Cairo\Context; |
||
|
0 ignored issues
–
show
|
|||
| 4 | use Cairo\FontOptions; |
||
|
0 ignored issues
–
show
The type
Cairo\FontOptions was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 5 | use Cairo\HintMetrics; |
||
|
0 ignored issues
–
show
The type
Cairo\HintMetrics was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 6 | use Cairo\HintStyle; |
||
|
0 ignored issues
–
show
The type
Cairo\HintStyle was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 7 | use Cairo\Surface\Image; |
||
|
0 ignored issues
–
show
The type
Cairo\Surface\Image was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 8 | use Cairo\Surface\ImageFormat; |
||
|
0 ignored issues
–
show
The type
Cairo\Surface\ImageFormat was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 9 | |||
| 10 | $width = 247; |
||
| 11 | $height = 26; |
||
| 12 | |||
| 13 | $surface = new Image(ImageFormat::ARGB32, $width, $height); |
||
| 14 | $context = new Context($surface); |
||
| 15 | $context->selectFontFace('6x13.pcf'); |
||
| 16 | $context->setFontSize(11.5); |
||
| 17 | |||
| 18 | $fo = new FontOptions(); |
||
| 19 | $fo->setHintMetrics(HintMetrics::ON); |
||
| 20 | |||
| 21 | $context->setFontOptions($fo); |
||
| 22 | $fe = $context->getFontExtents(); |
||
| 23 | $context->moveTo(1, $fe['ascent'] - 1); |
||
| 24 | $context->setSourceRgb(0, 0, 1); |
||
| 25 | $fo->setHintStyle(HintStyle::NONE); |
||
| 26 | $context->setFontOptions($fo); |
||
| 27 | $context->showText('the '); |
||
| 28 | $fo->setHintStyle(HintStyle::SLIGHT); |
||
| 29 | $context->setFontOptions($fo); |
||
| 30 | $context->showText('quick '); |
||
| 31 | $fo->setHintStyle(HintStyle::MEDIUM); |
||
| 32 | $context->setFontOptions($fo); |
||
| 33 | $context->showText('brown'); |
||
| 34 | $fo->setHintStyle(HintStyle::FULL); |
||
| 35 | $context->setFontOptions($fo); |
||
| 36 | $context->showText(' fox'); |
||
| 37 | |||
| 38 | $context->textPath(' jumps over a lazy dog'); |
||
| 39 | $context->fill(); |
||
| 40 | |||
| 41 | $context->translate($width, $height); |
||
| 42 | $context->rotate(M_PI); |
||
| 43 | |||
| 44 | $context->moveTo(1, $fe['height'] - $fe['descent'] - 1); |
||
| 45 | $fo->setHintMetrics(HintMetrics::OFF); |
||
| 46 | $fo->setHintStyle(HintStyle::NONE); |
||
| 47 | $context->setFontOptions($fo); |
||
| 48 | $context->showText('the '); |
||
| 49 | $fo->setHintStyle(HintStyle::SLIGHT); |
||
| 50 | $context->setFontOptions($fo); |
||
| 51 | $context->showText('quick'); |
||
| 52 | $fo->setHintStyle(HintStyle::MEDIUM); |
||
| 53 | $context->setFontOptions($fo); |
||
| 54 | $context->showText(' brown'); |
||
| 55 | $fo->setHintStyle(HintStyle::FULL); |
||
| 56 | $context->setFontOptions($fo); |
||
| 57 | $context->showText(' fox'); |
||
| 58 | |||
| 59 | $context->textPath(' jumps over'); |
||
| 60 | $context->textPath(' a lazy dog'); |
||
| 61 | $context->fill(); |
||
| 62 | $surface->writeToPng(dirname(__FILE__).'/bitmap-font-php.png'); |
||
| 63 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths