Skip to content

Commit 1d2bfdc

Browse files
committed
FontFile Fallback documentation and fix
1 parent 3ec7127 commit 1d2bfdc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ Two fonts are included:
7272
* /fonts/NotoSans-Medium.otf
7373
* /fonts/NotoSans-Regular.otf
7474

75-
The method automatically appends __DIR__ to it, so the font will be: ````__DIR__ . '/fonts/OpenSans-Regular.ttf'````
75+
The method will look for the font, if none found it will append __DIR__ and try again, and if not it will default to the first GD Internal Font.
76+
If you input an integer between 1 and 5, it will use a GD Internal font as per that number.
7677

7778
````php
7879
// will be Semibold

src/InitialAvatar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ private function makeAvatar($image)
311311
}
312312

313313
return $avatar->text($name, $size / 2, $size / 2, function ($font) use ($size, $color, $fontFile, $fontSize) {
314-
$font->file(__DIR__.$fontFile);
314+
$font->file($fontFile);
315315
$font->size($size * $fontSize);
316316
$font->color($color);
317317
$font->align('center');

0 commit comments

Comments
 (0)