Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=905aeaaf51ce3e7aa77ff1880b7b0712a67c19fe80b2dd0923da8bb78583daa8
sha512=0ec4fc71bd758b64da9156d249d55eee3fbaa6190bb85ced9d48b51c04eb140b259168d74d59e1f6f6f705204ef68265537f98d7a5e8ec7e07e3d250e3a21154
Description
An OCaml library for manipulation of font glyph outlines. It provides a suite of tools for analyzing, transforming, composing, and converting glyph paths between different formats.
Added to opam-repository:
README
Smaji Glyph Path
An OCaml library for manipulation of font glyph outlines. It provides a suite of tools for analyzing, transforming, composing, and converting glyph paths between different formats.
This library supports two primary path description standards:
- SVG Path: Supports
<path>element (including itsdattribute) and optional<g>element as containers. - Glif Format: Supports the data used to describe glyph outlines in the Unified Font Object (UFO) format.
Note, this project is specifically designed for glyph path manipulation and is not a general-purpose SVG library. It focuses on the specific subset of SVG features used to describe glyph paths.
Key Features
- 2D Geometry Foundations: Includes modules for points (Point), 2x2 matrices (Matrix), and line representations based on slope and intercept (Line).
- Bézier Curves: Supports linear, quadratic, cubic, and any degree Bézier curves.
Path Transformations:
- Basic Operations: Translate and scale complex paths.
- Bounding Box Calculations: Automatically calculate path boundaries and provide tools to accurately fit paths into specific ViewBox or frame.
Multi-Format Support:
- SVG Path Processing
- Glif Path Processing
- Format convertion between Svg.t, Glif.t, Path.t.
Module Overview
- Point: Provides fundamental 2D vector arithmetic (addition, scaling, rotation, distance calculation, etc.).
- Matrix: 2x2 matrix transformations for handling rotation and coordinate system changes.
- Bezier: Provides Bézier curve interpolation algorithms to convert curves into point sequences.
- Line: Handles line intersection calculations and vector-based line segment operations.
- Path: Defines basic path data types (supporting Line, Qcurve, Ccurve, etc.) and provides core geometric algorithms such as translation, scaling, and bounding box fitting.
- Svg_path: Handles the mapping and conversion between SVG path commands (e.g., M, L, C, Q, A) and the internal Path structure.
- Svg: Manages SVG container structures. Note: Only supports
<path>element, itsdattribute, and optional<g>container. Provides ViewBox auto-reset and fitting functionality. - Glif: UFO Glif Path Module. Specifically designed to parse glyph path data from the Unified Font Object (UFO) format and convert them into the internal path model.
Related projects
Dev Dependencies (2)
-
odoc
with-doc -
ppx_expect
with-test
Optional Dependencies
None
Used by
None
Conflicts
None
Build status
Results of building smaji_glyph_path with each compiler on check.ci.ocaml.org, run of against opam-repository 8a77e58. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 0.1.0 (this version) | good | good | good | good | good |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure