mirror of
https://github.com/servo/servo.git
synced 2025-08-14 01:45:33 +01:00
Reorder imports
This commit is contained in:
parent
4a947dd719
commit
9e92eb205a
546 changed files with 1968 additions and 1536 deletions
|
@ -9,9 +9,9 @@ use crate::platform::font::{FontHandle, FontTable};
|
|||
use crate::platform::font_context::FontContextHandle;
|
||||
pub use crate::platform::font_list::fallback_font_families;
|
||||
use crate::platform::font_template::FontTemplateData;
|
||||
use crate::text::Shaper;
|
||||
use crate::text::glyph::{ByteIndex, GlyphData, GlyphId, GlyphStore};
|
||||
use crate::text::shaping::ShaperMethods;
|
||||
use crate::text::Shaper;
|
||||
use euclid::{Point2D, Rect, Size2D};
|
||||
use ordered_float::NotNan;
|
||||
use servo_atoms::Atom;
|
||||
|
@ -22,8 +22,8 @@ use std::collections::HashMap;
|
|||
use std::iter;
|
||||
use std::rc::Rc;
|
||||
use std::str;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering};
|
||||
use style::computed_values::{font_stretch, font_style, font_variant_caps, font_weight};
|
||||
use style::properties::style_structs::Font as FontStyleStruct;
|
||||
use style::values::computed::font::SingleFontFamily;
|
||||
|
|
|
@ -7,22 +7,22 @@ use crate::font::{FontFamilyDescriptor, FontFamilyName, FontSearchScope};
|
|||
use crate::font_context::FontSource;
|
||||
use crate::font_template::{FontTemplate, FontTemplateDescriptor};
|
||||
use crate::platform::font_context::FontContextHandle;
|
||||
use crate::platform::font_list::SANS_SERIF_FONT_FAMILY;
|
||||
use crate::platform::font_list::for_each_available_family;
|
||||
use crate::platform::font_list::for_each_variation;
|
||||
use crate::platform::font_list::system_default_family;
|
||||
use crate::platform::font_list::SANS_SERIF_FONT_FAMILY;
|
||||
use crate::platform::font_template::FontTemplateData;
|
||||
use fontsan;
|
||||
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
||||
use net_traits::{CoreResourceThread, FetchResponseMsg, fetch_async};
|
||||
use net_traits::request::{Destination, RequestInit};
|
||||
use net_traits::{fetch_async, CoreResourceThread, FetchResponseMsg};
|
||||
use servo_atoms::Atom;
|
||||
use servo_url::ServoUrl;
|
||||
use std::{fmt, f32, mem, thread};
|
||||
use std::borrow::ToOwned;
|
||||
use std::collections::HashMap;
|
||||
use std::ops::Deref;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::{f32, fmt, mem, thread};
|
||||
use style::font_face::{EffectiveSources, Source};
|
||||
use style::values::computed::font::FamilyName;
|
||||
use webrender_api;
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use app_units::Au;
|
||||
use crate::font::{Font, FontDescriptor, FontFamilyDescriptor, FontGroup, FontHandleMethods, FontRef};
|
||||
use crate::font::{
|
||||
Font, FontDescriptor, FontFamilyDescriptor, FontGroup, FontHandleMethods, FontRef,
|
||||
};
|
||||
use crate::font_cache_thread::FontTemplateInfo;
|
||||
use crate::font_template::FontTemplateDescriptor;
|
||||
use crate::platform::font::FontHandle;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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! {
|
||||
|
|
|
@ -10,8 +10,10 @@ extern crate style;
|
|||
extern crate webrender_api;
|
||||
|
||||
use app_units::Au;
|
||||
use gfx::font::{fallback_font_families, FontDescriptor, FontFamilyDescriptor, FontFamilyName, FontSearchScope};
|
||||
use gfx::font_cache_thread::{FontTemplates, FontTemplateInfo};
|
||||
use gfx::font::{
|
||||
fallback_font_families, FontDescriptor, FontFamilyDescriptor, FontFamilyName, FontSearchScope,
|
||||
};
|
||||
use gfx::font_cache_thread::{FontTemplateInfo, FontTemplates};
|
||||
use gfx::font_context::{FontContext, FontContextHandle, FontSource};
|
||||
use gfx::font_template::FontTemplateDescriptor;
|
||||
use servo_arc::Arc;
|
||||
|
@ -24,7 +26,9 @@ use std::path::PathBuf;
|
|||
use std::rc::Rc;
|
||||
use style::properties::longhands::font_variant_caps::computed_value::T as FontVariantCaps;
|
||||
use style::properties::style_structs::Font as FontStyleStruct;
|
||||
use style::values::computed::font::{FamilyName, FamilyNameSyntax, FontFamily, FontFamilyList, FontSize};
|
||||
use style::values::computed::font::{
|
||||
FamilyName, FamilyNameSyntax, FontFamily, FontFamilyList, FontSize,
|
||||
};
|
||||
use style::values::computed::font::{FontStretch, FontWeight, SingleFontFamily};
|
||||
use style::values::generics::font::FontStyle;
|
||||
|
||||
|
|
|
@ -19,10 +19,10 @@ fn test_font_template_descriptor() {
|
|||
use std::fs::File;
|
||||
use std::io::prelude::*;
|
||||
use std::path::PathBuf;
|
||||
use style::values::computed::Percentage;
|
||||
use style::values::computed::font::{FontStretch, FontWeight};
|
||||
use style::values::generics::NonNegative;
|
||||
use style::values::computed::Percentage;
|
||||
use style::values::generics::font::FontStyle;
|
||||
use style::values::generics::NonNegative;
|
||||
|
||||
fn descriptor(filename: &str) -> FontTemplateDescriptor {
|
||||
let mut path: PathBuf = [
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
extern crate gfx;
|
||||
|
||||
use gfx::text::util::{CompressionMode, transform_text};
|
||||
use gfx::text::util::{transform_text, CompressionMode};
|
||||
|
||||
#[test]
|
||||
fn test_transform_compress_none() {
|
||||
|
|
|
@ -10,9 +10,9 @@ use euclid::Point2D;
|
|||
))]
|
||||
use packed_simd::u32x4;
|
||||
use range::{self, EachIndex, Range, RangeIndex};
|
||||
use std::{fmt, mem, u16};
|
||||
use std::cmp::{Ordering, PartialOrd};
|
||||
use std::vec::Vec;
|
||||
use std::{fmt, mem, u16};
|
||||
|
||||
pub use gfx_traits::ByteIndex;
|
||||
|
||||
|
|
|
@ -5,15 +5,7 @@
|
|||
#![allow(unsafe_code)]
|
||||
|
||||
use app_units::Au;
|
||||
use crate::font::{ShapingFlags, Font, FontTableMethods, FontTableTag, ShapingOptions, KERN};
|
||||
use crate::harfbuzz::{HB_DIRECTION_LTR, HB_DIRECTION_RTL, HB_MEMORY_MODE_READONLY};
|
||||
use crate::harfbuzz::{hb_blob_create, hb_face_create_for_tables};
|
||||
use crate::harfbuzz::{hb_buffer_create, hb_font_destroy};
|
||||
use crate::harfbuzz::{hb_buffer_get_glyph_infos, hb_shape};
|
||||
use crate::harfbuzz::{hb_buffer_set_direction, hb_buffer_set_script};
|
||||
use crate::harfbuzz::{hb_buffer_t, hb_codepoint_t, hb_font_funcs_t};
|
||||
use crate::harfbuzz::{hb_face_t, hb_font_t};
|
||||
use crate::harfbuzz::{hb_position_t, hb_tag_t};
|
||||
use crate::font::{Font, FontTableMethods, FontTableTag, ShapingFlags, ShapingOptions, KERN};
|
||||
use crate::harfbuzz::hb_blob_t;
|
||||
use crate::harfbuzz::hb_bool_t;
|
||||
use crate::harfbuzz::hb_buffer_add_utf8;
|
||||
|
@ -32,13 +24,21 @@ use crate::harfbuzz::hb_font_set_ppem;
|
|||
use crate::harfbuzz::hb_font_set_scale;
|
||||
use crate::harfbuzz::hb_glyph_info_t;
|
||||
use crate::harfbuzz::hb_glyph_position_t;
|
||||
use crate::harfbuzz::{hb_blob_create, hb_face_create_for_tables};
|
||||
use crate::harfbuzz::{hb_buffer_create, hb_font_destroy};
|
||||
use crate::harfbuzz::{hb_buffer_get_glyph_infos, hb_shape};
|
||||
use crate::harfbuzz::{hb_buffer_set_direction, hb_buffer_set_script};
|
||||
use crate::harfbuzz::{hb_buffer_t, hb_codepoint_t, hb_font_funcs_t};
|
||||
use crate::harfbuzz::{hb_face_t, hb_font_t};
|
||||
use crate::harfbuzz::{hb_position_t, hb_tag_t};
|
||||
use crate::harfbuzz::{HB_DIRECTION_LTR, HB_DIRECTION_RTL, HB_MEMORY_MODE_READONLY};
|
||||
use crate::platform::font::FontTable;
|
||||
use crate::text::glyph::{ByteIndex, GlyphData, GlyphId, GlyphStore};
|
||||
use crate::text::shaping::ShaperMethods;
|
||||
use crate::text::util::{fixed_to_float, float_to_fixed, is_bidi_control};
|
||||
use euclid::Point2D;
|
||||
use std::{char, cmp, ptr};
|
||||
use std::os::raw::{c_char, c_int, c_uint, c_void};
|
||||
use std::{char, cmp, ptr};
|
||||
|
||||
const NO_GLYPH: i32 = -1;
|
||||
const LIGA: u32 = ot_tag!('l', 'i', 'g', 'a');
|
||||
|
|
|
@ -9,7 +9,7 @@ use crate::platform::font_template::FontTemplateData;
|
|||
use crate::text::glyph::{ByteIndex, GlyphStore};
|
||||
use range::Range;
|
||||
use std::cell::Cell;
|
||||
use std::cmp::{Ordering, max};
|
||||
use std::cmp::{max, Ordering};
|
||||
use std::slice::Iter;
|
||||
use std::sync::Arc;
|
||||
use style::str::char_is_whitespace;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue