Remove dummy fonts from gfx

This commit is contained in:
UK992 2016-11-13 17:40:34 +01:00
parent cad53752e8
commit b4b8ccd7cd
4 changed files with 0 additions and 157 deletions

View file

@ -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
}
}

View file

@ -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
}
}

View file

@ -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";

View file

@ -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
}
}