Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 48 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,53 @@
# Norad

**a Rust crate for working with [Unified Font Object][ufo] files.**

A crate for reading, writing, and manipulating [Unified Font Object][ufo] files,
a common font-design format.

[ufo]: http://unifiedfontobject.org
The types in this crate correspond to types described in the spec.

[ufo]: http://unifiedfontobject.org/versions/ufo3

## Basic Usage

Instantiate a UFO font object with a [`Font`] struct like this:

```rust
use norad::Font;

let inpath = "RoflsExtraDim.ufo";
let mut font_obj = Font::load(inpath).expect("failed to load font");
```

The API may be used to access and modify data in the [`Font`]:

```rust
let layer = font_obj.default_layer();
let glyph_a = layer.get_glyph("A").expect("missing glyph");
assert_eq!(glyph_a.name().as_ref(), "A");
```

Serialize the [`Font`] to UFO files on disk with the [`Font::save`] method:

```rust
let outpath = "RoflsSemiDim.ufo";
font_obj.save(outpath);
```

Refer to the [`examples` directory of the source repository](https://github.com/linebender/norad/tree/master/examples)
for additional source code examples.

[`Font`]: https://docs.rs/norad/latest/norad/struct.Font.html
[`Font::save`]: https://docs.rs/norad/latest/norad/struct.Font.html#method.save

## API Documentation

Details on the full API for working with UFO fonts are available on [docs.rs](https://docs.rs/norad/latest/norad/).

## License

norad is licensed under the [MIT](https://github.com/linebender/norad/blob/master/LICENSE-MIT)
and [Apache v2.0](https://github.com/linebender/norad/blob/master/LICENSE-APACHE) licenses.

## Source

Source files are available [on GitHub](https://github.com/linebender/norad).
66 changes: 2 additions & 64 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,67 +1,5 @@
//! Utilities for working with [Unified Font Object][ufo] files.
//!
//! The types in this crate correspond to types described in the spec.
//!
//! [ufo]: http://unifiedfontobject.org/versions/ufo3
//!
//! # Basic Usage
//!
//! Instantiate a UFO font object with a [`Font`] struct like this:
//!
//! ```no_run
//! use norad::Font;
//!
//! let inpath = "RoflsExtraDim.ufo";
//! let mut font_obj = Font::load(inpath).expect("failed to load font");
//! # let layer = font_obj.default_layer();
//! # let glyph_a = layer.get_glyph("A").expect("missing glyph");
//! # assert_eq!(glyph_a.name().as_ref(), "A");
//! # let outpath = "RoflsSemiDim.ufo";
//! # font_obj.save(outpath);
//! ```
//!
//! The API may be used to access and modify data in the [`Font`]:
//!
//!```no_run
//! # use norad::Font;
//! # let inpath = "RoflsExtraDim.ufo";
//! # let mut font_obj = Font::load(inpath).expect("failed to load font");
//! let layer = font_obj.default_layer();
//! let glyph_a = layer.get_glyph("A").expect("missing glyph");
//! assert_eq!(glyph_a.name().as_ref(), "A");
//! # let outpath = "RoflsSemiDim.ufo";
//! # font_obj.save(outpath);
//! ```
//!
//! Serialize the [`Font`] to UFO files on disk with the [`Font::save`] method:
//!
//!```no_run
//! # use norad::Font;
//! # let inpath = "RoflsExtraDim.ufo";
//! # let mut font_obj = Font::load(inpath).expect("failed to load font");
//! # let layer = font_obj.default_layer();
//! # let glyph_a = layer.get_glyph("A").expect("missing glyph");
//! # assert_eq!(glyph_a.name().as_ref(), "A");
//! let outpath = "RoflsSemiDim.ufo";
//! font_obj.save(outpath);
//! ```
//!
//! Refer to the [`examples` directory of the source repository](https://github.com/linebender/norad/tree/master/examples)
//! for additional source code examples.
//!
//! # API Documentation
//!
//! Details on the full API for working with UFO fonts are available in these docs.
//!
//! # License
//!
//! norad is licensed under the [MIT](https://github.com/linebender/norad/blob/master/LICENSE-MIT)
//! and [Apache v2.0](https://github.com/linebender/norad/blob/master/LICENSE-APACHE) licenses.
//!
//! # Source
//!
//! Source files are available at <https://github.com/linebender/norad>.

// Share module docs with README, and continue not running doctests there.
#![cfg_attr(not(doctest), doc = include_str!("../README.md"))]
#![warn(missing_docs)]
#![deny(rustdoc::broken_intra_doc_links, unsafe_code)]

Expand Down
Loading