aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUK992 <urbankrajnc92@gmail.com>2016-11-13 17:40:34 +0100
committerUK992 <urbankrajnc92@gmail.com>2016-11-13 17:50:31 +0100
commitb4b8ccd7cd57cd19a0036e5fe902b191c5e98918 (patch)
tree11cb23193a4fe8acea21f46ab09e1c878f2fb4f3
parentcad53752e875a12b05896f8742485c89c7c5af50 (diff)
downloadservo-b4b8ccd7cd57cd19a0036e5fe902b191c5e98918.tar.gz
servo-b4b8ccd7cd57cd19a0036e5fe902b191c5e98918.zip
Remove dummy fonts from gfx
-rw-r--r--components/gfx/platform/dummy/font.rs80
-rw-r--r--components/gfx/platform/dummy/font_context.rs13
-rw-r--r--components/gfx/platform/dummy/font_list.rs24
-rw-r--r--components/gfx/platform/dummy/font_template.rs40
4 files changed, 0 insertions, 157 deletions
diff --git a/components/gfx/platform/dummy/font.rs b/components/gfx/platform/dummy/font.rs
deleted file mode 100644
index 096580c66db..00000000000
--- a/components/gfx/platform/dummy/font.rs
+++ /dev/null
@@ -1,80 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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 font::{FontHandleMethods, FontMetrics, FontTableMethods};
-use font::{FontTableTag, FractionalPixel};
-use platform::font_context::FontContextHandle;
-use platform::font_template::FontTemplateData;
-use std::sync::Arc;
-use style::computed_values::{font_stretch, font_weight};
-use text::glyph::GlyphId;
-
-#[derive(Debug)]
-pub struct FontTable {
- buffer: Vec<u8>,
-}
-
-impl FontTableMethods for FontTable {
- fn buffer(&self) -> &[u8] {
- &self.buffer
- }
-}
-
-#[derive(Debug)]
-pub struct FontHandle {
- handle: FontContextHandle,
-}
-
-impl Drop for FontHandle {
- fn drop(&mut self) {
- }
-}
-
-impl FontHandleMethods for FontHandle {
- fn new_from_template(fctx: &FontContextHandle,
- template: Arc<FontTemplateData>,
- pt_size: Option<Au>)
- -> Result<FontHandle, ()> {
- Err(())
- }
-
- fn template(&self) -> Arc<FontTemplateData> {
- unimplemented!()
- }
- fn family_name(&self) -> String {
- String::from("Unknown")
- }
- fn face_name(&self) -> String {
- String::from("Unknown")
- }
- fn is_italic(&self) -> bool {
- false
- }
- fn boldness(&self) -> font_weight::T {
- font_weight::T::Weight400
- }
- fn stretchiness(&self) -> font_stretch::T {
- font_stretch::T::normal
- }
- fn glyph_index(&self, codepoint: char) -> Option<GlyphId> {
- None
- }
- fn glyph_h_kerning(&self, first_glyph: GlyphId, second_glyph: GlyphId)
- -> FractionalPixel {
- 0.0
- }
- fn can_do_fast_shaping(&self) -> bool {
- false
- }
- fn glyph_h_advance(&self, glyph: GlyphId) -> Option<FractionalPixel> {
- None
- }
- fn metrics(&self) -> FontMetrics {
- unimplemented!()
- }
- fn table_for_tag(&self, tag: FontTableTag) -> Option<FontTable> {
- None
- }
-}
diff --git a/components/gfx/platform/dummy/font_context.rs b/components/gfx/platform/dummy/font_context.rs
deleted file mode 100644
index 4b07896b2dc..00000000000
--- a/components/gfx/platform/dummy/font_context.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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/. */
-
-#[derive(Clone, HeapSizeOf, Debug)]
-pub struct FontContextHandle;
-
-impl FontContextHandle {
- pub fn new() -> FontContextHandle {
- FontContextHandle
- }
-}
-
diff --git a/components/gfx/platform/dummy/font_list.rs b/components/gfx/platform/dummy/font_list.rs
deleted file mode 100644
index 6502572c287..00000000000
--- a/components/gfx/platform/dummy/font_list.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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/. */
-
-pub fn for_each_available_family<F>(mut callback: F) where F: FnMut(String)
-{
-}
-
-pub fn for_each_variation<F>(family_name: &str, mut callback: F)
- where F: FnMut(String)
-{
-}
-
-pub fn system_default_family(generic_name: &str) -> Option<String> {
- None
-}
-
-pub fn last_resort_font_families() -> Vec<String> {
- vec!(
- "Unknown".to_owned()
- )
-}
-
-pub static SANS_SERIF_FONT_FAMILY: &'static str = "Unknown";
diff --git a/components/gfx/platform/dummy/font_template.rs b/components/gfx/platform/dummy/font_template.rs
deleted file mode 100644
index 7263211fbbf..00000000000
--- a/components/gfx/platform/dummy/font_template.rs
+++ /dev/null
@@ -1,40 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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 servo_atoms::Atom;
-use std::io::Error;
-use webrender_traits::NativeFontHandle;
-
-#[derive(Deserialize, Serialize, Debug)]
-pub struct FontTemplateData {
- pub bytes: Vec<u8>,
- pub identifier: Atom,
-}
-
-impl FontTemplateData {
- pub fn new(identifier: Atom, font_data: Option<Vec<u8>>) -> Result<FontTemplateData, Error> {
- let bytes = match font_data {
- Some(bytes) => {
- bytes
- },
- None => {
- unimplemented!()
- }
- };
-
- Ok(FontTemplateData {
- bytes: bytes,
- identifier: identifier,
- })
- }
- pub fn bytes(&self) -> Vec<u8> {
- self.bytes.clone()
- }
- pub fn bytes_if_in_memory(&self) -> Option<Vec<u8>> {
- Some(self.bytes())
- }
- pub fn native_font(&self) -> Option<NativeFontHandle> {
- None
- }
-}