No description
Find a file
Emi ffc5e8ad73
Some checks failed
CI / x86_64-linux (push) Has been cancelled
cleanup
Signed-off-by: Emi <emi@hexops.com>
2025-02-25 22:25:55 -07:00
.github cleanup 2025-02-25 22:25:55 -07:00
fonts fix font path 2023-07-31 09:00:37 -07:00
.gitattributes add project structure 2023-06-24 14:19:48 -07:00
.gitignore update to Zig 2024.05 2024-06-02 12:49:55 -07:00
build.zig update to Zig 2024.05 2024-06-02 12:49:55 -07:00
LICENSE cleanup project structure; add license info 2023-06-24 14:20:18 -07:00
LICENSE-APACHE cleanup project structure; add license info 2023-06-24 14:20:18 -07:00
LICENSE-MIT cleanup project structure; add license info 2023-06-24 14:20:18 -07:00
main.zig cleanup project structure; add license info 2023-06-24 14:20:18 -07:00
README.md add project structure 2023-06-24 14:19:48 -07:00

font-assets: a few fonts packaged for Zig

This repository contains a few fonts packaged via the Zig package manager. They are primarily what is needed to test mach-freetype, as well as what is used in Mach examples.

Getting started

Adding dependency

Create a build.zig.zon file in your project (replace $LATEST_COMMIT with the latest commit hash):

.{
    .name = "mypkg",
    .version = "0.1.0",
    .dependencies = .{
        .mach_ggml = .{
            .url = "https://github.com/hexops/font-assets/archive/$LATEST_COMMIT.tar.gz",
        },
    },
}

Run zig build in your project, and the compiler instruct you to add a .hash = "..." field next to .url.

Then use the dependency in your build.zig:

...
pub fn build(b: *Build) void {
    ...
    exe.addModule("font-assets", b.dependency("font_assets", .{
        .target = target,
        .optimize = optimize,
    }).module("font-assets"));
}

You may then const font_assets = @import("font-assets"); and refer to the embedded files exposed in main.zig.

Usage

const font_assets = @import("font-assets");

// access the embedded file byte arrays, e.g.
// font_assets.fira_sans_regular_ttf

Join the community

Join the Mach community on Discord to discuss this project, ask questions, get help, etc.

Issues

Issues are tracked in the main Mach repository.