// Copyright 2013 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms.
usesuper::frame::{CTFrame, CTFrameRef}; use core_foundation::attributed_string::CFAttributedStringRef; use core_foundation::base::{CFRange, CFTypeID, TCFType}; use core_foundation::dictionary::CFDictionaryRef; use core_graphics::geometry::CGSize; use core_graphics::path::{CGPath, CGPathRef}; use foreign_types::{ForeignType, ForeignTypeRef}; use std::os::raw::c_void; use std::ptr::null;
/// Suggest an appropriate frame size for displaying a text range. /// /// Returns a tuple containing an appropriate size (that should be smaller /// than the provided constraints) as well as the range of text that fits in /// this frame. pubfn suggest_frame_size_with_constraints(
&self,
string_range: CFRange,
frame_attributes: CFDictionaryRef,
constraints: CGSize,
) -> (CGSize, CFRange) { unsafe { letmut fit_range = CFRange::init(0, 0); let size = CTFramesetterSuggestFrameSizeWithConstraints( self.as_concrete_TypeRef(),
string_range,
frame_attributes,
constraints,
&mut fit_range,
);
(size, fit_range)
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.