aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/gfx/lib.rs5
-rw-r--r--components/gfx/platform/windows/font.rs12
-rw-r--r--components/gfx/platform/windows/font_template.rs9
3 files changed, 8 insertions, 18 deletions
diff --git a/components/gfx/lib.rs b/components/gfx/lib.rs
index e474c65de21..38c43af3019 100644
--- a/components/gfx/lib.rs
+++ b/components/gfx/lib.rs
@@ -34,14 +34,11 @@ extern crate bitflags;
extern crate euclid;
extern crate fnv;
-// Platforms that use Freetype/Fontconfig library dependencies
#[cfg(any(target_os = "linux", target_os = "android"))]
extern crate fontconfig;
+extern crate fontsan;
#[cfg(any(target_os = "linux", target_os = "android"))]
extern crate freetype;
-
-extern crate fontsan;
-
extern crate gfx_traits;
// Eventually we would like the shaper to be pluggable, as many operating systems have their own
diff --git a/components/gfx/platform/windows/font.rs b/components/gfx/platform/windows/font.rs
index a3faf9c6f44..7397d216599 100644
--- a/components/gfx/platform/windows/font.rs
+++ b/components/gfx/platform/windows/font.rs
@@ -7,16 +7,16 @@
// renderer moves to a sandboxed process.
use app_units::Au;
+use dwrote::{Font, FontFace};
+use dwrote::{FontWeight, FontStretch, FontStyle};
use font::{FontHandleMethods, FontMetrics, FontTableMethods};
use font::{FontTableTag, FractionalPixel};
-use platform::font_template::{FontTemplateData};
-use platform::windows::font_list::{font_from_atom};
-use platform::windows::font_context::{FontContextHandle};
+use platform::font_template::FontTemplateData;
+use platform::windows::font_context::FontContextHandle;
+use platform::windows::font_list::font_from_atom;
use std::sync::Arc;
use style::computed_values::{font_stretch, font_weight};
use text::glyph::GlyphId;
-use dwrote::{Font, FontFace};
-use dwrote::{FontWeight, FontStretch, FontStyle};
// 1em = 12pt = 16px, assuming 72 points per inch and 96 px per inch
fn pt_to_px(pt: f64) -> f64 { pt / 72. * 96. }
@@ -179,7 +179,7 @@ impl FontHandleMethods for FontHandle {
// anything that we calculate and don't just pull out of self.face.metrics
// is pulled out here for clarity
let leading = dm.ascent - dm.capHeight;
-
+
let metrics = FontMetrics {
underline_size: au_from_du(dm.underlineThickness as i32),
underline_offset: au_from_du_s(dm.underlinePosition as i32),
diff --git a/components/gfx/platform/windows/font_template.rs b/components/gfx/platform/windows/font_template.rs
index 652ac4101f1..5a4709610c4 100644
--- a/components/gfx/platform/windows/font_template.rs
+++ b/components/gfx/platform/windows/font_template.rs
@@ -2,17 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use app_units::Au;
+use platform::windows::font_list::{descriptor_from_atom, font_from_atom};
use servo_atoms::Atom;
-use serde;
-use serde::{Deserialize, Deserializer, Serialize, Serializer};
-use std::collections::HashMap;
use std::io;
-use std::ops::Deref;
-use std::sync::Mutex;
use webrender_traits::NativeFontHandle;
-use dwrote::{Font};
-use platform::windows::font_list::{descriptor_from_atom, font_from_atom};
#[derive(Deserialize, Serialize, Debug)]
pub struct FontTemplateData {