Add iOS support
Ability to build core-text-rs for iOS platform have been added in this PR.
For building could be used:
cargo build --target aarch64-apple-ios
@larsbergstrom
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/73)
<!-- Reviewable:end -->
Fix core-text related warnings (#62)
### Fix private-in-public warnings (error E0446)
Fixed by prepending `pub` to the offending types. Not sure if its the best way but it was the only thing that worked. Other methods I've tried to maintain privateness:
* Replace with an empty enum. That threw an error.
* Make it public and wrap within a private module. That threw an error too as `#[repr(C)]` does not accept modules
### Fix use of extern static warnings by wrapping in unsafe block (error E0133)
I think this is self-explanatory.
### Fix zero-size struct warnings on certain CT* types
Wrap around c_void as I believe the types are only used as pointers. Again, let me know if there is a better way to do this. I've tried following [this discussion](https://github.com/rust-lang/rust/issues/27303) on opaque C types but I don't think there is a consensus. I came across this [discussion](https://github.com/AngryLawyer/rust-sdl2/issues/442) from the Rust SDL2 bindings and they eventually [opted](https://github.com/AngryLawyer/rust-sdl2/pull/445) for the solution that I implemented.
This is my first pull request (hence, first open source contribution) and I've been playing with Rust for the past few weeks. So please, if anything isnt up to standards or correctness, let me know! Also, to squash the other warnings, those changes would have to made in the modules where those types reside (core-graphics and core-foundation). I would gladly open a PR to fix those too if all looks good.
Thanks!
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/65)
<!-- Reviewable:end -->
Fix private-in-public warnings (error E0446)
Fix use of extern static warnings by wrapping in unsafe block (error E0133)
Fix zero-size struct warnings on certain CT* types
Deal with two ultra-trivial warnings
I was too lazy to set git up and clone the repo locally, so these are the only warnings from the mondo list in #62 that I could do anything about right now. I'd like to get to at least some of the rest—the private-type-in-public-interface ones seem at first glance to be pretty doable, but I'd need to be able to run the compiler over the code to check for cascades.
(The fact I did this entirely in the Github UI also means I couldn't squash the two commits myself. Sorry.)
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/64)
<!-- Reviewable:end -->
Add a lion feature for 10.7 compatibility
This allows #57 to build on OS X 10.7, if built with the "lion" feature. This is modeled on the "elcapitan" feature in core-graphics-rs.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/61)
<!-- Reviewable:end -->
font_path may be null
Given PR #57, we can quite easily get `CTFontDescriptor` that returns `null` for the `font_path`.
In the default font chains I've seen at least two fonts that are part of the chains but we can't get the `font_path`. Interestingly the font names and family names are prefixed with a `.` as if to indicate they are internal:
".Apple Symbols Fallback",
".Noto Sans Universal",
This is a breaking change, so may be undesirable, but I think it requires discussion.
Here's the full fallback list for `Menlo` and language `en`.
```
"Monaco",
".Apple Symbols Fallback",
"Lucida Grande",
"Courier New",
"Ayuthaya",
"Kailasa",
"PingFang SC",
"PingFang TC",
"Hiragino Sans",
"Hiragino Sans GB",
"Apple SD Gothic Neo",
"PingFang HK",
"Kohinoor Bangla",
"Kohinoor Devanagari",
"Gujarati Sangam MN",
"Gurmukhi MN",
"Kannada Sangam MN",
"Khmer Sangam MN",
"Lao Sangam MN",
"Malayalam Sangam MN",
"Myanmar Sangam MN",
"Oriya Sangam MN",
"Sinhala Sangam MN",
"Tamil Sangam MN",
"Kohinoor Telugu",
"Mshtakan",
"Euphemia UCAS",
"Plantagenet Cherokee",
".Noto Sans Universal",
"Apple Color Emoji"
```
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/58)
<!-- Reviewable:end -->
CTFontCopyDefaultCascadeListForLanguages
This adds `cascade_list_for_languages` to get apple's built in font fallbacks chains per font/language list combo.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/57)
<!-- Reviewable:end -->