Fix windows build errors.

This commit is contained in:
Josh Matthews 2018-10-11 16:35:29 -04:00
parent 8a2eec2714
commit 4e5b3bcf15

View file

@ -9,13 +9,15 @@
use app_units::Au;
use dwrote;
use dwrote::{Font, FontFace, FontFile};
use dwrote::{FontWeight, FontStretch, FontStyle};
use dwrote::{FontStretch, FontStyle};
use font::{FontHandleMethods, FontMetrics, FontTableMethods};
use font::{FontTableTag, FractionalPixel};
use platform::font_template::FontTemplateData;
use platform::windows::font_context::FontContextHandle;
use platform::windows::font_list::font_from_atom;
use servo_atoms::Atom;
use std::fmt;
use std::ops::Deref;
use std::sync::Arc;
use style::computed_values::font_stretch::T as StyleFontStretch;
use style::computed_values::font_weight::T as StyleFontWeight;
@ -238,7 +240,7 @@ impl FontInfo {
#[derive(Debug)]
pub struct FontHandle {
font_data: Arc<FontTemplateData>,
face: FontFace,
face: Nondebug<FontFace>,
info: FontInfo,
em_size: f32,
du_per_em: f32,
@ -246,6 +248,21 @@ pub struct FontHandle {
scaled_du_to_px: f32,
}
struct Nondebug<T>(T);
impl<T> fmt::Debug for Nondebug<T> {
fn fmt(&self, _f: &mut fmt::Formatter) -> fmt::Result {
Ok(())
}
}
impl<T> Deref for Nondebug<T> {
type Target = T;
fn deref(&self) -> &T {
&self.0
}
}
impl FontHandle {}
impl FontHandleMethods for FontHandle {
@ -284,7 +301,7 @@ impl FontHandleMethods for FontHandle {
Ok(FontHandle {
font_data: template.clone(),
face: face,
face: Nondebug(face),
info: info,
em_size: em_size,
du_per_em: du_per_em,