~romi/offu

A Zig library to parse and edit Unified Font Objects

d846503 Update Zig

~romi pushed to ~romi/offu git

9 days ago

54a59fe Update the example to show layers informations

~romi pushed to ~romi/offu git

10 days ago

#Offu

A library to parse and edit Unified Font Objects v3 written in Zig.

The goal is to have a library to rely on for tools such as a non-exporting glyphs remover, a UFO normalizer, running Q.A. tests, or parsing the necessary information to build fonts, etc.

There are still some rough edges (only partial reading is supported so far!).
This library follows Zig master releases, a nix flake helps with that.

#Features

No Python.

#Installation

; zig fetch --save git+https://git.sr.ht/~romi/offu#front
pub fn build(b: *std.Build) void {
    const target = b.standardTargetOptions(.{});
    const optimize = b.standardOptimizeOption(.{});

    const offu = b.dependency("offu", .{
        .target = target,
        .optimize = optimize,
    }).module("offu");

    const exe = b.addExecutable(.{
        .name = "my-project",
        .root_source_file = .{ .path = "src/main.zig" },
        .target = target,
        .optimize = optimize,
    });
    exe.root_module.addImport("offu", offu);
}

#Examples

Browse the examples directory.

; zig build examples

#Docs

API: https://sansfontieres.com/docs/offu