Skip to content

Commit ab07638

Browse files
committed
Update the dependencies
1 parent 78b5c99 commit ab07638

File tree

10 files changed

+31
-26
lines changed

10 files changed

+31
-26
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
check:
1414
runs-on: macos-latest
1515
steps:
16-
- uses: actions/checkout@v1
17-
- uses: actions-rs/toolchain@v1
18-
with: {toolchain: stable, components: clippy, rustfmt}
16+
- uses: actions/checkout@v4
17+
- uses: ructions/toolchain@v2
18+
with: {toolchain: stable, components: "clippy, rustfmt"}
1919
- run: cargo clippy -- -D warnings
2020
- run: cargo fmt --all -- --check
2121

@@ -25,7 +25,7 @@ jobs:
2525
os: [macos-latest, ubuntu-latest]
2626
runs-on: ${{ matrix.os }}
2727
steps:
28-
- uses: actions/checkout@v1
29-
- uses: actions-rs/toolchain@v1
28+
- uses: actions/checkout@v4
29+
- uses: ructions/toolchain@v2
3030
with: {toolchain: stable}
3131
- run: cargo test

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "webtype"
3-
version = "0.9.0"
3+
version = "0.10.0"
44
edition = "2021"
55
license = "Apache-2.0/MIT"
66
authors = ["Ivan Ukhov <[email protected]>"]
@@ -14,5 +14,5 @@ keywords = ["font", "typeface", "typography", "woff", "woff2"]
1414

1515
[dependencies]
1616
brotli-decompressor = "2"
17-
opentype = { version = "0.31.0", features = ["ignore-invalid-checksums"] }
17+
opentype = { version = "0.32.0", features = ["ignore-invalid-checksums"] }
1818
typeface = "0"

LICENSE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The following two notices apply to every file of the project.
1111
## The Apache License
1212

1313
```
14-
Copyright 2023 The webtype Developers
14+
Copyright 2023–2024 The webtype Developers
1515
1616
Licensed under the Apache License, Version 2.0 (the “License”); you may not use
1717
this file except in compliance with the License. You may obtain a copy of the
@@ -28,7 +28,7 @@ specific language governing permissions and limitations under the License.
2828
## The MIT License
2929

3030
```
31-
Copyright 2023 The webtype Developers
31+
Copyright 2023–2024 The webtype Developers
3232
3333
Permission is hereby granted, free of charge, to any person obtaining a copy of
3434
this software and associated documentation files (the “Software”), to deal in

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# WebType [![Package][package-img]][package-url] [![Documentation][documentation-img]][documentation-url] [![Build][build-img]][build-url]
22

33
The package provides a parser for fonts in Web Open Font Format. It might be
4-
helpful to have a look at a higher-level parser called [`font`][font], which
5-
internally relies on this package.
4+
helpful to have a look at a higher-level abstraction called [`font`][font],
5+
which internally relies on this package.
66

77
## Example
88

src/file.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::io::Cursor;
33
use opentype::truetype::Tag;
44
use opentype::Font;
55

6-
use crate::{Result, Tape, Value, Walue};
6+
use crate::Result;
77

88
/// A file.
99
pub struct File {
@@ -15,8 +15,10 @@ pub struct File {
1515

1616
impl File {
1717
/// Read a file.
18-
pub fn read<T: Tape>(tape: &mut T) -> Result<File> {
19-
match Tape::peek::<(Tag, Tag)>(tape)? {
18+
pub fn read<T: crate::tape::Read>(tape: &mut T) -> Result<File> {
19+
use crate::tape::Read;
20+
21+
match Read::peek::<(Tag, Tag)>(tape)? {
2022
(tag, _) if tag.0 == *b"wOFF" => {
2123
raise!("found version 1, which is not supported yet");
2224
}
@@ -35,8 +37,10 @@ impl File {
3537

3638
dereference! { File::fonts => [Font] }
3739

38-
fn read_version2<T: Tape>(mut tape: T) -> Result<(Font, Vec<u8>)> {
40+
fn read_version2<T: crate::tape::Read>(mut tape: T) -> Result<(Font, Vec<u8>)> {
41+
use crate::value::Read as ValueRead;
3942
use crate::version2::{FileHeader, TableDirectory};
43+
use crate::walue::Read as WalueRead;
4044

4145
let file_header = FileHeader::read(&mut tape)?;
4246
let table_directory = TableDirectory::read(&mut tape, &file_header)?;

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ mod file;
2929
mod number;
3030

3131
pub use opentype::Font;
32-
pub use typeface::{Error, Result, Tape, Value, Walue};
32+
pub use typeface::{tape, value, walue, Error, Result};
3333

3434
pub use file::File;
3535
pub use number::v32;

src/number.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
use crate::{Result, Tape, Value};
1+
use crate::Result;
22

33
/// A four-byte unsigned integer with a variable-length encoding.
44
#[allow(non_camel_case_types)]
55
#[derive(Clone, Copy, Debug, Default)]
66
pub struct v32(pub u32);
77

8-
impl Value for v32 {
8+
impl crate::value::Read for v32 {
99
#[inline]
10-
fn read<T: Tape>(tape: &mut T) -> Result<Self> {
10+
fn read<T: crate::tape::Read>(tape: &mut T) -> Result<Self> {
1111
Ok(v32(parse(tape)?))
1212
}
1313
}
1414

15-
fn parse<T: Tape>(tape: &mut T) -> Result<u32> {
15+
fn parse<T: crate::tape::Read>(tape: &mut T) -> Result<u32> {
1616
let mut value: u32 = 0;
1717
for i in 0..5 {
1818
let byte: u32 = tape.take::<u8>()? as _;

src/version2/table_directory.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use opentype::truetype::Tag;
77

88
use crate::number::v32;
99
use crate::version2::file_header::FileHeader;
10-
use crate::{Result, Tape, Walue};
10+
use crate::Result;
1111

1212
const TAG_MASK: u8 = 0b0011_1111;
1313

@@ -70,7 +70,7 @@ impl TableDirectory {
7070
}
7171

7272
/// Decompress all tables.
73-
pub fn decompress<T: Tape>(&self, mut tape: T, _: &FileHeader) -> Result<Vec<u8>> {
73+
pub fn decompress<T: crate::tape::Read>(&self, mut tape: T, _: &FileHeader) -> Result<Vec<u8>> {
7474
let size = self.iter().map(|record| record.uncompressed_size()).sum();
7575
let mut data = Vec::with_capacity(size);
7676
brotli_decompressor::BrotliDecompress(&mut tape, &mut data)?;
@@ -80,10 +80,10 @@ impl TableDirectory {
8080

8181
dereference! { TableDirectory::records => [Record] }
8282

83-
impl<'l> Walue<'l> for TableDirectory {
83+
impl<'l> crate::walue::Read<'l> for TableDirectory {
8484
type Parameter = &'l FileHeader;
8585

86-
fn read<T: Tape>(tape: &mut T, file_header: &'l FileHeader) -> Result<Self> {
86+
fn read<T: crate::tape::Read>(tape: &mut T, file_header: &'l FileHeader) -> Result<Self> {
8787
let records = tape.take_given(file_header.table_count as usize)?;
8888
Ok(TableDirectory { records })
8989
}

tests/file_header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
mod support;
33

44
mod noto_naskh_arabic {
5+
use webtype::value::Read;
56
use webtype::version2::FileHeader;
6-
use webtype::Value;
77

88
#[test]
99
fn read() {

tests/table_directory.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ mod noto_naskh_arabic {
66

77
use webtype::opentype::truetype::tables::FontHeader;
88
use webtype::opentype::Font;
9+
use webtype::value::Read as ValueRead;
910
use webtype::version2::{FileHeader, TableDirectory};
10-
use webtype::{Value, Walue};
11+
use webtype::walue::Read as WalueRead;
1112

1213
#[test]
1314
fn read() {

0 commit comments

Comments
 (0)