@@ -72,10 +72,8 @@ impl Default for SwashCache {
72
72
pub struct TextPipeline {
73
73
/// Identifies a font [`ID`](cosmic_text::fontdb::ID) by its [`Font`] [`Asset`](bevy_asset::Asset) [`HandleId`].
74
74
map_handle_to_font_id : HashMap < AssetId < Font > , cosmic_text:: fontdb:: ID > ,
75
- /// Identifies a [`FontAtlasSet`] handle by its font [`ID`](cosmic_text::fontdb::ID).
76
- ///
77
- /// Note that this is a strong handle, so that textures are not dropped.
78
- map_font_id_to_handle : HashMap < cosmic_text:: fontdb:: ID , Handle < FontAtlasSet > > ,
75
+ /// Identifies a [`FontAtlasSet`] by its font [`ID`](cosmic_text::fontdb::ID).
76
+ map_font_id_to_atlas : HashMap < cosmic_text:: fontdb:: ID , FontAtlasSet > ,
79
77
/// The font system is used to retrieve fonts and their information, including glyph outlines.
80
78
///
81
79
/// See [`cosmic_text::FontSystem`] for more information.
@@ -283,8 +281,6 @@ impl TextPipeline {
283
281
. map ( |( layout_glyph, line_w, line_y) | {
284
282
let section_index = layout_glyph. metadata ;
285
283
286
- // TODO(totalkrill): this is probably very wrong, investigate the
287
- // cause, instead of "what makes it compile"
288
284
let font_atlas_set: & mut FontAtlasSet = match sections[ section_index] . style . font {
289
285
FontRef :: Asset ( ref font_handle) => {
290
286
let handle: Handle < Font > = font_handle. clone_weak ( ) ;
@@ -303,12 +299,11 @@ impl TextPipeline {
303
299
weight : query. weight ,
304
300
metadata : 0 ,
305
301
} ) [ 0 ] ;
306
- let handle = self
307
- . map_font_id_to_handle
302
+ let atlas = self
303
+ . map_font_id_to_atlas
308
304
. entry ( font_id)
309
305
. or_default ( ) ;
310
-
311
- font_atlas_sets. get_mut ( handle. clone ( ) . untyped ( ) . id ( ) ) . unwrap ( )
306
+ atlas
312
307
}
313
308
} ;
314
309
0 commit comments