FontVertexBuilder

1.2.1

yukiny0811/FontVertexBuilder

What's New

v1.2.1

2024-02-05T17:07:55Z

fix access modifier in SVG class

FontVertexBuilder

Creates triangulated meshes from text font.

Usage

Use PathText to create line path from text font, and use GlyphUtil to create triangulated meshes from line path.

let pathText = PathText.init(
    text: "ABCDE",
    fontName: "AppleSDGothicNeo-Bold",
    fontSize: 10,
    bounds: .zero,
    pivot: .zero,
    textAlignment: .natural,
    verticalAlignment: .center,
    kern: 0,
    lineSpacing: 0,
    isClockwiseFont: true
)
let triangulatedMesh = GlyphUtil.MainFunctions.triangulate(pathText.calculatedPaths, isClockwiseFont: true)

Acknowledgements

Font -> Path algorithms

Original algorithms are from https://github.com/Hi-Rez/Satin. Translated from obj-c code to Swift, and made some modifications. License text is written directly in the source code.

Vector operations on Integer field

Original code is obtained from https://github.com/iShape-Swift/iGeometry. Some modifications are made for convenience. See LICENSE

Triangulation

Original code is obtained from https://github.com/iShape-Swift/iShapeTriangulation. Some modifications are made for convenience. See LICENSE

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

Last updated: Mon Mar 18 2024 10:57:06 GMT-0900 (Hawaii-Aleutian Daylight Time)