tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 97b41b22a8e3ab30c0d8949fa2f4aff9f41403cf
parent a9f1bab0067638a8ffdbf85258ddb0062e9c5b9c
Author: Jonathan Kew <jkew@mozilla.com>
Date:   Sat, 15 Nov 2025 14:59:18 +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:
Mgfx/wr/wr_glyph_rasterizer/src/platform/windows/font.rs | 5+++++
Mgfx/wr/wrench/src/wrench.rs | 3+++
2 files changed, 8 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| { diff --git a/gfx/wr/wrench/src/wrench.rs b/gfx/wr/wrench/src/wrench.rs @@ -466,10 +466,13 @@ impl Wrench { stretch, }; let system_fc = dwrote::FontCollection::system(); + #[allow(deprecated)] if let Some(font) = system_fc.get_font_from_descriptor(&desc) { let face = font.create_font_face(); + #[allow(deprecated)] let files = face.get_files(); if files.len() == 1 { + #[allow(deprecated)] if let Some(path) = files[0].get_font_file_path() { return self.font_key_from_native_handle(&NativeFontHandle { path,