Skip to content

Commit

Permalink
fix: try to parse base64 encoded font.
Browse files Browse the repository at this point in the history
  • Loading branch information
andycall committed Jul 11, 2023
1 parent fb01547 commit f57acd0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions webf/lib/src/css/font_face.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ class CSSFontFace {
String tmp_content = tmp_src.split(';').last;
if (tmp_content.startsWith('base64')) {
String base64 = tmp_src.split(',').last;
Uint8List decoded = base64Decode(base64);
if (decoded.isNotEmpty) {
fonts.add(_Font.content(decoded));
}
try {
Uint8List decoded = base64Decode(base64);
if (decoded.isNotEmpty) {
fonts.add(_Font.content(decoded));
}
} catch(e) {}
}

} else {
Expand Down

0 comments on commit f57acd0

Please sign in to comment.