Skip to content

Commit

Permalink
Fix windows build errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdm committed Oct 12, 2018
1 parent 8a2eec2 commit 4e5b3bc
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions components/gfx/platform/windows/font.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -238,14 +240,29 @@ 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,
du_to_px: f32,
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 {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 4e5b3bc

Please sign in to comment.