Skip to content

Commit

Permalink
Implement SvgTextSizeCalculator
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Komarev authored and antonkomarev committed Jan 4, 2024
1 parent d54c56d commit 14c590e
Show file tree
Hide file tree
Showing 5 changed files with 325 additions and 1 deletion.
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,7 @@
"branch-alias": {
"dev-master": "2.x-dev"
}
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
15 changes: 15 additions & 0 deletions spec/PUGX/Poser/Calculator/GDTextSizeCalculatorSpec.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace spec\PUGX\Poser\Calculator;

use PhpSpec\ObjectBehavior;

class GDTextSizeCalculatorSpec extends ObjectBehavior
{
public function it_should_compute_text_width(): void
{
$this->calculateWidth('MIT', 8)->shouldBeLike(24);
$this->calculateWidth('MIT', 10)->shouldBeLike(29);
$this->calculateWidth('MIT', 14)->shouldBeLike(34);
}
}
15 changes: 15 additions & 0 deletions spec/PUGX/Poser/Calculator/SvgTextSizeCalculatorSpec.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace spec\PUGX\Poser\Calculator;

use PhpSpec\ObjectBehavior;

class SvgTextSizeCalculatorSpec extends ObjectBehavior
{
public function it_should_compute_text_width(): void
{
$this->calculateWidth('MIT', 8)->shouldBeLike(25);
$this->calculateWidth('MIT', 10)->shouldBeLike(29);
$this->calculateWidth('MIT', 14)->shouldBeLike(36);
}
}
Loading

0 comments on commit 14c590e

Please sign in to comment.