diff --git a/Cargo.lock b/Cargo.lock index bae9bde2e0..02eea31d64 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -22,8 +22,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.16 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -33,8 +33,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.16 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -127,7 +127,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "core-foundation 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.16 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -175,6 +175,30 @@ dependencies = [ "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "dwrite-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "dwrote" +version = "0.1.0" +source = "git+https://github.com/vvuk/dwrote-rs#2bf7d4792d15fccb50f1e247e4be9c2c7b893f2b" +dependencies = [ + "dwrite-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_codegen 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "euclid" version = "0.10.2" @@ -183,8 +207,8 @@ dependencies = [ "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.16 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -195,7 +219,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "freetype" version = "0.1.1" -source = "git+https://github.com/servo/rust-freetype#7a753764468af57b30f0eda9441f17d635cb62cf" +source = "git+https://github.com/servo/rust-freetype#5b19cac13fc94130475efa0b4b72521af1a2bc80" dependencies = [ "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", "servo-freetype-sys 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -297,7 +321,7 @@ dependencies = [ "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.16 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -406,7 +430,7 @@ dependencies = [ "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.16 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", "user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "x11 2.11.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -422,33 +446,33 @@ dependencies = [ [[package]] name = "phf" -version = "0.7.18" +version = "0.7.19" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "phf_shared 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "phf_codegen" -version = "0.7.18" +version = "0.7.19" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "phf_generator 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)", - "phf_shared 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_generator 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "phf_generator" -version = "0.7.18" +version = "0.7.19" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "phf_shared 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "phf_shared" -version = "0.7.18" +version = "0.7.19" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -491,7 +515,7 @@ dependencies = [ [[package]] name = "rustc-serialize" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -514,20 +538,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "0.8.16" +version = "0.8.17" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde_codegen" -version = "0.8.16" +version = "0.8.17" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "post-expansion 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde_codegen_internals 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex 0.46.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_syntax 0.46.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_syntax 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -540,11 +564,11 @@ dependencies = [ [[package]] name = "serde_derive" -version = "0.8.16" +version = "0.8.17" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "post-expansion 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_codegen 0.8.16 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_codegen 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -555,7 +579,7 @@ dependencies = [ "dtoa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.16 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -596,45 +620,45 @@ dependencies = [ [[package]] name = "syntex" -version = "0.46.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "syntex_errors 0.46.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_syntax 0.46.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_errors 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_syntax 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "syntex_errors" -version = "0.46.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_pos 0.46.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_pos 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "syntex_pos" -version = "0.46.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "syntex_syntax" -version = "0.46.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_errors 0.46.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex_pos 0.46.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_errors 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_pos 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -644,8 +668,8 @@ name = "target_build_utils" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "phf 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)", - "phf_codegen 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)", + "phf 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_codegen 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -770,9 +794,11 @@ dependencies = [ "app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "core-text 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dwrote 0.1.0 (git+https://github.com/vvuk/dwrote-rs)", "euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "freetype 0.1.1 (git+https://github.com/servo/rust-freetype)", @@ -794,14 +820,15 @@ dependencies = [ "app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "dwrote 0.1.0 (git+https://github.com/vvuk/dwrote-rs)", "euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "offscreen_gl_context 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.8.16 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_codegen 0.8.16 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 0.8.16 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_codegen 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -876,6 +903,8 @@ dependencies = [ "checksum dlib 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "148bce4ce1c36c4509f29cb54e62c2bd265551a9b00b38070fad551a851866ec" "checksum dtoa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0dd841b58510c9618291ffa448da2e4e0f699d984d436122372f446dae62263d" "checksum dwmapi-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07c4c7cc7b396419bc0a4d90371d0cee16cb5053b53647d287c0b728000c41fe" +"checksum dwrite-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a7918280f33862bc8542212d74f2149b1a87ab402fd15f4ce9a1c56582958d6e" +"checksum dwrote 0.1.0 (git+https://github.com/vvuk/dwrote-rs)" = "" "checksum euclid 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "44ef2a3e4a621518e488db36820a12b49a9d5004764b8daf1458bbe5d7c9b626" "checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344" "checksum freetype 0.1.1 (git+https://github.com/servo/rust-freetype)" = "" @@ -903,32 +932,32 @@ dependencies = [ "checksum objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "877f30f37acef6749b1841cceab289707f211aecfc756553cd63976190e6cc2e" "checksum offscreen_gl_context 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "000307b66855b01357765d9ac8d32a66aa09f3dcc3a7ccb272f74c76df475c9c" "checksum osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" -"checksum phf 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)" = "971dd94df0728890a6fd7cf01b61e3f1fc84acb308175d196a9ceb2aa0e04b90" -"checksum phf_codegen 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)" = "29fa7fa119b1dd493cc17d69052281ad38767c6e5f6f29263bbd57027aee7f71" -"checksum phf_generator 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)" = "e3497bdd90ab6e6f9295d4877ac89b74dd0635304b9c89a6677f17d87bb5ef8d" -"checksum phf_shared 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)" = "69668cdb43ef62e348ec04e4acea0ba200f9945230523fb1f1c1f462f27a8e2b" +"checksum phf 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)" = "95cb41511b13e592110b5c8323c1d489513b6db919148f909b8b804be73a74b5" +"checksum phf_codegen 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)" = "8b74506ea0ea5f6adbef815c1e964daa2d395e7c29b7196d390a67a31fa2a020" +"checksum phf_generator 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)" = "d5e1d4b224dfc609b025ea389e6eb9b850ae5814272880d7d75d71acc3d57c88" +"checksum phf_shared 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)" = "9f3d84458c4040eb4b9e626cb551a2dc46d92ea96b1c30331aa9fce9abd2c438" "checksum pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8cee804ecc7eaf201a4a207241472cc870e825206f6c031e3ee2a72fa425f2fa" "checksum post-expansion 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "31a834a6060acaef74a8d878f6ca37a2b86fefe042bbfe70689ba587e42526f9" "checksum quote 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1e0c9bc6bfb0a60d539aab6e338207c1a5456e62f5bd5375132cee119aa4b3" "checksum rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "2791d88c6defac799c3f20d74f094ca33b9332612d9aef9078519c82e4fe04a5" "checksum rayon 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3b6a6e05e0e6b703e9f2ad266eb63f3712e693a17a2702b95a23de14ce8defa9" -"checksum rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)" = "6159e4e6e559c81bd706afe9c8fd68f547d3e851ce12e76b1de7914bab61691b" +"checksum rustc-serialize 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)" = "0c11e5465fcfde38cd9068f031d9eae19d2530bee91b129fed44f2b122697749" "checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" "checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" "checksum serde 0.7.15 (registry+https://github.com/rust-lang/crates.io-index)" = "1b0e0732aa8ec4267f61815a396a942ba3525062e3bd5520aa8419927cfc0a92" -"checksum serde 0.8.16 (registry+https://github.com/rust-lang/crates.io-index)" = "1105e65d0a0b212d2d735c8b5a4f6aba2adc501e8ad4497e9f1a39e4c4ac943e" -"checksum serde_codegen 0.8.16 (registry+https://github.com/rust-lang/crates.io-index)" = "446384bcfd7d9276a23b51e9dc14341909ad05377b68ac5da6f83a7a2094bcd0" +"checksum serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)" = "784e249221c84265caeb1e2fe48aeada86f67f5acb151bd3903c4585969e43f6" +"checksum serde_codegen 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)" = "c3b932a3bb4d729e39aa04cc5e2f2ac70ba239a5a151d2dc9a1956fd6a2f7c15" "checksum serde_codegen_internals 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "318f7e77aa5187391d74aaf4553d2189f56b0ce25e963414c951b97877ffdcec" -"checksum serde_derive 0.8.16 (registry+https://github.com/rust-lang/crates.io-index)" = "de0edf3d328158ba2bbb0214427343881e5034aeb8df43cec66f9af6c25836d0" +"checksum serde_derive 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)" = "c6a73f0e5fc193668afa2a714bf8397063af46e6c8df72686e53fbac15b2e38c" "checksum serde_json 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1cb6b19e74d9f65b9d03343730b643d729a446b29376785cd65efdff4675e2fc" "checksum servo-freetype-sys 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9232032c2e85118c0282c6562c84cab12316e655491ba0a5d1905b2320060d1b" "checksum shared_library 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fb04126b6fcfd2710fb5b6d18f4207b6c535f2850a7e1a43bcd526d44f30a79a" "checksum shell32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "72f20b8f3c060374edb8046591ba28f62448c369ccbdc7b02075103fb3a9e38d" "checksum syn 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "76c2db66dc579998854d84ff0ff4a81cb73e69596764d144ce7cece4d04ce6b5" -"checksum syntex 0.46.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6e0c45ebc6d4b9dcb45b74b8e5a4f484dbe3db1edf626c582e7bf2973926d3fe" -"checksum syntex_errors 0.46.0 (registry+https://github.com/rust-lang/crates.io-index)" = "59d5e0eab8b15b3aa47acc2c2f57fa8143f23a3632d269020404258af71bdb1b" -"checksum syntex_pos 0.46.0 (registry+https://github.com/rust-lang/crates.io-index)" = "06970950ad719185882a658f194dbc78dab9fa2527f2174b9f8f3061c686cd0c" -"checksum syntex_syntax 0.46.0 (registry+https://github.com/rust-lang/crates.io-index)" = "51fb8ac3fcb2c4485082bef800eb5bea7a7fa5b6745eab583e3484edb86142ee" +"checksum syntex 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17e2e2ad78f4942d011750c304e9a9874717b6986c8fa2f6072f58fbd0835dcb" +"checksum syntex_errors 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0b2784ff2ca385a451f1f835dcb3926e5c61461c6468aac1e35edcbc4cd33808" +"checksum syntex_pos 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)" = "25fadff25e4db9336cd715dea4bc7d4bf51d08cc39a1463b689661f1dea6893c" +"checksum syntex_syntax 0.48.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0c3c7d1082d30f7042d1e7b00bd2ab0466daa84529fa13891e9312d8a32fd97e" "checksum target_build_utils 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "54c550e226618cd35334b75e92bfa5437c61474bdb75c38bf330ab5a8037b77c" "checksum tempfile 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9270837a93bad1b1dac18fe67e786b3c960513af86231f6f4f57fddd594ff0c8" "checksum term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3deff8a2b3b6607d6d7cc32ac25c0b33709453ca9cceac006caac51e963cf94a" diff --git a/webrender/Cargo.toml b/webrender/Cargo.toml index ef030414c2..ac40a2cf58 100644 --- a/webrender/Cargo.toml +++ b/webrender/Cargo.toml @@ -28,9 +28,12 @@ time = "0.1" webrender_traits = {path = "../webrender_traits", default-features = false} bitflags = "0.7" -[target.'cfg(any(target_os = "android", target_os = "windows", all(unix, not(target_os = "macos"))))'.dependencies] +[target.'cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))'.dependencies] freetype = {git = "https://github.com/servo/rust-freetype"} +[target.'cfg(target_os = "windows")'.dependencies] +dwrote = {git = "https://github.com/vvuk/dwrote-rs"} + [target.'cfg(target_os = "macos")'.dependencies] core-graphics = "0.4.1" core-text = "2.0" diff --git a/webrender/src/lib.rs b/webrender/src/lib.rs index c3eeb5f9d5..54855666e3 100644 --- a/webrender/src/lib.rs +++ b/webrender/src/lib.rs @@ -75,17 +75,23 @@ mod util; mod platform { #[cfg(target_os="macos")] pub use platform::macos::font; - #[cfg(any(target_os = "android", target_os = "windows", all(unix, not(target_os = "macos"))))] + #[cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))] pub use platform::unix::font; + #[cfg(target_os = "windows")] + pub use platform::windows::font; #[cfg(target_os="macos")] pub mod macos { pub mod font; } - #[cfg(any(target_os = "android", target_os = "windows", all(unix, not(target_os = "macos"))))] + #[cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))] pub mod unix { pub mod font; } + #[cfg(target_os = "windows")] + pub mod windows { + pub mod font; + } } pub mod renderer; @@ -95,9 +101,12 @@ extern crate core_graphics; #[cfg(target_os="macos")] extern crate core_text; -#[cfg(not(target_os="macos"))] +#[cfg(all(unix, not(target_os="macos")))] extern crate freetype; +#[cfg(target_os = "windows")] +extern crate dwrote; + extern crate app_units; extern crate bincode; extern crate euclid; diff --git a/webrender/src/platform/windows/font.rs b/webrender/src/platform/windows/font.rs new file mode 100644 index 0000000000..9f1109215e --- /dev/null +++ b/webrender/src/platform/windows/font.rs @@ -0,0 +1,155 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +use app_units::Au; +use std::collections::HashMap; +use webrender_traits::{FontKey, FontRenderMode, GlyphDimensions}; + +use dwrote; + +lazy_static! { + static ref DEFAULT_FONT_DESCRIPTOR: dwrote::FontDescriptor = dwrote::FontDescriptor { + family_name: "Arial".to_owned(), + weight: dwrote::FontWeight::Regular, + stretch: dwrote::FontStretch::Normal, + style: dwrote::FontStyle::Normal, + }; +} + +pub struct FontContext { + fonts: HashMap, + gdi_interop: dwrote::GdiInterop, + main_display_rendering_params: dwrote::RenderingParams, +} + +pub struct RasterizedGlyph { + pub width: u32, + pub height: u32, + pub bytes: Vec, +} + +impl FontContext { + pub fn new() -> FontContext { + FontContext { + fonts: HashMap::new(), + gdi_interop: dwrote::GdiInterop::create(), + main_display_rendering_params: dwrote::RenderingParams::create_for_primary_monitor(), + } + } + + pub fn add_raw_font(&mut self, font_key: &FontKey, _: &[u8]) { + if self.fonts.contains_key(font_key) { + return + } + + debug!("DWrite WR backend can't do raw fonts yet, using Arial instead"); + + self.add_native_font(font_key, DEFAULT_FONT_DESCRIPTOR.clone()); + } + + pub fn add_native_font(&mut self, font_key: &FontKey, font_handle: dwrote::FontDescriptor) { + if self.fonts.contains_key(font_key) { + return + } + + let system_fc = dwrote::FontCollection::system(); + let realized_font = system_fc.get_font_from_descriptor(&font_handle).unwrap(); + self.fonts.insert((*font_key).clone(), realized_font); + } + + fn get_glyph_dimensions_and_maybe_rasterize(&self, + font_key: FontKey, + size: Au, + glyph: u32, + device_pixel_ratio: f32, + render_mode: Option) + -> (Option, Option) + { + let font = self.fonts.get(&font_key).unwrap(); + let face = font.create_font_face(); + let glyph = glyph as u16; + + let gm = face.get_design_glyph_metrics(&[glyph], false)[0]; + + let em_size = size.to_f32_px() / 16.; // (16px per em) + let du_per_pixel = face.metrics().designUnitsPerEm as f32 / 16.; // (once again, 16px per em) + let scaled_du_to_pixels = (em_size * device_pixel_ratio) / du_per_pixel; + + let width = (gm.advanceWidth as i32 - (gm.leftSideBearing + gm.rightSideBearing)) as f32 + * scaled_du_to_pixels; + let height = (gm.advanceHeight as i32 - (gm.topSideBearing + gm.bottomSideBearing)) as f32 + * scaled_du_to_pixels; + let x = (gm.leftSideBearing) as f32 + * scaled_du_to_pixels; + let y = (gm.verticalOriginY - gm.topSideBearing) as f32 + * scaled_du_to_pixels; + + // Round the glyph rect outwards. These values are in device pixels. + let x0_i = x.floor() as i32; + let y0_i = y.floor() as i32; + let x1_i = (x + width).ceil() as i32; + let y1_i = (y + height).ceil() as i32; + let width_u = (x1_i - x0_i) as u32; + let height_u = (y1_i - y0_i) as u32; + + let dims = GlyphDimensions { + left: x0_i, top: y0_i, + width: width_u, height: height_u, + }; + + // blank glyphs are None + if width_u == 0 || height_u == 0 { + return (None, None) + } + + // if we weren't asked to rasterize, we're done + if render_mode.is_none() { + return (Some(dims), None); + } + + // the coords and size to draw_glyph_run are in 1/96ths of an inch + + // size is in app units, which we convert to CSS pixels (1/96"), which + // is the same as DIPs. + let size_dip = size.to_f32_px() * device_pixel_ratio; + + let rt = self.gdi_interop.create_bitmap_render_target(width_u, height_u); + rt.set_pixels_per_dip(1.); + rt.draw_glyph_run(-x, y, + dwrote::DWRITE_MEASURING_MODE_NATURAL, + &face, size_dip, + &[glyph], &[0.0], + &[dwrote::GlyphOffset { advanceOffset: 0., ascenderOffset: 0. }], + &self.main_display_rendering_params, + &(1.0, 1.0, 1.0)); + let bytes = rt.get_opaque_values_as_mask(); + + (Some(dims), Some(RasterizedGlyph { + width: width_u, + height: height_u, + bytes: bytes + })) + } + + pub fn get_glyph_dimensions(&self, + font_key: FontKey, + size: Au, + glyph: u32, + device_pixel_ratio: f32) -> Option { + let (maybe_dims, _) = + self.get_glyph_dimensions_and_maybe_rasterize(font_key, size, glyph, device_pixel_ratio, None); + maybe_dims + } + + pub fn rasterize_glyph(&mut self, + font_key: FontKey, + size: Au, + glyph: u32, + device_pixel_ratio: f32, + render_mode: FontRenderMode) -> Option { + let (_, maybe_glyph) = + self.get_glyph_dimensions_and_maybe_rasterize(font_key, size, glyph, device_pixel_ratio, Some(render_mode)); + maybe_glyph + } +} diff --git a/webrender_traits/Cargo.toml b/webrender_traits/Cargo.toml index cbd443cd19..c7bf7d47ed 100644 --- a/webrender_traits/Cargo.toml +++ b/webrender_traits/Cargo.toml @@ -23,9 +23,12 @@ serde = "0.8" serde_derive = {version = "0.8", optional = true} ipc-channel = "0.6" -[target.x86_64-apple-darwin.dependencies] +[target.'cfg(target_os = "macos")'.dependencies] core-graphics = "0.4" +[target.'cfg(target_os = "windows")'.dependencies] +dwrote = {git = "https://github.com/vvuk/dwrote-rs"} + [build-dependencies.serde_codegen] version = "0.8" default_features = false diff --git a/webrender_traits/src/lib.rs b/webrender_traits/src/lib.rs index ec273655b3..23751fa1fc 100644 --- a/webrender_traits/src/lib.rs +++ b/webrender_traits/src/lib.rs @@ -20,7 +20,11 @@ extern crate serde; #[macro_use] extern crate serde_derive; -#[cfg(target_os = "macos")] extern crate core_graphics; +#[cfg(target_os = "macos")] +extern crate core_graphics; + +#[cfg(target_os = "windows")] +extern crate dwrote; #[cfg(feature = "serde_codegen")] include!(concat!(env!("OUT_DIR"), "/types.rs")); diff --git a/webrender_traits/src/types.rs b/webrender_traits/src/types.rs index 881b8bd925..5a301139b4 100644 --- a/webrender_traits/src/types.rs +++ b/webrender_traits/src/types.rs @@ -13,6 +13,7 @@ use ipc_channel::ipc::{IpcBytesSender, IpcSender}; use offscreen_gl_context::{GLContextAttributes, GLLimits}; #[cfg(target_os = "macos")] use core_graphics::font::CGFont; +#[cfg(target_os = "windows")] use dwrote::FontDescriptor; #[derive(Debug, Copy, Clone)] pub enum RendererKind { @@ -371,10 +372,13 @@ pub enum MixBlendMode { pub type NativeFontHandle = CGFont; /// Native fonts are not used on Linux; all fonts are raw. -#[cfg(not(target_os = "macos"))] -#[cfg_attr(not(target_os = "macos"), derive(Clone, Serialize, Deserialize))] +#[cfg(all(unix, not(target_os="macos")))] +#[cfg_attr(all(unix, not(target_os="macos")), derive(Clone, Serialize, Deserialize))] pub struct NativeFontHandle; +#[cfg(target_os = "windows")] +pub type NativeFontHandle = FontDescriptor; + #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)] pub struct PipelineId(pub u32, pub u32);