Skip to content

Commit

Permalink
merges upstream examples from #96
Browse files Browse the repository at this point in the history
  • Loading branch information
ffflabs committed Apr 25, 2021
2 parents b901ba4 + bc2944e commit 43eab82
Show file tree
Hide file tree
Showing 20 changed files with 115 additions and 95 deletions.
9 changes: 5 additions & 4 deletions Examples/examples_led/ledex1.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

require_once __DIR__ . '/../../src/config.inc.php';
use Amenadiel\JpGraph\Image;

use Amenadiel\JpGraph\Image\DigitalLED74;

// By default each "LED" circle has a radius of 3 pixels
$led = new Image\DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL ', Image\Configs::getConfig('LEDC_GREEN'));
$led = new DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', LEDC_GREEN);
11 changes: 6 additions & 5 deletions Examples/examples_led/ledex10.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

use Amenadiel\JpGraph\Image\DigitalLED74;

require_once __DIR__ . '/../../src/config.inc.php';
// By default each "LED" circle has a radius of 3 pixels
use Amenadiel\JpGraph\Image;

$led = new Image\DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', Image\Configs::getConfig('LEDC_KHAKI'));
// By default each "LED" circle has a radius of 3 pixels
$led = new DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', LEDC_KHAKI);
11 changes: 6 additions & 5 deletions Examples/examples_led/ledex11.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

use Amenadiel\JpGraph\Image\DigitalLED74;

require_once __DIR__ . '/../../src/config.inc.php';
// By default each "LED" circle has a radius of 3 pixels
use Amenadiel\JpGraph\Image;

$led = new Image\DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', Image\Configs::getConfig('LEDC_OLIVE'));
// By default each "LED" circle has a radius of 3 pixels
$led = new DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', LEDC_OLIVE);
11 changes: 6 additions & 5 deletions Examples/examples_led/ledex12.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

use Amenadiel\JpGraph\Image\DigitalLED74;

require_once __DIR__ . '/../../src/config.inc.php';
// By default each "LED" circle has a radius of 3 pixels
use Amenadiel\JpGraph\Image;

$led = new Image\DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', Image\Configs::getConfig('LEDC_LIMEGREEN'));
// By default each "LED" circle has a radius of 3 pixels
$led = new DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', LEDC_LIMEGREEN);
11 changes: 6 additions & 5 deletions Examples/examples_led/ledex13.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

use Amenadiel\JpGraph\Image\DigitalLED74;

require_once __DIR__ . '/../../src/config.inc.php';
// By default each "LED" circle has a radius of 3 pixels
use Amenadiel\JpGraph\Image;

$led = new Image\DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', Image\Configs::getConfig('LEDC_FORESTGREEN'));
// By default each "LED" circle has a radius of 3 pixels
$led = new DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', LEDC_FORESTGREEN);
11 changes: 6 additions & 5 deletions Examples/examples_led/ledex14.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

use Amenadiel\JpGraph\Image\DigitalLED74;

require_once __DIR__ . '/../../src/config.inc.php';
// By default each "LED" circle has a radius of 3 pixels
use Amenadiel\JpGraph\Image;

$led = new Image\DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', Image\Configs::getConfig('LEDC_TEAL'));
// By default each "LED" circle has a radius of 3 pixels
$led = new DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', LEDC_TEAL);
11 changes: 6 additions & 5 deletions Examples/examples_led/ledex15.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

use Amenadiel\JpGraph\Image\DigitalLED74;

require_once __DIR__ . '/../../src/config.inc.php';
// By default each "LED" circle has a radius of 3 pixels
use Amenadiel\JpGraph\Image;

$led = new Image\DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', Image\Configs::getConfig('LEDC_STEELBLUE'));
// By default each "LED" circle has a radius of 3 pixels
$led = new DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', LEDC_STEELBLUE);
11 changes: 6 additions & 5 deletions Examples/examples_led/ledex16.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

use Amenadiel\JpGraph\Image\DigitalLED74;

require_once __DIR__ . '/../../src/config.inc.php';
// By default each "LED" circle has a radius of 3 pixels
use Amenadiel\JpGraph\Image;

$led = new Image\DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', Image\Configs::getConfig('LEDC_NAVY'));
// By default each "LED" circle has a radius of 3 pixels
$led = new DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', LEDC_NAVY);
11 changes: 6 additions & 5 deletions Examples/examples_led/ledex17.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

use Amenadiel\JpGraph\Image\DigitalLED74;

require_once __DIR__ . '/../../src/config.inc.php';
// By default each "LED" circle has a radius of 3 pixels
use Amenadiel\JpGraph\Image;

$led = new Image\DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', Image\Configs::getConfig('LEDC_INVERTGRAY'));
// By default each "LED" circle has a radius of 3 pixels
$led = new DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', LEDC_INVERTGRAY);
11 changes: 6 additions & 5 deletions Examples/examples_led/ledex2.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

use Amenadiel\JpGraph\Image\DigitalLED74;

require_once __DIR__ . '/../../src/config.inc.php';
// By default each "LED" circle has a radius of 3 pixels
use Amenadiel\JpGraph\Image;

$led = new Image\DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', Image\Configs::getConfig('LEDC_RED'));
// By default each "LED" circle has a radius of 3 pixels
$led = new DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', LEDC_RED);
12 changes: 7 additions & 5 deletions Examples/examples_led/ledex3.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

use Amenadiel\JpGraph\Image\DigitalLED74;

require_once __DIR__ . '/../../src/config.inc.php';
// By default each "LED" circle has a radius of 3 pixels
use Amenadiel\JpGraph\Image;

$led = new Image\DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', Image\Configs::getConfig('LEDC_YELLOW'));

// By default each "LED" circle has a radius of 3 pixels
$led = new DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', LEDC_YELLOW);
11 changes: 6 additions & 5 deletions Examples/examples_led/ledex4.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

use Amenadiel\JpGraph\Image\DigitalLED74;

require_once __DIR__ . '/../../src/config.inc.php';
// By default each "LED" circle has a radius of 3 pixels. Change to 5 and slghtly smaller margin
use Amenadiel\JpGraph\Image;

$led = new Image\DigitalLED74(6);
// By default each "LED" circle has a radius of 3 pixels. Change to 5 and slghtly smaller margin
$led = new DigitalLED74(6);
$led->SetSupersampling(1);
$led->StrokeNumber('123.', Image\Configs::getConfig('LEDC_RED'));
$led->StrokeNumber('123.', LEDC_RED);
11 changes: 6 additions & 5 deletions Examples/examples_led/ledex5.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

use Amenadiel\JpGraph\Image\DigitalLED74;

require_once __DIR__ . '/../../src/config.inc.php';
// By default each "LED" circle has a radius of 3 pixels
use Amenadiel\JpGraph\Image;

$led = new Image\DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', Image\Configs::getConfig('LEDC_BLUE'));
// By default each "LED" circle has a radius of 3 pixels
$led = new DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', LEDC_BLUE);
11 changes: 6 additions & 5 deletions Examples/examples_led/ledex6.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

use Amenadiel\JpGraph\Image\DigitalLED74;

require_once __DIR__ . '/../../src/config.inc.php';
// By default each "LED" circle has a radius of 3 pixels
use Amenadiel\JpGraph\Image;

$led = new Image\DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', Image\Configs::getConfig('LEDC_GRAY'));
// By default each "LED" circle has a radius of 3 pixels
$led = new DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', LEDC_GRAY);
11 changes: 6 additions & 5 deletions Examples/examples_led/ledex7.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

use Amenadiel\JpGraph\Image\DigitalLED74;

require_once __DIR__ . '/../../src/config.inc.php';
// By default each "LED" circle has a radius of 3 pixels
use Amenadiel\JpGraph\Image;

$led = new Image\DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', Image\Configs::getConfig('LEDC_CHOCOLATE'));
// By default each "LED" circle has a radius of 3 pixels
$led = new DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', LEDC_CHOCOLATE);
11 changes: 6 additions & 5 deletions Examples/examples_led/ledex8.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

use Amenadiel\JpGraph\Image\DigitalLED74;

require_once __DIR__ . '/../../src/config.inc.php';
// By default each "LED" circle has a radius of 3 pixels
use Amenadiel\JpGraph\Image;

$led = new Image\DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', Image\Configs::getConfig('LEDC_PERU'));
// By default each "LED" circle has a radius of 3 pixels
$led = new DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', LEDC_PERU);
11 changes: 6 additions & 5 deletions Examples/examples_led/ledex9.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

use Amenadiel\JpGraph\Image\DigitalLED74;

require_once __DIR__ . '/../../src/config.inc.php';
// By default each "LED" circle has a radius of 3 pixels
use Amenadiel\JpGraph\Image;

$led = new Image\DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', Image\Configs::getConfig('LEDC_GOLDENROD'));
// By default each "LED" circle has a radius of 3 pixels
$led = new DigitalLED74();
$led->StrokeNumber('0123456789. ABCDEFGHIJKL', LEDC_GOLDENROD);
11 changes: 6 additions & 5 deletions Examples/examples_led/ledex_cyrillic.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

use Amenadiel\JpGraph\Image\DigitalLED74;

require_once __DIR__ . '/../../src/config.inc.php';
// By default each "LED" circle has a radius of 3 pixels. Change to 5 and slghtly smaller margin
use Amenadiel\JpGraph\Image;

$led = new Image\DigitalLED74(3);
// By default each "LED" circle has a radius of 3 pixels. Change to 5 and slghtly smaller margin
$led = new DigitalLED74(3);
$led->SetSupersampling(2);
$text = 'А' .
'Б' .
Expand All @@ -26,4 +27,4 @@
'Н' .
'О' .
'П';
$led->StrokeNumber($text, Image\Configs::getConfig('LEDC_RED'));
$led->StrokeNumber($text, LEDC_RED);
11 changes: 6 additions & 5 deletions Examples/examples_led/ledex_cyrillic2.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?php

/**
* JPGraph v4.1.0-beta.01
* JPGraph v4.0.3
*/

use Amenadiel\JpGraph\Image\DigitalLED74;

require_once __DIR__ . '/../../src/config.inc.php';
// By default each "LED" circle has a radius of 3 pixels. Change to 5 and slghtly smaller margin
use Amenadiel\JpGraph\Image;

$led = new Image\DigitalLED74(3);
// By default each "LED" circle has a radius of 3 pixels. Change to 5 and slghtly smaller margin
$led = new DigitalLED74(3);
$led->SetSupersampling(2);
$text = 'Р' .
'С' .
Expand All @@ -26,4 +27,4 @@
'Э' .
'Ю' .
'Я';
$led->StrokeNumber($text, Image\Configs::getConfig('LEDC_RED'));
$led->StrokeNumber($text, LEDC_RED);
2 changes: 1 addition & 1 deletion src/image/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ public function imagettfbbox_fixed($size, $angle, $fontfile, $text)
// we calculate this manually by getting the bounding box at
// angle = 0 and then rotate the bounding box manually
$bbox = @imagettfbbox($size, 0, $fontfile, $text);
if ($bbox === false) {
if ($bbox === false && !is_readable($this->font_file)) {
Util\JpGraphError::RaiseL(25092, $this->font_file);
//("There is either a configuration problem with TrueType or a problem reading font file (".$this->font_file."). Make sure file exists and is in a readable place for the HTTP process. (If 'basedir' restriction is enabled in PHP then the font file must be located in the document root.). It might also be a wrongly installed FreeType library. Try uppgrading to at least FreeType 2.1.13 and recompile GD with the correct setup so it can find the new FT library.");
}
Expand Down

0 comments on commit 43eab82

Please sign in to comment.