opentype.hx


https://github.com/Laerdal/opentype.hx

To install, run:

haxelib install opentype.hx 0.0.4 

See using Haxelib in Haxelib documentation for more information.

README.md

opentype.hx

Cross platfrom Opentype support library for Haxe. The idea of Opentype.hx is to port of https://github.com/opentypejs/opentype.js and deliver a platform independent font library.

Current release is the initial Alpha release

Getting started

1) Install the lib:

haxelib install opentype.hx

2) Create a file called Main.hx:

import opentype.OpenType;
import opentype.Font;
import haxe.io.Bytes;

class Main {
    static function main() {
        var fontBytes : Bytes;
        OpenType.loadFromFile("path/to/truetype-font.ttf", (b) -> {
            fontBytes = b;
            var font : Font;
            font = OpenType.parse(fontBytes);
        }, (e) -> { trace(e); }
        );
    }
}

3) Compile to eg. JavaScript for Nodejs by creating file build.hxml with the following content:

-lib opentype.hx
-lib hxnodejs
--js js/app.js
--main Main

4) And build it with the commmand:

haxe build.hxml
Contributors
mikkelmr
Version
0.0.4
Published
4 years ago
Dependencies
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub