mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +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 app_units::Au;
|
||||||
use dwrote;
|
use dwrote;
|
||||||
use dwrote::{Font, FontFace, FontFile};
|
use dwrote::{Font, FontFace, FontFile};
|
||||||
use dwrote::{FontWeight, FontStretch, FontStyle};
|
use dwrote::{FontStretch, FontStyle};
|
||||||
use font::{FontHandleMethods, FontMetrics, FontTableMethods};
|
use font::{FontHandleMethods, FontMetrics, FontTableMethods};
|
||||||
use font::{FontTableTag, FractionalPixel};
|
use font::{FontTableTag, FractionalPixel};
|
||||||
use platform::font_template::FontTemplateData;
|
use platform::font_template::FontTemplateData;
|
||||||
use platform::windows::font_context::FontContextHandle;
|
use platform::windows::font_context::FontContextHandle;
|
||||||
use platform::windows::font_list::font_from_atom;
|
use platform::windows::font_list::font_from_atom;
|
||||||
use servo_atoms::Atom;
|
use servo_atoms::Atom;
|
||||||
|
use std::fmt;
|
||||||
|
use std::ops::Deref;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use style::computed_values::font_stretch::T as StyleFontStretch;
|
use style::computed_values::font_stretch::T as StyleFontStretch;
|
||||||
use style::computed_values::font_weight::T as StyleFontWeight;
|
use style::computed_values::font_weight::T as StyleFontWeight;
|
||||||
|
@ -238,7 +240,7 @@ impl FontInfo {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct FontHandle {
|
pub struct FontHandle {
|
||||||
font_data: Arc<FontTemplateData>,
|
font_data: Arc<FontTemplateData>,
|
||||||
face: FontFace,
|
face: Nondebug<FontFace>,
|
||||||
info: FontInfo,
|
info: FontInfo,
|
||||||
em_size: f32,
|
em_size: f32,
|
||||||
du_per_em: f32,
|
du_per_em: f32,
|
||||||
|
@ -246,6 +248,21 @@ pub struct FontHandle {
|
||||||
scaled_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 FontHandle {}
|
||||||
|
|
||||||
impl FontHandleMethods for FontHandle {
|
impl FontHandleMethods for FontHandle {
|
||||||
|
@ -284,7 +301,7 @@ impl FontHandleMethods for FontHandle {
|
||||||
|
|
||||||
Ok(FontHandle {
|
Ok(FontHandle {
|
||||||
font_data: template.clone(),
|
font_data: template.clone(),
|
||||||
face: face,
|
face: Nondebug(face),
|
||||||
info: info,
|
info: info,
|
||||||
em_size: em_size,
|
em_size: em_size,
|
||||||
du_per_em: du_per_em,
|
du_per_em: du_per_em,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue