PHPackages                             fruit/convas - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. fruit/convas

ActiveLibrary[CLI &amp; Console](/categories/cli)

fruit/convas
============

canvas for console

0.0.4(10y ago)066[2 issues](https://github.com/fruit-php/convas/issues)1PHP

Since Oct 28Pushed 10y ago1 watchersCompare

[ Source](https://github.com/fruit-php/convas)[ Packagist](https://packagist.org/packages/fruit/convas)[ RSS](/packages/fruit-convas/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (5)Used By (1)

Convas
======

[](#convas)

This package is part of Fruit Framework.

Convas is a console drawing library. Currently it supports only UTF-8 encoding.

[![Build Status](https://camo.githubusercontent.com/03cf91efbaafa319758cb34064cf21c915939fbd1883ae6790ddcbce19fefbc5/68747470733a2f2f7472617669732d63692e6f72672f526f6e6d692f66727569742d636f6e7661732e737667)](https://travis-ci.org/Ronmi/fruit-convas)

Synopsis
--------

[](#synopsis)

```
$buf = new Fruit\Convas\Buffer; // create a canvas, origin point is at top-left corner
$g = new Fruit\Convas\Graphics($buf); // allocate graphics object to paint on this canvas
$g
    ->transit(2, 3) // move origin to (2, 3)
    ->drawString(0, 0, 'a string')
    ->drawString(0, 1, '中文') // convas can handle (most of) CJK and graphical characters
    ->drawLine(0, 2, 55, 2) // draw a line from (0, 2) to (55, 2)
    ->drawLine(0, 2, 0, 15) // convas can handle cross point of lines and ellipses
    ->drawEllipse(2, 5, 55, 20) // draw an ellipse within the square (2, 5) (15, 20)
    ->setColor(new Fruit\Convas\Color(1, 37, 41)) // set color
    ->drawString(5, 12, 'highlighted, white text on red background');
echo implode("\n", $buf->exportAll()) . "\n";

$buf->clear(4, 8, 57, 23); // clear the area, take care of the origin point

$g->overwrite = true; // enable overwrite mode, color will always in overwrite mode.
$g->drawLine(5, 2, 5, 15); // no cross point handling
```

[![Lines, Ellipses, Wide characters](https://camo.githubusercontent.com/6e83bb4d9d2bbd5b168caf8fb172926c56e0c899237aa2af7b7db8bfded4ed02/687474703a2f2f692e696d6775722e636f6d2f396144485336532e706e67)](http://imgur.com/9aDHS6S)[![Block of text](https://camo.githubusercontent.com/cadf07fcce93c1e165c8c188cb62f9ff6681c01583bc44f134c78aa441d08636/687474703a2f2f692e696d6775722e636f6d2f38486a564869342e706e67)](http://imgur.com/8HjVHi4)

Wide characters
---------------

[](#wide-characters)

Convas detect wide characters (characters occupied two cells in console, most are CJK characters) using unicode blocks. Feel free to file an issue if any wide character is missing.

Algorithms, PR Plz!
-------------------

[](#algorithms-pr-plz)

The algorithms used to draw lines and ellipses are too simple to mark as stable. We need your help!

See [Issue#2](https://github.com/Ronmi/fruit-convas/issues/2) and [Issue#3](https://github.com/Ronmi/fruit-convas/issues/3).

License
-------

[](#license)

Any version of MIT, GPL or LGPL.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

4

Last Release

3897d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ef743a4ba2b41bc6643ca3c4d71f4608abee7dc617efa09b18e3fa0a44aeda8?d=identicon)[Ronmi](/maintainers/Ronmi)

---

Top Contributors

[![Ronmi](https://avatars.githubusercontent.com/u/59556?v=4)](https://github.com/Ronmi "Ronmi (27 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/fruit-convas/health.svg)

```
[![Health](https://phpackages.com/badges/fruit-convas/health.svg)](https://phpackages.com/packages/fruit-convas)
```

###  Alternatives

[illuminate/console

The Illuminate Console package.

13046.0M6.5k](/packages/illuminate-console)[styleci/cli

The CLI tool for StyleCI

71470.5k9](/packages/styleci-cli)[winbox/args

Windows command-line formatter

20720.9k21](/packages/winbox-args)[tomatophp/filament-artisan

Simple but yet powerful library for running some artisan commands for FilamentPHP

3275.4k1](/packages/tomatophp-filament-artisan)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
