Crate glifparser

source ·
Expand description

A parser and writer for UFO .glif files.

© 2020–2022 Fredrick R. Brennan and MFEK Authors

glifparser supports the entire .glif spec as of 12 April 2021.

glifparser is not norad and is not meant to implement the UFO spec.

Re-exports

pub use crate::anchor::Anchor;
pub use crate::color::Color;
pub use crate::component::FlattenedGlif;
pub use crate::component::GlifComponent;
pub use crate::component::Component;
pub use crate::component::ComponentRect;
pub use crate::glif::Glif;
pub use crate::glif::xml;
pub use crate::glif::mfek::MFEKGlif;
pub use crate::glif::mfek::VWSContour;
pub use crate::glif::mfek::JoinType;
pub use crate::glif::mfek::CapType;
pub use crate::guideline::Guideline;
pub use crate::guideline::GuidelinePoint;
pub use crate::image::GlifImage;
pub use crate::image::Image;
pub use crate::image::ImageCodec;
pub use crate::outline::contour;
pub use crate::outline::Contour;
pub use crate::outline::Outline;
pub use crate::outline::OutlineType;
pub use crate::pedantry::Pedantry;
pub use crate::point::Point;
pub use crate::point::PointType;
pub use crate::point::Handle;
pub use crate::point::WhichHandle;
pub use crate::point::PointData;
pub use crate::string::GlifString;

Modules

.glif <anchor> + ufo2ft _ mark/base determination
impl’s/struct for shared <image>/<guideline>/layer color behavior
.glif <component>
Provides main error type GlifParserError & its impl’s
Glif (<glif> toplevel), read/write modules, + Lib
.glif <guideline>
.glif <image> w/ability to read to a bitmap if filename valid
Shared behavior between <component>, <image> based on PostScript-style matrices of 6 values
.glif <outline> and <contour>
When reading .glif files, how strict ought we to be? Can we make fixes to bad input, or ought we to error out and make the user do it?
.glif <point>
Enforcers for UFO format string rules — no control characters (GlifString), len ≥ 0 (GlifStringLenOne)

Enums

A generic container for an “integer or a float”.

Traits

Functions

Read UFO .glif XML to Glif struct. This should only be used when you have no known filename, and the glif is unattached from a UFO.
If you have a known filename, it is always preferable to call this function, as it sets the filename on the Glif as well as on its GlifComponent’s, easing their transition into Component’s.