aboutsummaryrefslogtreecommitdiffstats
path: root/components/gfx/text/text_run.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/gfx/text/text_run.rs')
-rw-r--r--components/gfx/text/text_run.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/components/gfx/text/text_run.rs b/components/gfx/text/text_run.rs
index a411c7125db..56f66d6cd1f 100644
--- a/components/gfx/text/text_run.rs
+++ b/components/gfx/text/text_run.rs
@@ -17,7 +17,7 @@ use webrender_api::FontInstanceKey;
use xi_unicode::LineBreakLeafIter;
use crate::font::{Font, FontHandleMethods, FontMetrics, RunMetrics, ShapingFlags, ShapingOptions};
-use crate::platform::font_template::FontTemplateData;
+use crate::font_template::FontTemplateRefMethods;
use crate::text::glyph::{ByteIndex, GlyphStore};
thread_local! {
@@ -30,7 +30,8 @@ thread_local! {
pub struct TextRun {
/// The UTF-8 string represented by this text run.
pub text: Arc<String>,
- pub font_template: Arc<FontTemplateData>,
+ /// This ensures the data stays alive as long as this TextRun is using this font.
+ font_data: Arc<Vec<u8>>,
pub pt_size: Au,
pub font_metrics: FontMetrics,
pub font_key: FontInstanceKey,
@@ -193,7 +194,7 @@ impl<'a> TextRun {
TextRun {
text: Arc::new(text),
font_metrics: font.metrics.clone(),
- font_template: font.handle.template(),
+ font_data: font.handle.template().data(),
font_key: font.font_key,
pt_size: font.descriptor.pt_size,
glyphs: Arc::new(glyphs),