mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #14193 - UK992:win-cleanup, r=vvuk
Various cleanup <!-- Please describe your changes on the following line: --> Reduces msi file size from 102 MB to 94 MB and installation size from 394 MB to 334 MB. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14193) <!-- Reviewable:end -->
This commit is contained in:
commit
b7eb36fa84
7 changed files with 1 additions and 998 deletions
|
@ -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
|
||||
}
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
@ -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";
|
|
@ -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
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue