Reorder imports

This commit is contained in:
Pyfisch 2018-11-06 20:38:02 +01:00
parent 4a947dd719
commit 9e92eb205a
546 changed files with 1968 additions and 1536 deletions

View file

@ -8,11 +8,11 @@ use std::fs::File;
use std::io::{self, Read};
use std::path::Path;
use ucd::{Codepoint, UnicodeBlock};
use xml5ever::Attribute;
use xml5ever::driver::parse_document;
use xml5ever::rcdom::*;
use xml5ever::rcdom::{Node, RcDom};
use xml5ever::tendril::TendrilSink;
use xml5ever::Attribute;
lazy_static! {
static ref FONT_LIST: FontList = FontList::new();

View file

@ -2,6 +2,7 @@
* 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 super::c_str_to_string;
use app_units::Au;
use crate::font::{FontHandleMethods, FontMetrics, FontTableMethods};
use crate::font::{FontTableTag, FractionalPixel, GPOS, GSUB, KERN};
@ -9,6 +10,7 @@ use crate::platform::font_context::FontContextHandle;
use crate::platform::font_template::FontTemplateData;
use crate::text::glyph::GlyphId;
use crate::text::util::fixed_to_float;
use freetype::freetype::FT_Sfnt_Tag;
use freetype::freetype::{FT_Done_Face, FT_New_Face, FT_New_Memory_Face};
use freetype::freetype::{FT_F26Dot6, FT_Face, FT_FaceRec};
use freetype::freetype::{FT_Get_Char_Index, FT_Get_Postscript_Name};
@ -17,18 +19,16 @@ use freetype::freetype::{FT_GlyphSlot, FT_Library, FT_Long, FT_ULong};
use freetype::freetype::{FT_Int32, FT_Kerning_Mode, FT_STYLE_FLAG_ITALIC};
use freetype::freetype::{FT_Load_Glyph, FT_Set_Char_Size};
use freetype::freetype::{FT_SizeRec, FT_Size_Metrics, FT_UInt, FT_Vector};
use freetype::freetype::FT_Sfnt_Tag;
use freetype::succeeded;
use freetype::tt_os2::TT_OS2;
use servo_atoms::Atom;
use std::{mem, ptr};
use std::ffi::CString;
use std::os::raw::{c_char, c_long};
use std::sync::Arc;
use std::{mem, ptr};
use style::computed_values::font_stretch::T as FontStretch;
use style::computed_values::font_weight::T as FontWeight;
use style::values::computed::font::FontStyle;
use super::c_str_to_string;
// This constant is not present in the freetype
// bindings due to bindgen not handling the way

View file

@ -10,7 +10,7 @@ use freetype::freetype::FT_MemoryRec_;
use freetype::freetype::FT_New_Library;
use freetype::succeeded;
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
use servo_allocator::libc_compat::{malloc, realloc, free};
use servo_allocator::libc_compat::{free, malloc, realloc};
use servo_allocator::usable_size;
use std::os::raw::{c_long, c_void};
use std::ptr;

View file

@ -2,18 +2,20 @@
* 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 super::c_str_to_string;
use crate::text::util::is_cjk;
use fontconfig::fontconfig::{FcChar8, FcResultMatch, FcSetSystem};
use fontconfig::fontconfig::{FcConfigGetCurrent, FcConfigGetFonts, FcConfigSubstitute};
use fontconfig::fontconfig::{FcDefaultSubstitute, FcFontMatch, FcNameParse, FcPatternGetString};
use fontconfig::fontconfig::{FcFontSetDestroy, FcMatchPattern, FcPatternCreate, FcPatternDestroy};
use fontconfig::fontconfig::{FcFontSetList, FcObjectSetCreate, FcObjectSetDestroy, FcPatternAddString};
use fontconfig::fontconfig::{
FcFontSetList, FcObjectSetCreate, FcObjectSetDestroy, FcPatternAddString,
};
use fontconfig::fontconfig::{FcObjectSetAdd, FcPatternGetInteger};
use libc;
use libc::{c_char, c_int};
use std::ffi::CString;
use std::ptr;
use super::c_str_to_string;
static FC_FAMILY: &'static [u8] = b"family\0";
static FC_FILE: &'static [u8] = b"file\0";

View file

@ -5,7 +5,7 @@
use servo_atoms::Atom;
use std::fmt;
use std::fs::File;
use std::io::{Read, Error};
use std::io::{Error, Read};
use webrender_api::NativeFontHandle;
/// Platform specific font representation for Linux.

View file

@ -11,17 +11,19 @@ use core_foundation::string::UniChar;
use core_graphics::font::CGGlyph;
use core_graphics::geometry::CGRect;
use core_text::font::CTFont;
use core_text::font_descriptor::{SymbolicTraitAccessors, TraitAccessors};
use core_text::font_descriptor::kCTFontDefaultOrientation;
use crate::font::{FontHandleMethods, FontMetrics, FontTableMethods, FontTableTag, FractionalPixel};
use core_text::font_descriptor::{SymbolicTraitAccessors, TraitAccessors};
use crate::font::{
FontHandleMethods, FontMetrics, FontTableMethods, FontTableTag, FractionalPixel,
};
use crate::font::{GPOS, GSUB, KERN};
use crate::platform::font_template::FontTemplateData;
use crate::platform::macos::font_context::FontContextHandle;
use crate::text::glyph::GlyphId;
use servo_atoms::Atom;
use std::{fmt, ptr};
use std::ops::Range;
use std::sync::Arc;
use std::{fmt, ptr};
use style::values::computed::font::{FontStretch, FontStyle, FontWeight};
const KERN_PAIR_LEN: usize = 6;

View file

@ -7,15 +7,15 @@ use core_graphics::data_provider::CGDataProvider;
use core_graphics::font::CGFont;
use core_text;
use core_text::font::CTFont;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use serde::de::{Error, Visitor};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use servo_atoms::Atom;
use servo_url::ServoUrl;
use std::borrow::ToOwned;
use std::collections::HashMap;
use std::fmt;
use std::fs::File;
use std::io::{Read, Error as IoError};
use std::io::{Error as IoError, Read};
use std::ops::Deref;
use std::sync::{Arc, Mutex};
use webrender_api::NativeFontHandle;

View file

@ -23,8 +23,8 @@ use std::sync::Arc;
use style::computed_values::font_stretch::T as StyleFontStretch;
use style::computed_values::font_weight::T as StyleFontWeight;
use style::values::computed::font::FontStyle as StyleFontStyle;
use style::values::generics::NonNegative;
use style::values::generics::font::FontStyle as GenericFontStyle;
use style::values::generics::NonNegative;
use style::values::specified::font::FontStretchKeyword;
use truetype;
@ -119,7 +119,7 @@ struct FontInfo {
impl FontInfo {
fn new_from_face(face: &FontFace) -> Result<FontInfo, ()> {
use std::cmp::{min, max};
use std::cmp::{max, min};
use std::io::Cursor;
use truetype::{NamingTable, Value, WindowsMetrics};

View file

@ -3,11 +3,11 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use crate::text::util::unicode_plane;
use dwrote::{Font, FontDescriptor, FontCollection};
use dwrote::{Font, FontCollection, FontDescriptor};
use servo_atoms::Atom;
use std::collections::HashMap;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Mutex;
use std::sync::atomic::{Ordering, AtomicUsize};
use ucd::{Codepoint, UnicodeBlock};
lazy_static! {