Commit Graph

172 Commits

Author SHA1 Message Date
Ryan Thomas ec06a98b00 Bump core-text version. 2017-08-01 20:20:02 +01:00
Ryan Thomas 8aedead6e1 Bump foundation and graphics versions for #62. 2017-08-01 20:14:58 +01:00
bors-servo 69611a4df2 Auto merge of #66 - glennw:bump, r=KiChjang
Bump version for private/public nightly error change.

<!-- 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/66)
<!-- Reviewable:end -->
2017-07-09 17:43:36 -07:00
Glenn Watson df6cf80870 Bump version for private/public nightly error change. 2017-07-10 10:40:31 +10:00
bors-servo a2368a0614 Auto merge of #65 - omakk:master, r=jdm
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 -->
2017-07-05 12:38:34 -07:00
Omar Akkila 6847e69397 Fix core-text related warnings (#62)
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
2017-07-04 10:22:36 +04:00
bors-servo 91227a0982 Auto merge of #64 - Ketsuban:master, r=jdm
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 -->
2017-06-29 09:36:16 -07:00
Thomas Winwood 32a02b5916 Remove unnecessary mutability 2017-06-29 08:04:26 +01:00
Thomas Winwood 7ce0615193 Remove unnecessary parentheses around if condition 2017-06-29 08:03:14 +01:00
bors-servo 39bce8de08 Auto merge of #63 - staktrace:mlion, r=jdm
Flip the lion feature into a mountainlion feature which is additive rather than subtractive

This addresses @kvark's comment at https://github.com/servo/core-text-rs/pull/61#issuecomment-309853548

<!-- 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/63)
<!-- Reviewable:end -->
2017-06-21 07:53:22 -07:00
Kartikaya Gupta 9203aad673 Flip the lion feature into a mountainlion feature which is additive rather than subtractive 2017-06-20 16:23:23 -04:00
bors-servo 0592fe01c2 Auto merge of #61 - staktrace:lion, r=jdm
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 -->
2017-06-20 09:12:02 -07:00
Kartikaya Gupta 97923f8535 Add a lion feature for 10.7 compatibility 2017-06-20 12:11:11 -04:00
bors-servo c04961f8fa Auto merge of #59 - algesten:versions, r=jdm
Two version changes

API change, so did a major version.

<!-- 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/59)
<!-- Reviewable:end -->
2017-05-31 08:15:53 -05:00
Martin Algesten 63d3cde7ed update major version 2017-05-31 10:59:20 +02:00
Martin Algesten eb6eed213c Update to use core-graphics 0.8 2017-05-31 10:57:41 +02:00
bors-servo 7a267bc8f6 Auto merge of #58 - algesten:font_path, r=jdm
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 -->
2017-05-15 14:12:48 -05:00
bors-servo f527a1f446 Auto merge of #57 - algesten:cascade, r=jdm
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 -->
2017-05-15 13:53:04 -05:00
Martin Algesten 66b4970a4d CTFontCopyDefaultCascadeListForLanguages 2017-05-15 20:45:39 +02:00
Martin Algesten 2e97ea2d63 font_path may be null 2017-05-15 20:45:03 +02:00
bors-servo 9648cb5b87 Auto merge of #56 - nox:core-graphics, r=KiChjang
Update core-graphics to 0.7

<!-- 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/56)
<!-- Reviewable:end -->
2017-02-17 15:40:11 -08:00
Anthony Ramine cd2d4540ea Update core-graphics to 0.7 2017-02-18 00:38:42 +01:00
bors-servo f59cee725b Auto merge of #55 - jrmuizel:update-deps, r=jdm
Update core-graphics and core-foundation dependencies

<!-- 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/55)
<!-- Reviewable:end -->
2017-01-26 20:31:42 -08:00
Jeff Muizelaar f6320819a0 Update core-graphics and core-foundation dependencies 2017-01-26 11:26:34 -05:00
bors-servo 986903fd00 Auto merge of #54 - changm:core-graphics, r=jdm
Update to use core-graphics 0.5

<!-- 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/54)
<!-- Reviewable:end -->
2017-01-13 17:01:01 -08:00
Mason Chang da156f7296 Update to use core-graphics 0.5 2017-01-13 17:00:00 -08:00
bors-servo a93150b6da Auto merge of #53 - jrmuizel:kcolor, r=jdm
Add kCTFontColorGlyphsTrait

<!-- 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/53)
<!-- Reviewable:end -->
2016-10-31 12:24:22 -05:00
Jeff Muizelaar 928c0e96d4 Add kCTFontColorGlyphsTrait 2016-10-31 13:17:37 -04:00
bors-servo 3e2e5d62b9 Auto merge of #52 - servo:travis, r=nox
Test on stable.

<!-- 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/52)
<!-- Reviewable:end -->
2016-08-03 04:05:59 -05:00
Ms2ger bcac61315e Test on stable. 2016-08-03 10:47:11 +02:00
bors-servo 7de1ec014d Auto merge of #51 - nox:core-graphics, r=Ms2ger
Update core-graphics to 0.4

<!-- 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/51)
<!-- Reviewable:end -->
2016-08-03 03:09:51 -05:00
Anthony Ramine 1c75161962 Update core-graphics to 0.4 2016-08-03 10:04:32 +02:00
bors-servo 5e55c6198e Auto merge of #50 - mbrubeck:units_per_em, r=pcwalton
Add binding for CTFontGetUnitsPerEm

Needed for implementing fast-path kerning on Mac OS. r? @pcwalton

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/50)
<!-- Reviewable:end -->
2016-05-19 10:34:06 -07:00
Matt Brubeck e3c50e0d56 Add binding for CTFontGetUnitsPerEm 2016-05-19 08:59:50 -07:00
bors-servo 4e1981abbf Auto merge of #49 - servo:core-graphics, r=pcwalton
Allow core-graphics 0.3

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/49)
<!-- Reviewable:end -->
2016-03-09 08:19:55 +05:30
Anthony Ramine a14b9c3990 Allow core-graphics 0.3 2016-03-09 03:49:04 +01:00
bors-servo 3153201097 Auto merge of #48 - servo:meta, r=mbrubeck
Add some metadata.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/48)
<!-- Reviewable:end -->
2015-12-12 04:36:47 +05:30
Ms2ger a4ce7a8015 Add some metadata. 2015-12-11 18:05:55 -05:00
bors-servo d5f6324ddf Auto merge of #47 - servo:bump, r=mbrubeck
Update the version number.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/47)
<!-- Reviewable:end -->
2015-12-12 04:30:01 +05:30
Ms2ger 33adff9bc5 Update the version number. 2015-12-11 17:57:59 -05:00
bors-servo 1f4f3756bb Auto merge of #46 - antrik:bump-core-graphics, r=Ms2ger
Update core-graphics dependency to 0.2

This is what the rest of Servo is using -- so bump it here as well to
avoid test-tidy failure.

Note that this is indeed the version Servo is currently using core-text
with (as Servo still has a revision of core-text that didn't specify any
version constraints) -- so we are rather certain that this combination
works.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/46)
<!-- Reviewable:end -->
2015-12-12 04:23:34 +05:30
Olaf Buddenhagen 86729c6881 Update core-graphics dependency to 0.2
This is what the rest of Servo is using -- so bump it here as well to
avoid test-tidy failure.

Note that this is indeed the version Servo is currently using core-text
with (as Servo still has a revision of core-text that didn't specify any
version constraints) -- so we are rather certain that this combination
works.
2015-12-11 23:39:33 +01:00
bors-servo a9361cb002 Auto merge of #45 - antrik:debug, r=metajack
Derive Debug for CTFont, CTFontCollection, CTFontDescriptor

These are all the structs as far as I can see.

Note that this is entirely untested... Let's see whether I got it right :-)

(Needed for https://github.com/servo/servo/pull/8908 )

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/45)
<!-- Reviewable:end -->
2015-12-11 11:55:09 +05:30
Olaf Buddenhagen 43d0edb208 Derive Debug for CTFont, CTFontCollection, CTFontDescriptor
These are all the structs as far as I can see.
2015-12-10 00:56:29 +01:00
bors-servo a0c138859b Auto merge of #44 - servo:explicit-dependencies, r=Ms2ger
Use more explicit dependency versions

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/44)
<!-- Reviewable:end -->
2015-12-08 20:01:05 +05:30
Corey Farwell 4a20a710f8 Use more explicit dependency versions 2015-12-08 09:00:43 -05:00
bors-servo 7baa6a7ae1 Auto merge of #43 - pcwalton:draw, r=metajack
Add support for drawing glyphs and fetching their bounding rects

r? @metajack

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/43)
<!-- Reviewable:end -->
2015-10-29 05:58:07 +05:30
Patrick Walton ebd9b347ac Add support for drawing glyphs and fetching their bounding rects 2015-10-28 17:28:01 -07:00
bors-servo 7140635fa8 Auto merge of #42 - pcwalton:url, r=glennw
Allow the URL of the Core Text font to be fetched.

This allows FreeType to load Core Text fonts, which is necessary for
WebRender (unless we want a Quartz backend for WebRender).

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/core-text-rs/42)
<!-- Reviewable:end -->
2015-09-30 18:51:57 -06:00
Patrick Walton 8380931660 Allow the URL of the Core Text font to be fetched.
This allows FreeType to load Core Text fonts, which is necessary for
WebRender (unless we want a Quartz backend for WebRender).
2015-09-30 17:50:30 -07:00