Skip to content

Commit cb781b8

Browse files
committed
core: Make ruffle_core::font module public
When adding more features and integrations to fonts (e.g. device fonts), more and more types are being used from the font module. This patch makes it public so that symbols from it don't have to be reexported manually.
1 parent 4ce34f5 commit cb781b8

File tree

11 files changed

+20
-21
lines changed

11 files changed

+20
-21
lines changed

core/src/html/layout.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
33
use crate::context::UpdateContext;
44
use crate::drawing::Drawing;
5-
use crate::font::{EvalParameters, Font, FontLike, FontSet, FontType};
5+
use crate::font::{DefaultFont, EvalParameters, Font, FontLike, FontSet, FontType};
66
use crate::html::dimensions::{BoxBounds, Position, Size};
77
use crate::html::text_format::{FormatSpans, TextFormat, TextSpan};
88
use crate::string::{utils as string_utils, WStr};
99
use crate::tag_utils::SwfMovie;
10-
use crate::DefaultFont;
1110
use gc_arena::Collect;
1211
use std::cmp::{max, min, Ordering};
1312
use std::fmt::{Debug, Formatter};

core/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ mod drawing;
2525
mod ecma_conversions;
2626
pub mod events;
2727
pub mod focus_tracker;
28-
mod font;
28+
pub mod font;
2929
mod frame_lifecycle;
3030
mod html;
3131
mod input;
@@ -59,7 +59,6 @@ pub mod stub;
5959

6060
pub use context_menu::ContextMenuItem;
6161
pub use events::PlayerEvent;
62-
pub use font::{DefaultFont, FontFileData, FontQuery, FontType};
6362
pub use indexmap;
6463
pub use loader::LoadBehavior;
6564
pub use player::{Player, PlayerBuilder, PlayerMode, PlayerRuntime, StaticCallstack};

core/src/library.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use ruffle_render::bitmap::BitmapHandle;
1515
use ruffle_render::utils::remove_invalid_jpeg_data;
1616

1717
use crate::backend::ui::{FontDefinition, UiBackend};
18-
use crate::DefaultFont;
18+
use crate::font::DefaultFont;
1919
use fnv::{FnvHashMap, FnvHashSet};
2020
use std::collections::HashMap;
2121
use std::sync::{Arc, Weak};

core/src/player.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ use crate::events::{ButtonKeyCode, ClipEvent, ClipEventResult, KeyCode, MouseBut
3232
use crate::external::{ExternalInterface, ExternalInterfaceProvider, NullFsCommandProvider};
3333
use crate::external::{FsCommandProvider, Value as ExternalValue};
3434
use crate::focus_tracker::NavigationDirection;
35+
use crate::font::DefaultFont;
3536
use crate::frame_lifecycle::{run_all_phases_avm2, FramePhase};
3637
use crate::input::InputEvent;
3738
use crate::input::InputManager;
@@ -50,7 +51,7 @@ use crate::system_properties::SystemProperties;
5051
use crate::tag_utils::SwfMovie;
5152
use crate::timer::Timers;
5253
use crate::vminterface::Instantiator;
53-
use crate::{DefaultFont, DEFAULT_PLAYER_VERSION};
54+
use crate::DEFAULT_PLAYER_VERSION;
5455
use async_channel::Sender;
5556
use gc_arena::lock::GcRefLock;
5657
use gc_arena::{Collect, DynamicRootSet, Mutation, Rootable};

desktop/src/backends/ui.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use ruffle_core::backend::ui::{
1414
DialogLoaderError, DialogResultFuture, FileDialogResult, FileFilter, FontDefinition,
1515
FullscreenError, LanguageIdentifier, MouseCursor, UiBackend,
1616
};
17-
use ruffle_core::{FontFileData, FontQuery};
17+
use ruffle_core::font::{FontFileData, FontQuery};
1818
use std::fs::File;
1919
use std::path::Path;
2020
use std::rc::Rc;

desktop/src/player.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ use anyhow::anyhow;
1212
use ruffle_core::backend::navigator::{OwnedFuture, SocketMode};
1313
use ruffle_core::config::Letterbox;
1414
use ruffle_core::events::{GamepadButton, KeyCode};
15-
use ruffle_core::{DefaultFont, LoadBehavior, Player, PlayerBuilder, PlayerEvent};
15+
use ruffle_core::font::DefaultFont;
16+
use ruffle_core::{LoadBehavior, Player, PlayerBuilder, PlayerEvent};
1617
use ruffle_frontend_utils::backends::audio::CpalAudioBackend;
1718
use ruffle_frontend_utils::backends::navigator::{ExternalNavigatorBackend, FutureSpawner};
1819
use ruffle_frontend_utils::bundle::source::BundleSourceError;

tests/framework/src/backends/ui.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ use std::collections::HashMap;
22

33
use crate::test::Font;
44
use chrono::{DateTime, Utc};
5-
use ruffle_core::{
6-
FontFileData, FontQuery,
7-
backend::ui::{
8-
DialogLoaderError, DialogResultFuture, FileDialogResult, FileFilter, FontDefinition,
9-
FullscreenError, LanguageIdentifier, MouseCursor, US_ENGLISH, UiBackend,
10-
},
5+
use ruffle_core::backend::ui::{
6+
DialogLoaderError, DialogResultFuture, FileDialogResult, FileFilter, FontDefinition,
7+
FullscreenError, LanguageIdentifier, MouseCursor, US_ENGLISH, UiBackend,
118
};
9+
use ruffle_core::font::{FontFileData, FontQuery};
1210
use url::Url;
1311

1412
/// A simulated file dialog response, for use in tests

tests/framework/src/options/font.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
use ruffle_core::{DefaultFont, FontQuery, FontType, Player};
1+
use ruffle_core::Player;
2+
use ruffle_core::font::{DefaultFont, FontQuery, FontType};
23
use serde::Deserialize;
34

45
#[derive(Deserialize, Default, Clone)]

tests/framework/src/test.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ use crate::options::TestOptions;
55
use crate::runner::TestRunner;
66
use crate::util::read_bytes;
77
use anyhow::{Result, anyhow};
8-
use ruffle_core::{FontQuery, FontType, tag_utils::SwfMovie};
8+
use ruffle_core::font::{FontQuery, FontType};
9+
use ruffle_core::tag_utils::SwfMovie;
910
use ruffle_input_format::InputInjector;
1011
use ruffle_socket_format::SocketEvent;
1112
use vfs::VfsPath;

web/src/builder.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ use ruffle_core::backend::ui::FontDefinition;
1111
use ruffle_core::compatibility_rules::CompatibilityRules;
1212
use ruffle_core::config::{Letterbox, NetworkingAccessMode};
1313
use ruffle_core::events::{GamepadButton, KeyCode};
14-
use ruffle_core::{
15-
Color, DefaultFont, Player, PlayerBuilder, PlayerRuntime, StageAlign, StageScaleMode, swf,
16-
};
17-
use ruffle_core::{FontFileData, ttf_parser};
14+
use ruffle_core::font::{DefaultFont, FontFileData};
15+
use ruffle_core::ttf_parser;
16+
use ruffle_core::{Color, Player, PlayerBuilder, PlayerRuntime, StageAlign, StageScaleMode, swf};
1817
use ruffle_render::backend::RenderBackend;
1918
use ruffle_render::quality::StageQuality;
2019
use ruffle_video_external::backend::ExternalVideoBackend;

0 commit comments

Comments
 (0)