Download the PHP package hankchen/php-canvas-next without Composer

On this page you can find all versions of the php package hankchen/php-canvas-next. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-canvas-next

php-canvas-next

hankchen/php-canvas 的下一代实现:图层树(纯结构)与渲染器(可插拔后端)彻底分离。

设计文档与对象交互图见 docs/design/layer-renderer-separation.md。

环境要求

安装

快速上手

单图层渲染:(new ImageRenderer())->renderLayer(new NullCancellation(), $layer)。

核心概念

结构与渲染分离

文本断行与度量

默认断行器为 UAX #14 简化实现:图素簇切分(emoji 不拆碎)、CJK 字间可断、 拉丁词边界优先、禁则处理(行首不出现 。,、;:!?」』)】 等,行末不出现 「『(【)。 默认度量器为字符启发式(半角 0.55 字宽),两者均可注入替换:

自定义远程资源下载器(代理、鉴权等):

结构树序列化

graph() 无损携带全部行/单元格/内容与字体完整路径,跨渲染端复用同一份结构。

从 php-canvas 迁移

旧(php-canvas) 新(php-canvas-next)
Canvas::make(...)->render()->save($p) (new ImageRenderer())->render($canvas)->save($p)
$layer->render() (new ImageRenderer())->renderLayer($layer)
Canvas::getCore() render() 的返回值即图像
setImage()/setFont() 立即下载 setter 只存引用,渲染前由 Resolver 统一物化
自定义下载器 $layer->setDownloader() new ImageRenderer(new ResourceResolver($downloader))
QrCodeLayer::generateQrCodeLayerFromContent($c) QrCodeLayer::setText($c)(物化自动进行)
graph() 的 rowTemplate/cellTemplates rows(全量)/cells;字体保存完整路径
— 新增 Canvas::fromGraph() 反序列化
远程资源缓存 sys_temp/canvas/ sys_temp/canvas-next/(可与旧库共存)
autowrap 字符数断行 UAX #14 简化断行(词边界 + 禁则),同一文本断行位置可能与旧库不同

旧库 hankchen/php-canvas 冻结维护、保持可用;新库不依赖旧库。

开发

渲染目验样图脚本位于 image-renderer 包:php scripts/visual-check.php。测试约定见 AGENTS.md。


All versions of php-canvas-next with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
endroid/qr-code Version ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hankchen/php-canvas-next contains the following files

Loading the files please wait ...