Skip to content

Commit e64b2ed

Browse files
committed
Fix Font Exception
1 parent eb25785 commit e64b2ed

18 files changed

+182
-33
lines changed

PHP_VERSIONS

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
8.5
2-
8.4
3-
8.3
4-
8.2
51
8.1
2+
8.2
3+
8.3
4+
8.4
5+
8.5

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ composer require macocci7/php-scatterplot
8080

8181
$sp = new Scatterplot();
8282
$sp->layers($layers)
83-
->create('img/BasicUsage.png');
83+
->create(__DIR__ . '/img/BasicUsage.png');
8484
```
8585

8686
- Result: [examples/img/BasicUsage.png](examples/img/BasicUsage.png)
@@ -138,7 +138,7 @@ composer require macocci7/php-scatterplot
138138
->labelX('Data X')
139139
->labelY('Data Y')
140140
->caption('Using Layers')
141-
->create('img/UsingLayers.png');
141+
->create(__DIR__ . '/img/UsingLayers.png');
142142
```
143143

144144
- Result: [examples/img/UsingLayers.png](examples/img/UsingLayers.png)
@@ -206,7 +206,7 @@ composer require macocci7/php-scatterplot
206206
->labelY('DATA Y')
207207
->caption('SCATTER PLOT')
208208
->legends($legends)
209-
->create('img/AdjustDisplayByMethods.png');
209+
->create(__DIR__ . '/img/AdjustDisplayByMethods.png');
210210
```
211211

212212
- Result: [examples/img/AdjustDisplayByMethods.png](examples/img/AdjustDisplayByMethods.png)
@@ -357,8 +357,8 @@ Second, Code PHP like this:
357357

358358
$sp = new Scatterplot();
359359
$sp->layers($layers)
360-
->config('AdjustDisplayByNeon.neon')
361-
->create('img/AdjustDisplayByNeon.png');
360+
->config(__DIR__ . '/AdjustDisplayByNeon.neon')
361+
->create(__DIR__ . '/img/AdjustDisplayByNeon.png');
362362
```
363363

364364
Then, run the PHP code.
@@ -416,7 +416,7 @@ Then, run the PHP code.
416416
'yLimitUpper' => 12,
417417
'yLimitLower' => 0,
418418
'plotDiameter' => 6,
419-
//'fontPath' => 'fonts/ipaexg.ttf', // IPA ex Gothic 00401
419+
//'fontPath' => __DIR__ . '/fonts/ipaexg.ttf', // IPA ex Gothic 00401
420420
//'fontSize' => 16,
421421
//'fontColor' => '#333333',
422422
'referenceLineX' => true,
@@ -467,7 +467,7 @@ Then, run the PHP code.
467467
$sp = new Scatterplot();
468468
$sp->layers($layers)
469469
->config($conf)
470-
->create('img/AdjustDisplayByArray.png');
470+
->create(__DIR__ . '/img/AdjustDisplayByArray.png');
471471
```
472472

473473
- Result: [examples/img/AdjustDisplayByArray.png](examples/img/AdjustDisplayByArray.png)
@@ -506,12 +506,12 @@ Then, run the PHP code.
506506

507507
$sp = new Scatterplot();
508508
$sp->layers($layers)
509-
->config('AdjustDisplayByNeon.neon')
509+
->config(__DIR__ . '/AdjustDisplayByNeon.neon')
510510
->config([
511511
// This results in transparent backgournd
512512
'canvasBackgroundColor' => null,
513513
])
514-
->create('img/TransparentBackground.png');
514+
->create(__DIR__ . '/img/TransparentBackground.png');
515515
```
516516

517517
- Result: [examples/img/TransparentBackground.png](examples/img/TransparentBackground.png)
@@ -662,4 +662,4 @@ Then, run the PHP code.
662662

663663
***
664664

665-
Copyright 2023 - 2025 macocci7.
665+
Copyright 2023 - 2026 macocci7.

conf/Plotter.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ props:
2828
#yLimitLower:
2929
plotDiameter: 2
3030
plotColor: '#000000'
31-
fontPath: 'fonts/ipaexg.ttf' # IPA ex Gothic 00401
31+
#fontPath: 'fonts/ipaexg.ttf' # IPA ex Gothic 00401
3232
#fontPath: 'fonts/ipaexm.ttf' # IPA ex Mincho 00401
3333
fontSize: 16
3434
fontColor: '#333333'

conf/Scatterplot.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ validConfig:
4343
type: int
4444
plotColor:
4545
type: colorCode|null
46-
fontPath:
47-
type: string
4846
fontSize:
4947
type: number
5048
fontColor:

examples/AdjustDisplayByArray.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
'yLimitUpper' => 12,
4343
'yLimitLower' => 0,
4444
'plotDiameter' => 6,
45-
//'fontPath' => 'fonts/ipaexg.ttf', // IPA ex Gothic 00401
45+
//'fontPath' => __DIR__ . '/fonts/ipaexg.ttf', // IPA ex Gothic 00401
4646
//'fontSize' => 16,
4747
//'fontColor' => '#333333',
4848
'referenceLineX' => true,
@@ -93,4 +93,4 @@
9393
$sp = new Scatterplot();
9494
$sp->layers($layers)
9595
->config($conf)
96-
->create('img/AdjustDisplayByArray.png');
96+
->create(__DIR__ . '/img/AdjustDisplayByArray.png');

examples/AdjustDisplayByMethods.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
|yLimitLower|0|
4141
|plotDiameter|4|
4242
|plotColor|#33cccc|
43-
|fontPath|fonts/ipaexg.ttf|
4443
|fontSize|16|
4544
|fontColor|#333333|
4645
|regressionLine|`true`|

examples/AdjustDisplayByMethods.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
->labelY('DATA Y')
4848
->caption('SCATTER PLOT')
4949
->legends($legends)
50-
->create('img/AdjustDisplayByMethods.png');
50+
->create(__DIR__ . '/img/AdjustDisplayByMethods.png');
5151

5252
// Markdown -------------------------------------
5353

examples/AdjustDisplayByNeon.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525

2626
$sp = new Scatterplot();
2727
$sp->layers($layers)
28-
->config('AdjustDisplayByNeon.neon')
29-
->create('img/AdjustDisplayByNeon.png');
28+
->config(__DIR__ . '/AdjustDisplayByNeon.neon')
29+
->create(__DIR__ . '/img/AdjustDisplayByNeon.png');

examples/BasicUsage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
$sp = new Scatterplot();
1515
$sp->layers($layers)
16-
->create('img/BasicUsage.png');
16+
->create(__DIR__ . '/img/BasicUsage.png');
1717

1818
// Markdown -------------------------------------
1919

examples/Matrix.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Macocci7\PhpCsv\Csv;
77
use Macocci7\PhpScatterplot\Scatterplot;
88

9-
$cu = new Csv('csv/weather_tokyo.csv');
9+
$cu = new Csv(__DIR__ . '/csv/weather_tokyo.csv');
1010
$cb = new Combination();
1111

1212
$cu->encode('SJIS', 'UTF-8')
@@ -41,7 +41,7 @@
4141
->labelX($dictionary[$heads[$x]])
4242
->labelY($dictionary[$heads[$y]])
4343
->caption('Weather in Tokyo : ' . $days[0] . '' . $days[count($days) - 1])
44-
->create(sprintf("img/Matrix%02d.png", $index));
44+
->create(sprintf(__DIR__ . "/img/Matrix%02d.png", $index));
4545
$parsed[] = $sp->parse($layers);
4646
}
4747

0 commit comments

Comments
 (0)