summaryrefslogtreecommitdiffstats
path: root/font
diff options
context:
space:
mode:
authorLukas Lueg <lukas.lueg@gmail.com>2017-01-13 08:15:06 +0100
committerJoe Wilm <jwilm@users.noreply.github.com>2017-01-23 09:14:01 -0800
commit64b42cd2f3f1da1d6a99dcdf90e6f7728ddca968 (patch)
tree4856f4884144e1cbba8a0fc8185b446193515430 /font
parentb23ed6ed4c53a6d010238643c443da6db3931a87 (diff)
Use the log-crate instead of printing to stdout
Diffstat (limited to 'font')
-rw-r--r--font/Cargo.toml1
-rw-r--r--font/src/darwin/mod.rs4
-rw-r--r--font/src/ft/list_fonts.rs8
-rw-r--r--font/src/lib.rs3
4 files changed, 10 insertions, 6 deletions
diff --git a/font/Cargo.toml b/font/Cargo.toml
index f0c3e06a..3ab2749e 100644
--- a/font/Cargo.toml
+++ b/font/Cargo.toml
@@ -9,6 +9,7 @@ license = "Apache-2.0"
euclid = "0.6.8"
libc = "0.2.11"
ffi-util = { path = "../ffi-util" }
+log = "0.3"
[target.'cfg(not(target_os = "macos"))'.dependencies]
servo-fontconfig = { git = "https://github.com/jwilm/rust-fontconfig" }
diff --git a/font/src/darwin/mod.rs b/font/src/darwin/mod.rs
index 1f925dea..757dd5f8 100644
--- a/font/src/darwin/mod.rs
+++ b/font/src/darwin/mod.rs
@@ -125,7 +125,7 @@ impl ::Rasterize for Rasterizer {
type Err = Error;
fn new(_dpi_x: f32, _dpi_y: f32, device_pixel_ratio: f32, use_thin_strokes: bool) -> Result<Rasterizer, Error> {
- println!("device_pixel_ratio: {}", device_pixel_ratio);
+ info!("device_pixel_ratio: {}", device_pixel_ratio);
Ok(Rasterizer {
fonts: HashMap::new(),
keys: HashMap::new(),
@@ -588,7 +588,7 @@ mod tests {
fn get_descriptors_and_build_font() {
let list = super::descriptors_for_family("Menlo");
assert!(!list.is_empty());
- println!("{:?}", list);
+ info!("{:?}", list);
// Check to_font
let fonts = list.iter()
diff --git a/font/src/ft/list_fonts.rs b/font/src/ft/list_fonts.rs
index 29912a8f..9847283f 100644
--- a/font/src/ft/list_fonts.rs
+++ b/font/src/ft/list_fonts.rs
@@ -390,7 +390,7 @@ pub mod fc {
(*self.as_ptr()).nfont as isize
};
- println!("num fonts = {}", num_fonts);
+ info!("num fonts = {}", num_fonts);
FontSetIter {
font_set: self.deref(),
@@ -408,7 +408,7 @@ pub mod fc {
(*self.as_ptr()).nfont as isize
};
- println!("num fonts = {}", num_fonts);
+ info!("num fonts = {}", num_fonts);
FontSetIter {
font_set: self,
@@ -498,7 +498,7 @@ mod tests {
break;
}
}
- println!("");
+ info!("");
}
#[test]
@@ -520,7 +520,7 @@ mod tests {
break;
}
}
- println!("");
+ info!("");
}
}
}
diff --git a/font/src/lib.rs b/font/src/lib.rs
index cf697c8a..bb9b9f3c 100644
--- a/font/src/lib.rs
+++ b/font/src/lib.rs
@@ -39,6 +39,9 @@ extern crate libc;
#[macro_use]
extern crate ffi_util;
+#[macro_use]
+extern crate log;
+
use std::fmt;
use std::sync::atomic::{AtomicU32, ATOMIC_U32_INIT, Ordering};