phplucidframe / console-table

ConsoleTable helps you to display tabular data in a terminal/shell/console
Other
99 stars 22 forks source link

Wrong spacing with emojis #15

Open lefuturiste opened 2 years ago

lefuturiste commented 2 years ago

Hi ! Thanks you for this library but there is an issue with emojis in general 😄📚.

Code that breaks

<?php
require_once __DIR__ . "/../vendor/autoload.php";

$table = new LucidFrame\Console\ConsoleTable();
$table = $table
  ->addHeader("A")
  ->addHeader("B")
  ->addRow()
    ->addColumn("📚")
    ->addColumn("Hello")
  ->addRow()
    ->addColumn("X")
    ->addColumn("Foo Bared")
  ->display();

Expected behavior:

image

Actual behavior:

image

Environment

Shell: fish 3.3.1 PHP 8.0.12 (cli) phplucidframe/console-table: ^1.2

PSF1 commented 9 months ago

I have the same problem :)

flip111 commented 9 months ago

Isn't this depending on the used font? Perhaps find a monospace font where smileys also occupy just 1 space