mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Make dummy font implementation conform to API changes.
This commit is contained in:
parent
0b0495cff4
commit
d985741701
1 changed files with 4 additions and 3 deletions
|
@ -2,6 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
use std::io::Error;
|
||||||
use string_cache::Atom;
|
use string_cache::Atom;
|
||||||
use webrender_traits::NativeFontHandle;
|
use webrender_traits::NativeFontHandle;
|
||||||
|
|
||||||
|
@ -12,7 +13,7 @@ pub struct FontTemplateData {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FontTemplateData {
|
impl FontTemplateData {
|
||||||
pub fn new(identifier: Atom, font_data: Option<Vec<u8>>) -> FontTemplateData {
|
pub fn new(identifier: Atom, font_data: Option<Vec<u8>>) -> Result<FontTemplateData, Error> {
|
||||||
let bytes = match font_data {
|
let bytes = match font_data {
|
||||||
Some(bytes) => {
|
Some(bytes) => {
|
||||||
bytes
|
bytes
|
||||||
|
@ -22,10 +23,10 @@ impl FontTemplateData {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
FontTemplateData {
|
Ok(FontTemplateData {
|
||||||
bytes: bytes,
|
bytes: bytes,
|
||||||
identifier: identifier,
|
identifier: identifier,
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
pub fn bytes(&self) -> Vec<u8> {
|
pub fn bytes(&self) -> Vec<u8> {
|
||||||
self.bytes.clone()
|
self.bytes.clone()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue