mirror of
https://github.com/servo/servo.git
synced 2025-08-15 10:25:32 +01:00
Format gfx platform #21373
This commit is contained in:
parent
5063ac465b
commit
c57c99d9f7
13 changed files with 496 additions and 372 deletions
|
@ -11,7 +11,6 @@ use webrender_api::NativeFontHandle;
|
|||
#[derive(Deserialize, Serialize)]
|
||||
pub struct FontTemplateData {
|
||||
// If you add members here, review the Debug impl below
|
||||
|
||||
pub bytes: Option<Vec<u8>>,
|
||||
pub identifier: Atom,
|
||||
}
|
||||
|
@ -19,20 +18,22 @@ pub struct FontTemplateData {
|
|||
impl fmt::Debug for FontTemplateData {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
fmt.debug_struct("FontTemplateData")
|
||||
.field(
|
||||
"bytes",
|
||||
&self.bytes
|
||||
.field(
|
||||
"bytes",
|
||||
&self
|
||||
.bytes
|
||||
.as_ref()
|
||||
.map(|bytes| format!("[{} bytes]", bytes.len()))
|
||||
)
|
||||
.field("identifier", &self.identifier)
|
||||
.finish()
|
||||
.map(|bytes| format!("[{} bytes]", bytes.len())),
|
||||
).field("identifier", &self.identifier)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl FontTemplateData {
|
||||
pub fn new(identifier: Atom,
|
||||
font_data: Option<Vec<u8>>) -> Result<FontTemplateData, io::Error> {
|
||||
pub fn new(
|
||||
identifier: Atom,
|
||||
font_data: Option<Vec<u8>>,
|
||||
) -> Result<FontTemplateData, io::Error> {
|
||||
Ok(FontTemplateData {
|
||||
bytes: font_data,
|
||||
identifier: identifier,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue