Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support loading font assets in data URLs (#8898)
- Loading branch information
1 parent
e1ea3a7
commit e1da86c
Showing
7 changed files
with
57 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export * from './checkExtension'; | ||
export * from './createTexture'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export function checkDataUrl(url: string, mimes: string | string[]): boolean | ||
{ | ||
if (Array.isArray(mimes)) | ||
{ | ||
for (const mime of mimes) | ||
{ | ||
if (url.startsWith(`data:${mime}`)) return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
return url.startsWith(`data:${mimes}`); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export * from './checkDataUrl'; | ||
export * from './checkExtension'; | ||
export * from './convertToList'; | ||
export * from './createStringVariations'; | ||
export * from './isSingleItem'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters