Skip to content

Commit

Permalink
Introduce some Uint8Array.prototype.toBase64 usage in the main code…
Browse files Browse the repository at this point in the history
  • Loading branch information
Snuffleupagus committed Apr 10, 2024
1 parent e97ba47 commit 87bc34c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/display/font_loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import {
assert,
bytesToString,
FeatureTest,
isNodeJS,
shadow,
Expand Down Expand Up @@ -409,9 +408,8 @@ class FontFaceObject {
if (!this.data || this.disableFontFace) {
return null;
}
const data = bytesToString(this.data);
// Add the @font-face rule to the document.
const url = `url(data:${this.mimetype};base64,${btoa(data)});`;
const url = `url(data:${this.mimetype};base64,${this.data.toBase64()});`;
let rule;
if (!this.cssFontInfo) {
rule = `@font-face {font-family:"${this.loadedName}";src:${url}}`;
Expand Down

0 comments on commit 87bc34c

Please sign in to comment.