mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Fix windows build errors.
This commit is contained in:
parent
8a2eec2714
commit
4e5b3bcf15
1 changed files with 20 additions and 3 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue