Skip to content

Commit

Permalink
text: Do not show text that's missing an embedded font
Browse files Browse the repository at this point in the history
Flash Player does not show any text that requires
an embedded font that is missing.
  • Loading branch information
kjarosh committed Dec 8, 2024
1 parent 0e40550 commit 92d88e2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions core/src/html/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,10 +660,10 @@ impl<'a, 'gc> LayoutContext<'a, 'gc> {
{
return font;
}
// TODO: If set to use embedded fonts and we couldn't find any matching font, show nothing
// However - at time of writing, we don't support DefineFont4. If we matched this behaviour,
// then a bunch of SWFs would just show no text suddenly.
// return new_empty_font(context, span, self.font_type);

// If set to use embedded fonts and we couldn't find any matching font, show nothing.
tracing::warn!("Embedded font not found: {font_name}, using an empty font");
return new_empty_font(context, span, self.font_type);
}

// Check if the font name is one of the known default fonts.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# There are no fonts embedded in this swf. It should not render anything at all, or error.

num_frames = 1
known_failure = true # Right now we intentionally fall back, because we don't support DefineFont4 embedded fonts yet

[image_comparisons.output]
tolerance = 0
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 92d88e2

Please sign in to comment.