commit 92574562fa344a939ef9edf50d6e043bf355a95a
parent ddd07383c72bad1f0b74bc6f6b659ea891728f73
Author: Jonathan Kew <jkew@mozilla.com>
Date: Fri, 14 Nov 2025 21:19:38 +0000
Bug 2000190 - Annotate uses of newly-deprecated dwrote functions in wr_glyph_rasterizer. r=gfx-reviewers,nical
(This is expected to be temporary; in bug 1967071 or similar, we should update the
wr_glyph_rasterizer code to use the newer fallible versions of these functions,
and handle error results appropriately.)
Differential Revision: https://phabricator.services.mozilla.com/D272636
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/gfx/wr/wr_glyph_rasterizer/src/platform/windows/font.rs b/gfx/wr/wr_glyph_rasterizer/src/platform/windows/font.rs
@@ -155,8 +155,10 @@ impl FontContext {
fn add_font_descriptor(&mut self, font_key: &FontKey, desc: &dwrote::FontDescriptor) {
let system_fc = dwrote::FontCollection::get_system(false);
+ #[allow(deprecated)]
if let Some(font) = system_fc.get_font_from_descriptor(desc) {
let face = font.create_font_face();
+ #[allow(deprecated)]
let file = face.get_files().pop().unwrap();
let index = face.get_index();
self.fonts.insert(*font_key, FontFace { cached: None, file, index, face });
@@ -168,6 +170,7 @@ impl FontContext {
return;
}
+ #[allow(deprecated)]
if let Some(file) = dwrote::FontFile::new_from_data(data) {
if let Ok(face) = file.create_face(index, dwrote::DWRITE_FONT_SIMULATIONS_NONE) {
self.fonts.insert(*font_key, FontFace { cached: None, file, index, face });
@@ -367,6 +370,7 @@ impl FontContext {
pub fn get_glyph_index(&mut self, font_key: FontKey, ch: char) -> Option<u32> {
let face = &self.fonts.get(&font_key).unwrap().face;
+ #[allow(deprecated)]
let indices = face.get_glyph_indices(&[ch as u32]);
indices.first().map(|idx| *idx as u32)
}
@@ -397,6 +401,7 @@ impl FontContext {
let extra_width = extra_strikes as f64 * pixel_step;
let face = self.get_font_face(font);
+ #[allow(deprecated)]
face.get_design_glyph_metrics(&[key.index() as u16], false)
.first()
.map(|metrics| {