Skip to content

Commit

Permalink
Load Emoji Font to support Emoji Characters (#42)
Browse files Browse the repository at this point in the history
* Add "Noto Color Emoji" Font to Chromium

* Update Tests
  • Loading branch information
stefanzweifel authored Dec 28, 2022
1 parent 80e963c commit 3a32441
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions resources/lambda/browsershot.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ exports.handle = async function (event) {
return;
}

// Add Emoji Font to Chromium
await chromium.font('https://raw.githack.com/googlei18n/noto-emoji/master/fonts/NotoColorEmoji.ttf');

// Constant file where we write out options.
const options = '/tmp/browsershot.js';

Expand Down
3 changes: 1 addition & 2 deletions tests/BrowsershotLambdaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

it('generates screenshot from html', function () {
$this->assertFileDoesNotExist('example.jpg');
BrowsershotLambda::html('<h1>Hello world!!</h1>')->save('example.jpg');
BrowsershotLambda::html('<h1>Hello world!! 👋🦫🫠</h1>')->save('example.jpg');
$this->assertFileExists('example.jpg');
});

Expand Down Expand Up @@ -69,7 +69,6 @@
->bodyHtml();
})->expectException(LambdaExecutionException::class);


it('stores screenshot on s3 bucket', function () {
$this->assertFalse(Storage::disk('s3')->exists('example.jpg'));

Expand Down

0 comments on commit 3a32441

Please sign in to comment.