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"]
26
26
gvar-alloc = [" ttf-parser/gvar-alloc" ]
27
27
# opentype-layout is not supported.
28
28
# apple-layout is not supported.
29
+ capi = []
29
30
30
31
[profile .release ]
31
32
lto = 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
19
19
env LD_LIBRARY_PATH=./target/debug/ ./test
20
20
```
21
21
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
+
22
41
## Safety
23
42
24
43
- The library doesn't use ` unsafe ` (except the bindings itself).
You can’t perform that action at this time.
0 commit comments