File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,13 @@ variable-fonts = ["ttf-parser/variable-fonts"]
2626gvar-alloc = [" ttf-parser/gvar-alloc" ]
2727# opentype-layout is not supported.
2828# apple-layout is not supported.
29+ capi = []
2930
3031[profile .release ]
3132lto = true
33+
34+ [package .metadata .capi .header ]
35+ generation = false
36+
37+ [package .metadata .capi .install .include ]
38+ asset = [{ from =" ttfparser.h" }]
Original file line number Diff line number Diff line change @@ -19,6 +19,25 @@ gcc test.c -g -o test -L./target/debug/ -lttfparser
1919env LD_LIBRARY_PATH=./target/debug/ ./test
2020```
2121
22+ ## Using cargo-c
23+ This crate can be built and installed using [ cargo-c] ( https://crates.io/crates/cargo-c ) .
24+
25+ ### Build and test
26+ To build and used it uninstalled
27+ ``` sh
28+ cargo cbuild -v --library-type staticlib
29+ export PKG_CONFIG_PATH=< the path cbuild shows at the end>
30+ gcc test.c -g -o test ` pkg-config --libs --cflags tffparser`
31+ ./test
32+ ```
33+
34+ ### Install
35+ To install it system-wide
36+ ``` sh
37+ cargo cinstall --destdir /tmp/ttf-parser
38+ sudo cp -a /tmp/ttf-parser/* /
39+ ```
40+
2241## Safety
2342
2443- The library doesn't use ` unsafe ` (except the bindings itself).
You can’t perform that action at this time.
0 commit comments