|
1 |
| -use bevy_asset::{Asset, AssetEvent, AssetId, Assets}; |
| 1 | +use bevy_asset::{AssetEvent, AssetId, Assets}; |
2 | 2 | use bevy_ecs::{event::EventReader, resource::Resource, system::ResMut};
|
3 | 3 | use bevy_image::prelude::*;
|
4 | 4 | use bevy_math::{IVec2, UVec2};
|
@@ -53,19 +53,11 @@ pub struct FontAtlasKey(pub u32, pub FontSmoothing);
|
53 | 53 | ///
|
54 | 54 | /// Provides the interface for adding and retrieving rasterized glyphs, and manages the [`FontAtlas`]es.
|
55 | 55 | ///
|
56 |
| -/// A `FontAtlasSet` is an [`Asset`]. |
57 |
| -/// |
58 |
| -/// There is one `FontAtlasSet` for each font: |
59 |
| -/// - When a [`Font`] is loaded as an asset and then used in [`TextFont`](crate::TextFont), |
60 |
| -/// a `FontAtlasSet` asset is created from a weak handle to the `Font`. |
61 |
| -/// - ~When a font is loaded as a system font, and then used in [`TextFont`](crate::TextFont), |
62 |
| -/// a `FontAtlasSet` asset is created and stored with a strong handle to the `FontAtlasSet`.~ |
63 |
| -/// (*Note that system fonts are not currently supported by the `TextPipeline`.*) |
| 56 | +/// There is at most one `FontAtlasSet` for each font, stored in the `FontAtlasSets` resource. |
| 57 | +/// `FontAtlasSet`s are added and updated by the [`queue_text`](crate::pipeline::TextPipeline::queue_text) function. |
64 | 58 | ///
|
65 | 59 | /// A `FontAtlasSet` contains one or more [`FontAtlas`]es for each font size.
|
66 |
| -/// |
67 |
| -/// It is used by [`TextPipeline::queue_text`](crate::TextPipeline::queue_text). |
68 |
| -#[derive(Debug, TypePath, Asset)] |
| 60 | +#[derive(Debug, TypePath)] |
69 | 61 | pub struct FontAtlasSet {
|
70 | 62 | font_atlases: HashMap<FontAtlasKey, Vec<FontAtlas>>,
|
71 | 63 | }
|
|
0 commit comments