From 64b26a73c54e1263b73a14da6beba759eaeaa1f8 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 10 Aug 2020 13:11:22 -0400 Subject: [PATCH 1/4] Revert "Revert "Update raqote, font-kit, fontconfig."" This reverts commit ecfaba930494ced9eb5a299e42ebcb794d7210ac. --- Cargo.lock | 93 ++++++++++++++++-------------------- components/canvas/Cargo.toml | 4 +- components/gfx/Cargo.toml | 2 +- servo-tidy.toml | 1 - 4 files changed, 44 insertions(+), 56 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7708038be7b..cd14381b698 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -727,9 +727,9 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.41" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c84c596dcf125d6781f58e3f4254677ec2a6d8aa56e8501ac277100990b3229" +checksum = "0e56268c17a6248366d66d4a47a3381369d068cce8409bb1716ed77ea32163bb" dependencies = [ "cc", ] @@ -1216,16 +1216,6 @@ dependencies = [ "libdbus-sys", ] -[[package]] -name = "deflate" -version = "0.7.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" -dependencies = [ - "adler32", - "byteorder", -] - [[package]] name = "deflate" version = "0.8.6" @@ -1595,9 +1585,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "font-kit" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ab2cdc792b545c49acb23aafa1cdc9381ea96140741f10bac596fd1bd1aa4f" +checksum = "22ed9b6d89600e22d9bfcfdd8c27e981540664a1a85a3f3971793c75502f49d9" dependencies = [ "bitflags", "byteorder", @@ -1607,7 +1597,7 @@ dependencies = [ "dirs", "dwrote", "float-ord", - "freetype", + "freetype 0.5.1", "lazy_static", "libc", "log", @@ -1653,6 +1643,27 @@ dependencies = [ "servo-freetype-sys", ] +[[package]] +name = "freetype" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73222ab32d9ad65fe0e1c3258da8d614fd47cf19fce92b09eb520060c5c5ad5" +dependencies = [ + "freetype-sys", + "libc", +] + +[[package]] +name = "freetype-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d48ac0ce366dd47a115ec8e598d7c51b4a974fc52ded5e53a56b31f55f34f3ea" +dependencies = [ + "cmake", + "libc", + "pkg-config", +] + [[package]] name = "fs_extra" version = "1.1.0" @@ -1878,7 +1889,7 @@ dependencies = [ "euclid", "fnv", "fontsan", - "freetype", + "freetype 0.4.1", "gfx_traits", "harfbuzz-sys", "ipc-channel", @@ -2501,7 +2512,7 @@ dependencies = [ "core-graphics 0.17.3", "core-text 13.3.2", "foreign-types", - "freetype", + "freetype 0.4.1", "pkg-config", ] @@ -2744,7 +2755,7 @@ dependencies = [ "num-iter", "num-rational 0.3.0", "num-traits", - "png 0.16.6", + "png", "scoped_threadpool", "tiff", ] @@ -2770,15 +2781,6 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "inflate" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cdb29978cc5797bd8dcc8e5bf7de604891df2a8dc576973d71a281e916db2ff" -dependencies = [ - "adler32", -] - [[package]] name = "input_buffer" version = "0.3.1" @@ -4365,18 +4367,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "png" -version = "0.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef859a23054bbfee7811284275ae522f0434a3c8e7f4b74bd4a35ae7e1c4a283" -dependencies = [ - "bitflags", - "crc32fast", - "deflate 0.7.20", - "inflate", -] - [[package]] name = "png" version = "0.16.6" @@ -4385,7 +4375,7 @@ checksum = "c150bf7479fafe3dd8740dbe48cc33b2a3efb7b0fe3483aced8bbc39f6d0238d" dependencies = [ "bitflags", "crc32fast", - "deflate 0.8.6", + "deflate", "miniz_oxide 0.3.7", ] @@ -4595,15 +4585,14 @@ checksum = "a871f1e45a3a3f0c73fb60343c811238bb5143a81642e27c2ac7aac27ff01a63" [[package]] name = "raqote" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501c19caa439857ed7bea975fa4c3c10ee9a24e33c2640030c3ac14b58f39f77" +version = "0.8.1-alpha.0" +source = "git+https://github.com/jrmuizel/raqote#5444a1040bd4fd72e860ff75244fbe8fa7814470" dependencies = [ "euclid", "font-kit", "lyon_geom 0.15.0", "pathfinder_geometry", - "png 0.15.3", + "png", "sw-composite", "typed-arena", ] @@ -5159,9 +5148,9 @@ dependencies = [ [[package]] name = "servo-fontconfig" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a088f8d775a5c5314aae09bd77340bc9c67d72b9a45258be34c83548b4814cd9" +checksum = "0b47fef69c52fb55838c756949c60595f0b855daa4e82fc52ad99ff3e03e2c70" dependencies = [ "libc", "servo-fontconfig-sys", @@ -5169,20 +5158,20 @@ dependencies = [ [[package]] name = "servo-fontconfig-sys" -version = "4.0.9" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b3e166450f523f4db06c14f02a2d39e76d49b5d8cbd224338d93e3595c156c" +checksum = "1c5e8d42c2957f6f433d90ab61277ed0226b3f49fffb19aa5493213c42e5d6df" dependencies = [ "expat-sys", + "freetype-sys", "pkg-config", - "servo-freetype-sys", ] [[package]] name = "servo-freetype-sys" -version = "4.0.5" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c4ccb6d0d32d277d3ef7dea86203d8210945eb7a45fba89dd445b3595dd0dfc" +checksum = "9232032c2e85118c0282c6562c84cab12316e655491ba0a5d1905b2320060d1b" dependencies = [ "cmake", "pkg-config", @@ -6876,7 +6865,7 @@ dependencies = [ "cstr", "dwrote", "euclid", - "freetype", + "freetype 0.4.1", "fxhash", "gleam 0.11.0", "glslopt", diff --git a/components/canvas/Cargo.toml b/components/canvas/Cargo.toml index 7e3267148e6..031de667648 100644 --- a/components/canvas/Cargo.toml +++ b/components/canvas/Cargo.toml @@ -22,7 +22,7 @@ canvas_traits = { path = "../canvas_traits" } crossbeam-channel = "0.4" cssparser = "0.27" euclid = "0.20" -font-kit = "0.7" +font-kit = "0.9" fnv = "1.0" gfx = { path = "../gfx" } gleam = "0.11" @@ -32,7 +32,7 @@ log = "0.4" lyon_geom = "0.14" num-traits = "0.2" pixels = { path = "../pixels" } -raqote = { version = "0.8", features = ["text"] } +raqote = { git = "https://github.com/jrmuizel/raqote", features = ["text"] } servo_arc = { path = "../servo_arc" } servo_config = { path = "../config" } sparkle = "0.1.25" diff --git a/components/gfx/Cargo.toml b/components/gfx/Cargo.toml index 0ffa87835e1..d8ba44dc612 100644 --- a/components/gfx/Cargo.toml +++ b/components/gfx/Cargo.toml @@ -52,7 +52,7 @@ freetype = "0.4" servo_allocator = { path = "../allocator" } [target.'cfg(target_os = "linux")'.dependencies] -servo-fontconfig = "0.4" +servo-fontconfig = "0.5" [target.'cfg(target_os = "android")'.dependencies] xml-rs = "0.8" diff --git a/servo-tidy.toml b/servo-tidy.toml index 0a5db6203fc..e98cdbd5aa4 100644 --- a/servo-tidy.toml +++ b/servo-tidy.toml @@ -32,7 +32,6 @@ packages = [ "arrayvec", "base64", "cocoa", - "deflate", "gleam", "libloading", "metal", From adb75ba1142fbb05d002da65e97887fa2e39658c Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 10 Aug 2020 13:11:38 -0400 Subject: [PATCH 2/4] Revert "Revert "Update harfbuzz, freetype, unicode-script."" This reverts commit 6b520850f34d55e88678999ff85aa70ba949d10c. --- Cargo.lock | 37 +++++++++---------------------- components/gfx/Cargo.toml | 6 ++--- components/layout/Cargo.toml | 2 +- components/layout_2020/Cargo.toml | 2 +- servo-tidy.toml | 1 - 5 files changed, 16 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cd14381b698..8b538a40dcd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1007,18 +1007,6 @@ dependencies = [ "libc", ] -[[package]] -name = "core-text" -version = "13.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db84654ad95211c082cf9795f6f83dc17d0ae6c985ac1b906369dc7384ed346d" -dependencies = [ - "core-foundation 0.6.4", - "core-graphics 0.17.3", - "foreign-types", - "libc", -] - [[package]] name = "core-text" version = "15.0.0" @@ -1593,7 +1581,7 @@ dependencies = [ "byteorder", "core-foundation 0.7.0", "core-graphics 0.19.0", - "core-text 15.0.0", + "core-text", "dirs", "dwrote", "float-ord", @@ -1884,12 +1872,12 @@ dependencies = [ "byteorder", "core-foundation 0.7.0", "core-graphics 0.19.0", - "core-text 15.0.0", + "core-text", "dwrote", "euclid", "fnv", "fontsan", - "freetype 0.4.1", + "freetype 0.5.1", "gfx_traits", "harfbuzz-sys", "ipc-channel", @@ -2504,15 +2492,15 @@ checksum = "63d68db75012a85555434ee079e7e6337931f87a087ab2988becbadf64673a7f" [[package]] name = "harfbuzz-sys" -version = "0.3.4" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d74cab8498b2d15700b694fb38f77562869d05e1f8b602dd05221a1ca2d63" +checksum = "8c50680ef38c3c83947499b5df4f340db5b436807dfa2b21330d86254e2e4dd6" dependencies = [ "cc", - "core-graphics 0.17.3", - "core-text 13.3.2", + "core-graphics 0.19.0", + "core-text", "foreign-types", - "freetype 0.4.1", + "freetype 0.5.1", "pkg-config", ] @@ -6497,12 +6485,9 @@ dependencies = [ [[package]] name = "unicode-script" -version = "0.3.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f03ad95feb4fde244d79985bfd79eb34ff2702fedb441d2ba3f4ff813efd19" -dependencies = [ - "harfbuzz-sys", -] +checksum = "79bf4d5fc96546fdb73f9827097810bbda93b11a6770ff3a54e1f445d4135787" [[package]] name = "unicode-segmentation" @@ -6861,7 +6846,7 @@ dependencies = [ "cfg-if", "core-foundation 0.7.0", "core-graphics 0.19.0", - "core-text 15.0.0", + "core-text", "cstr", "dwrote", "euclid", diff --git a/components/gfx/Cargo.toml b/components/gfx/Cargo.toml index d8ba44dc612..e79575d5d07 100644 --- a/components/gfx/Cargo.toml +++ b/components/gfx/Cargo.toml @@ -20,7 +20,7 @@ euclid = "0.20" fnv = "1.0" fontsan = { git = "https://github.com/servo/fontsan" } gfx_traits = { path = "../gfx_traits" } -harfbuzz-sys = "0.3" +harfbuzz-sys = "0.4" ipc-channel = "0.14" lazy_static = "1" libc = "0.2" @@ -37,7 +37,7 @@ style = { path = "../style", features = ["servo"] } time = "0.1.12" ucd = "0.1.1" unicode-bidi = { version = "0.3", features = ["with_serde"] } -unicode-script = { version = "0.3", features = ["harfbuzz"] } +unicode-script = "0.5" webrender_api = { git = "https://github.com/servo/webrender" } xi-unicode = "0.1.0" @@ -48,7 +48,7 @@ core-graphics = "0.19" core-text = "15.0" [target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] -freetype = "0.4" +freetype = "0.5" servo_allocator = { path = "../allocator" } [target.'cfg(target_os = "linux")'.dependencies] diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml index 90aaaa58011..a6bc544f9b3 100644 --- a/components/layout/Cargo.toml +++ b/components/layout/Cargo.toml @@ -48,7 +48,7 @@ smallvec = { version = "0.6", features = ["std", "union"] } style = { path = "../style", features = ["servo", "servo-layout-2013"] } style_traits = { path = "../style_traits" } unicode-bidi = { version = "0.3", features = ["with_serde"] } -unicode-script = { version = "0.3", features = ["harfbuzz"] } +unicode-script = "0.5" webrender_api = { git = "https://github.com/servo/webrender" } xi-unicode = "0.1.0" diff --git a/components/layout_2020/Cargo.toml b/components/layout_2020/Cargo.toml index 6ca3d709627..75a948fa56d 100644 --- a/components/layout_2020/Cargo.toml +++ b/components/layout_2020/Cargo.toml @@ -42,7 +42,7 @@ servo_arc = { path = "../servo_arc" } servo_url = { path = "../url" } style = { path = "../style", features = ["servo", "servo-layout-2020"] } style_traits = { path = "../style_traits" } -unicode-script = { version = "0.3", features = ["harfbuzz"] } +unicode-script = "0.5" webrender_api = { git = "https://github.com/servo/webrender" } [dev-dependencies] diff --git a/servo-tidy.toml b/servo-tidy.toml index e98cdbd5aa4..153f0e87847 100644 --- a/servo-tidy.toml +++ b/servo-tidy.toml @@ -64,7 +64,6 @@ packages = [ "core-foundation", "core-foundation-sys", "core-graphics", - "core-text", "lyon_geom", # Duplicated by webrender debugger via ws From 420e19f172845164fd46f56c502bb07eec8b88e4 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 10 Aug 2020 13:11:50 -0400 Subject: [PATCH 3/4] Revert "Revert "Update font-kit and freetype and unicode-script."" This reverts commit 10ae3bfbbb2383d349de6150434cc47c6ad1c8e9. --- Cargo.lock | 67 +++++++--- Cargo.toml | 3 + components/canvas/Cargo.toml | 2 +- components/gfx/Cargo.toml | 4 +- components/gfx/text/shaping/harfbuzz.rs | 167 +++++++++++++++++++++++- components/layout/text.rs | 4 +- 6 files changed, 220 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8b538a40dcd..2322ba7bd86 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -995,6 +995,19 @@ dependencies = [ "libc", ] +[[package]] +name = "core-graphics" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6082396a349fa49674ba1bda4077332a18bf150e8fa75745ece07085e29a113" +dependencies = [ + "bitflags", + "core-foundation 0.9.0", + "core-graphics-types", + "foreign-types", + "libc", +] + [[package]] name = "core-graphics-types" version = "0.1.0" @@ -1019,6 +1032,18 @@ dependencies = [ "libc", ] +[[package]] +name = "core-text" +version = "19.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04dfae50af11e72657fe7174cddb1ecddc5398037f7f6f39533ad69207c9a4e2" +dependencies = [ + "core-foundation 0.9.0", + "core-graphics 0.22.0", + "foreign-types", + "libc", +] + [[package]] name = "cpuid-bool" version = "0.1.2" @@ -1573,19 +1598,19 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "font-kit" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ed9b6d89600e22d9bfcfdd8c27e981540664a1a85a3f3971793c75502f49d9" +checksum = "1f9042cb45150fb2b2a012fc03d0f1d2071f18e90397b9d2a5ec8ade8464bf20" dependencies = [ "bitflags", "byteorder", - "core-foundation 0.7.0", - "core-graphics 0.19.0", - "core-text", + "core-foundation 0.9.0", + "core-graphics 0.22.0", + "core-text 19.0.0", "dirs", "dwrote", "float-ord", - "freetype 0.5.1", + "freetype 0.7.0", "lazy_static", "libc", "log", @@ -1633,9 +1658,9 @@ dependencies = [ [[package]] name = "freetype" -version = "0.5.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b73222ab32d9ad65fe0e1c3258da8d614fd47cf19fce92b09eb520060c5c5ad5" +checksum = "bee38378a9e3db1cc693b4f88d166ae375338a0ff75cb8263e1c601d51f35dc6" dependencies = [ "freetype-sys", "libc", @@ -1643,9 +1668,9 @@ dependencies = [ [[package]] name = "freetype-sys" -version = "0.11.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d48ac0ce366dd47a115ec8e598d7c51b4a974fc52ded5e53a56b31f55f34f3ea" +checksum = "a37d4011c0cc628dfa766fcc195454f4b068d7afdc2adfd28861191d866e731a" dependencies = [ "cmake", "libc", @@ -1872,12 +1897,12 @@ dependencies = [ "byteorder", "core-foundation 0.7.0", "core-graphics 0.19.0", - "core-text", + "core-text 15.0.0", "dwrote", "euclid", "fnv", "fontsan", - "freetype 0.5.1", + "freetype 0.7.0", "gfx_traits", "harfbuzz-sys", "ipc-channel", @@ -2492,15 +2517,15 @@ checksum = "63d68db75012a85555434ee079e7e6337931f87a087ab2988becbadf64673a7f" [[package]] name = "harfbuzz-sys" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c50680ef38c3c83947499b5df4f340db5b436807dfa2b21330d86254e2e4dd6" +checksum = "bf8c27ca13930dc4ffe474880040fe9e0f03c2121600dc9c95423624cab3e467" dependencies = [ "cc", - "core-graphics 0.19.0", - "core-text", + "core-graphics 0.22.0", + "core-text 19.0.0", "foreign-types", - "freetype 0.5.1", + "freetype 0.7.0", "pkg-config", ] @@ -4574,7 +4599,7 @@ checksum = "a871f1e45a3a3f0c73fb60343c811238bb5143a81642e27c2ac7aac27ff01a63" [[package]] name = "raqote" version = "0.8.1-alpha.0" -source = "git+https://github.com/jrmuizel/raqote#5444a1040bd4fd72e860ff75244fbe8fa7814470" +source = "git+https://github.com/jdm/raqote?branch=fkup#ff5d2d1aa7813dbcacb0d028cf7d17c82a35d9d4" dependencies = [ "euclid", "font-kit", @@ -5146,9 +5171,9 @@ dependencies = [ [[package]] name = "servo-fontconfig-sys" -version = "5.0.1" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c5e8d42c2957f6f433d90ab61277ed0226b3f49fffb19aa5493213c42e5d6df" +checksum = "e36b879db9892dfa40f95da1c38a835d41634b825fbd8c4c418093d53c24b388" dependencies = [ "expat-sys", "freetype-sys", @@ -6846,7 +6871,7 @@ dependencies = [ "cfg-if", "core-foundation 0.7.0", "core-graphics 0.19.0", - "core-text", + "core-text 15.0.0", "cstr", "dwrote", "euclid", diff --git a/Cargo.toml b/Cargo.toml index 4dbe63e439c..58346500b9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,6 +32,9 @@ mio = { git = "https://github.com/servo/mio.git", branch = "servo-mio-0.6.22" } # https://github.com/rust-lang/backtrace-rs/pull/363/ backtrace = { git = "https://github.com/servo/backtrace-rs", branch = "uwp-fix" } +[patch."https://github.com/jrmuizel/raqote"] +raqote = { git = "https://github.com/jdm/raqote", branch = "fkup" } + # https://github.com/servo/servo/issues/27039#issuecomment-654400150 [patch."https://github.com/servo/webrender"] webrender = { git = "https://github.com/jdm/webrender", branch = "crash-backtrace" } diff --git a/components/canvas/Cargo.toml b/components/canvas/Cargo.toml index 031de667648..83f75931ee0 100644 --- a/components/canvas/Cargo.toml +++ b/components/canvas/Cargo.toml @@ -22,7 +22,7 @@ canvas_traits = { path = "../canvas_traits" } crossbeam-channel = "0.4" cssparser = "0.27" euclid = "0.20" -font-kit = "0.9" +font-kit = "0.10" fnv = "1.0" gfx = { path = "../gfx" } gleam = "0.11" diff --git a/components/gfx/Cargo.toml b/components/gfx/Cargo.toml index e79575d5d07..947918e6da8 100644 --- a/components/gfx/Cargo.toml +++ b/components/gfx/Cargo.toml @@ -20,7 +20,7 @@ euclid = "0.20" fnv = "1.0" fontsan = { git = "https://github.com/servo/fontsan" } gfx_traits = { path = "../gfx_traits" } -harfbuzz-sys = "0.4" +harfbuzz-sys = "0.5" ipc-channel = "0.14" lazy_static = "1" libc = "0.2" @@ -48,7 +48,7 @@ core-graphics = "0.19" core-text = "15.0" [target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] -freetype = "0.5" +freetype = "0.7" servo_allocator = { path = "../allocator" } [target.'cfg(target_os = "linux")'.dependencies] diff --git a/components/gfx/text/shaping/harfbuzz.rs b/components/gfx/text/shaping/harfbuzz.rs index 47cf337011b..ef49bb32e68 100644 --- a/components/gfx/text/shaping/harfbuzz.rs +++ b/components/gfx/text/shaping/harfbuzz.rs @@ -191,6 +191,171 @@ impl Shaper { } } +pub fn unicode_to_hb_script(script: unicode_script::Script) -> harfbuzz_sys::hb_script_t { + use harfbuzz_sys::*; + use unicode_script::Script::*; + match script { + Adlam => HB_SCRIPT_ADLAM, + Ahom => HB_SCRIPT_AHOM, + Anatolian_Hieroglyphs => HB_SCRIPT_ANATOLIAN_HIEROGLYPHS, + Arabic => HB_SCRIPT_ARABIC, + Armenian => HB_SCRIPT_ARMENIAN, + Avestan => HB_SCRIPT_AVESTAN, + Balinese => HB_SCRIPT_BALINESE, + Bamum => HB_SCRIPT_BAMUM, + Bassa_Vah => HB_SCRIPT_BASSA_VAH, + Batak => HB_SCRIPT_BATAK, + Bengali => HB_SCRIPT_BENGALI, + Bhaiksuki => HB_SCRIPT_BHAIKSUKI, + Bopomofo => HB_SCRIPT_BOPOMOFO, + Brahmi => HB_SCRIPT_BRAHMI, + Braille => HB_SCRIPT_BRAILLE, + Buginese => HB_SCRIPT_BUGINESE, + Buhid => HB_SCRIPT_BUHID, + Canadian_Aboriginal => HB_SCRIPT_CANADIAN_SYLLABICS, + Carian => HB_SCRIPT_CARIAN, + Caucasian_Albanian => HB_SCRIPT_CAUCASIAN_ALBANIAN, + Chakma => HB_SCRIPT_CHAKMA, + Cham => HB_SCRIPT_CHAM, + Cherokee => HB_SCRIPT_CHEROKEE, + Chorasmian => HB_SCRIPT_CHORASMIAN, + Common => HB_SCRIPT_COMMON, + Coptic => HB_SCRIPT_COPTIC, + Cuneiform => HB_SCRIPT_CUNEIFORM, + Cypriot => HB_SCRIPT_CYPRIOT, + Cyrillic => HB_SCRIPT_CYRILLIC, + Deseret => HB_SCRIPT_DESERET, + Devanagari => HB_SCRIPT_DEVANAGARI, + Dives_Akuru => HB_SCRIPT_DIVES_AKURU, + Dogra => HB_SCRIPT_DOGRA, + Duployan => HB_SCRIPT_DUPLOYAN, + Egyptian_Hieroglyphs => HB_SCRIPT_EGYPTIAN_HIEROGLYPHS, + Elbasan => HB_SCRIPT_ELBASAN, + Elymaic => HB_SCRIPT_ELYMAIC, + Ethiopic => HB_SCRIPT_ETHIOPIC, + Georgian => HB_SCRIPT_GEORGIAN, + Glagolitic => HB_SCRIPT_GLAGOLITIC, + Gothic => HB_SCRIPT_GOTHIC, + Grantha => HB_SCRIPT_GRANTHA, + Greek => HB_SCRIPT_GREEK, + Gujarati => HB_SCRIPT_GUJARATI, + Gunjala_Gondi => HB_SCRIPT_GUNJALA_GONDI, + Gurmukhi => HB_SCRIPT_GURMUKHI, + Han => HB_SCRIPT_HAN, + Hangul => HB_SCRIPT_HANGUL, + Hanifi_Rohingya => HB_SCRIPT_HANIFI_ROHINGYA, + Hanunoo => HB_SCRIPT_HANUNOO, + Hatran => HB_SCRIPT_HATRAN, + Hebrew => HB_SCRIPT_HEBREW, + Hiragana => HB_SCRIPT_HIRAGANA, + Imperial_Aramaic => HB_SCRIPT_IMPERIAL_ARAMAIC, + Inherited => HB_SCRIPT_INHERITED, + Inscriptional_Pahlavi => HB_SCRIPT_INSCRIPTIONAL_PAHLAVI, + Inscriptional_Parthian => HB_SCRIPT_INSCRIPTIONAL_PARTHIAN, + Javanese => HB_SCRIPT_JAVANESE, + Kaithi => HB_SCRIPT_KAITHI, + Kannada => HB_SCRIPT_KANNADA, + Katakana => HB_SCRIPT_KATAKANA, + Kayah_Li => HB_SCRIPT_KAYAH_LI, + Kharoshthi => HB_SCRIPT_KHAROSHTHI, + Khitan_Small_Script => HB_SCRIPT_KHITAN_SMALL_SCRIPT, + Khmer => HB_SCRIPT_KHMER, + Khojki => HB_SCRIPT_KHOJKI, + Khudawadi => HB_SCRIPT_KHUDAWADI, + Lao => HB_SCRIPT_LAO, + Latin => HB_SCRIPT_LATIN, + Lepcha => HB_SCRIPT_LEPCHA, + Limbu => HB_SCRIPT_LIMBU, + Linear_A => HB_SCRIPT_LINEAR_A, + Linear_B => HB_SCRIPT_LINEAR_B, + Lisu => HB_SCRIPT_LISU, + Lycian => HB_SCRIPT_LYCIAN, + Lydian => HB_SCRIPT_LYDIAN, + Mahajani => HB_SCRIPT_MAHAJANI, + Makasar => HB_SCRIPT_MAKASAR, + Malayalam => HB_SCRIPT_MALAYALAM, + Mandaic => HB_SCRIPT_MANDAIC, + Manichaean => HB_SCRIPT_MANICHAEAN, + Marchen => HB_SCRIPT_MARCHEN, + Masaram_Gondi => HB_SCRIPT_MASARAM_GONDI, + Medefaidrin => HB_SCRIPT_MEDEFAIDRIN, + Meetei_Mayek => HB_SCRIPT_MEETEI_MAYEK, + Mende_Kikakui => HB_SCRIPT_MENDE_KIKAKUI, + Meroitic_Cursive => HB_SCRIPT_MEROITIC_CURSIVE, + Meroitic_Hieroglyphs => HB_SCRIPT_MEROITIC_HIEROGLYPHS, + Miao => HB_SCRIPT_MIAO, + Modi => HB_SCRIPT_MODI, + Mongolian => HB_SCRIPT_MONGOLIAN, + Mro => HB_SCRIPT_MRO, + Multani => HB_SCRIPT_MULTANI, + Myanmar => HB_SCRIPT_MYANMAR, + Nabataean => HB_SCRIPT_NABATAEAN, + Nandinagari => HB_SCRIPT_NANDINAGARI, + New_Tai_Lue => HB_SCRIPT_NEW_TAI_LUE, + Newa => HB_SCRIPT_NEWA, + Nko => HB_SCRIPT_NKO, + Nushu => HB_SCRIPT_NUSHU, + Nyiakeng_Puachue_Hmong => HB_SCRIPT_NYIAKENG_PUACHUE_HMONG, + Ogham => HB_SCRIPT_OGHAM, + Ol_Chiki => HB_SCRIPT_OL_CHIKI, + Old_Hungarian => HB_SCRIPT_OLD_HUNGARIAN, + Old_Italic => HB_SCRIPT_OLD_ITALIC, + Old_North_Arabian => HB_SCRIPT_OLD_NORTH_ARABIAN, + Old_Permic => HB_SCRIPT_OLD_PERMIC, + Old_Persian => HB_SCRIPT_OLD_PERSIAN, + Old_Sogdian => HB_SCRIPT_OLD_SOGDIAN, + Old_South_Arabian => HB_SCRIPT_OLD_SOUTH_ARABIAN, + Old_Turkic => HB_SCRIPT_OLD_TURKIC, + Oriya => HB_SCRIPT_ORIYA, + Osage => HB_SCRIPT_OSAGE, + Osmanya => HB_SCRIPT_OSMANYA, + Pahawh_Hmong => HB_SCRIPT_PAHAWH_HMONG, + Palmyrene => HB_SCRIPT_PALMYRENE, + Pau_Cin_Hau => HB_SCRIPT_PAU_CIN_HAU, + Phags_Pa => HB_SCRIPT_PHAGS_PA, + Phoenician => HB_SCRIPT_PHOENICIAN, + Psalter_Pahlavi => HB_SCRIPT_PSALTER_PAHLAVI, + Rejang => HB_SCRIPT_REJANG, + Runic => HB_SCRIPT_RUNIC, + Samaritan => HB_SCRIPT_SAMARITAN, + Saurashtra => HB_SCRIPT_SAURASHTRA, + Sharada => HB_SCRIPT_SHARADA, + Shavian => HB_SCRIPT_SHAVIAN, + Siddham => HB_SCRIPT_SIDDHAM, + SignWriting => HB_SCRIPT_SIGNWRITING, + Sinhala => HB_SCRIPT_SINHALA, + Sogdian => HB_SCRIPT_SOGDIAN, + Sora_Sompeng => HB_SCRIPT_SORA_SOMPENG, + Soyombo => HB_SCRIPT_SOYOMBO, + Sundanese => HB_SCRIPT_SUNDANESE, + Syloti_Nagri => HB_SCRIPT_SYLOTI_NAGRI, + Syriac => HB_SCRIPT_SYRIAC, + Tagalog => HB_SCRIPT_TAGALOG, + Tagbanwa => HB_SCRIPT_TAGBANWA, + Tai_Le => HB_SCRIPT_TAI_LE, + Tai_Tham => HB_SCRIPT_TAI_THAM, + Tai_Viet => HB_SCRIPT_TAI_VIET, + Takri => HB_SCRIPT_TAKRI, + Tamil => HB_SCRIPT_TAMIL, + Tangut => HB_SCRIPT_TANGUT, + Telugu => HB_SCRIPT_TELUGU, + Thaana => HB_SCRIPT_THAANA, + Thai => HB_SCRIPT_THAI, + Tibetan => HB_SCRIPT_TIBETAN, + Tifinagh => HB_SCRIPT_TIFINAGH, + Tirhuta => HB_SCRIPT_TIRHUTA, + Ugaritic => HB_SCRIPT_UGARITIC, + Unknown => HB_SCRIPT_UNKNOWN, + Vai => HB_SCRIPT_VAI, + Warang_Citi => HB_SCRIPT_WARANG_CITI, + Wancho => HB_SCRIPT_WANCHO, + Yezidi => HB_SCRIPT_YEZIDI, + Yi => HB_SCRIPT_YI, + Zanabazar_Square => HB_SCRIPT_ZANABAZAR_SQUARE, + _ => HB_SCRIPT_UNKNOWN, + } +} + impl ShaperMethods for Shaper { /// Calculate the layout metrics associated with the given text when painted in a specific /// font. @@ -206,7 +371,7 @@ impl ShaperMethods for Shaper { }, ); - hb_buffer_set_script(hb_buffer, options.script.to_hb_script()); + hb_buffer_set_script(hb_buffer, unicode_to_hb_script(options.script)); hb_buffer_add_utf8( hb_buffer, diff --git a/components/layout/text.rs b/components/layout/text.rs index 1d9fae80297..979443feae4 100644 --- a/components/layout/text.rs +++ b/components/layout/text.rs @@ -29,7 +29,7 @@ use style::properties::ComputedValues; use style::values::generics::text::LineHeight; use style::values::specified::text::{TextTransform, TextTransformCase}; use unicode_bidi as bidi; -use unicode_script::{get_script, Script}; +use unicode_script::Script; use xi_unicode::LineBreakLeafIter; /// Returns the concatenated text of a list of unscanned text fragments. @@ -259,7 +259,7 @@ impl TextRunScanner { // // TODO: Special handling of paired punctuation characters. // http://www.unicode.org/reports/tr24/#Common - let script = get_script(character); + let script = Script::from(character); let compatible_script = is_compatible(script, run_info.script); if compatible_script && !is_specific(run_info.script) && is_specific(script) { From 91ca74c9bea878ba3c3663c6611ace24545f1624 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 10 Aug 2020 13:17:40 -0400 Subject: [PATCH 4/4] Update webrender. --- Cargo.lock | 84 ++++++++++--------------------- Cargo.toml | 2 +- components/canvas/Cargo.toml | 2 +- components/compositing/Cargo.toml | 2 +- components/gfx/Cargo.toml | 6 +-- components/servo/Cargo.toml | 2 +- servo-tidy.toml | 1 - 7 files changed, 33 insertions(+), 66 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2322ba7bd86..5c776e12d3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -547,7 +547,7 @@ dependencies = [ "fnv", "font-kit", "gfx", - "gleam 0.11.0", + "gleam 0.12.1", "half", "ipc-channel", "log", @@ -822,7 +822,7 @@ dependencies = [ "embedder_traits", "euclid", "gfx_traits", - "gleam 0.11.0", + "gleam 0.12.1", "image", "ipc-channel", "keyboard-types", @@ -1020,18 +1020,6 @@ dependencies = [ "libc", ] -[[package]] -name = "core-text" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "131b3fd1f8bd5db9f2b398fa4fdb6008c64afc04d447c306ac2c7e98fba2a61d" -dependencies = [ - "core-foundation 0.7.0", - "core-graphics 0.19.0", - "foreign-types", - "libc", -] - [[package]] name = "core-text" version = "19.0.0" @@ -1606,11 +1594,11 @@ dependencies = [ "byteorder", "core-foundation 0.9.0", "core-graphics 0.22.0", - "core-text 19.0.0", + "core-text", "dirs", "dwrote", "float-ord", - "freetype 0.7.0", + "freetype", "lazy_static", "libc", "log", @@ -1646,16 +1634,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" -[[package]] -name = "freetype" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11926b2b410b469d0e9399eca4cbbe237a9ef02176c485803b29216307e8e028" -dependencies = [ - "libc", - "servo-freetype-sys", -] - [[package]] name = "freetype" version = "0.7.0" @@ -1895,14 +1873,14 @@ dependencies = [ "app_units", "bitflags", "byteorder", - "core-foundation 0.7.0", - "core-graphics 0.19.0", - "core-text 15.0.0", + "core-foundation 0.9.0", + "core-graphics 0.22.0", + "core-text", "dwrote", "euclid", "fnv", "fontsan", - "freetype 0.7.0", + "freetype", "gfx_traits", "harfbuzz-sys", "ipc-channel", @@ -2126,9 +2104,9 @@ dependencies = [ [[package]] name = "gleam" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9a13b5bb12ab457c15400b43cbba5971df5c1898b6a9c30cc8c52cb01baa112" +checksum = "3fdef5b9df6d3a261b80a5ac55e13bf93945725df2463c1b0a2e5a527dce0d37" dependencies = [ "gl_generator 0.14.0", ] @@ -2523,9 +2501,9 @@ checksum = "bf8c27ca13930dc4ffe474880040fe9e0f03c2121600dc9c95423624cab3e467" dependencies = [ "cc", "core-graphics 0.22.0", - "core-text 19.0.0", + "core-text", "foreign-types", - "freetype 0.7.0", + "freetype", "pkg-config", ] @@ -3236,7 +3214,7 @@ dependencies = [ "gaol", "gfx", "gfx_traits", - "gleam 0.11.0", + "gleam 0.12.1", "gstreamer", "ipc-channel", "keyboard-types", @@ -4226,7 +4204,7 @@ dependencies = [ [[package]] name = "peek-poke" version = "0.2.0" -source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#34d968adeda2e06b057a13d14a88df5766b38eda" +source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#920168aff79a7cf52980b0c90965a591f2f4204a" dependencies = [ "euclid", "peek-poke-derive", @@ -4235,7 +4213,7 @@ dependencies = [ [[package]] name = "peek-poke-derive" version = "0.2.1" -source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#34d968adeda2e06b057a13d14a88df5766b38eda" +source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#920168aff79a7cf52980b0c90965a591f2f4204a" dependencies = [ "proc-macro2 1.0.17", "quote 1.0.2", @@ -5180,16 +5158,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "servo-freetype-sys" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9232032c2e85118c0282c6562c84cab12316e655491ba0a5d1905b2320060d1b" -dependencies = [ - "cmake", - "pkg-config", -] - [[package]] name = "servo-gst-plugin" version = "0.0.1" @@ -6860,7 +6828,7 @@ dependencies = [ [[package]] name = "webrender" version = "0.61.0" -source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#34d968adeda2e06b057a13d14a88df5766b38eda" +source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#920168aff79a7cf52980b0c90965a591f2f4204a" dependencies = [ "backtrace", "base64 0.10.1", @@ -6869,15 +6837,15 @@ dependencies = [ "build-parallel", "byteorder", "cfg-if", - "core-foundation 0.7.0", - "core-graphics 0.19.0", - "core-text 15.0.0", + "core-foundation 0.9.0", + "core-graphics 0.22.0", + "core-text", "cstr", "dwrote", "euclid", - "freetype 0.4.1", + "freetype", "fxhash", - "gleam 0.11.0", + "gleam 0.12.1", "glslopt", "image", "lazy_static", @@ -6904,13 +6872,13 @@ dependencies = [ [[package]] name = "webrender_api" version = "0.61.0" -source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#34d968adeda2e06b057a13d14a88df5766b38eda" +source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#920168aff79a7cf52980b0c90965a591f2f4204a" dependencies = [ "app_units", "bitflags", "byteorder", - "core-foundation 0.7.0", - "core-graphics 0.19.0", + "core-foundation 0.9.0", + "core-graphics 0.22.0", "derive_more", "euclid", "malloc_size_of_derive", @@ -6925,7 +6893,7 @@ dependencies = [ [[package]] name = "webrender_build" version = "0.0.1" -source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#34d968adeda2e06b057a13d14a88df5766b38eda" +source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#920168aff79a7cf52980b0c90965a591f2f4204a" dependencies = [ "bitflags", "lazy_static", @@ -7104,7 +7072,7 @@ dependencies = [ [[package]] name = "wr_malloc_size_of" version = "0.0.1" -source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#34d968adeda2e06b057a13d14a88df5766b38eda" +source = "git+https://github.com/jdm/webrender?branch=crash-backtrace#920168aff79a7cf52980b0c90965a591f2f4204a" dependencies = [ "app_units", "euclid", diff --git a/Cargo.toml b/Cargo.toml index 58346500b9a..0ca9b967cc9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,7 @@ backtrace = { git = "https://github.com/servo/backtrace-rs", branch = "uwp-fix" [patch."https://github.com/jrmuizel/raqote"] raqote = { git = "https://github.com/jdm/raqote", branch = "fkup" } -# https://github.com/servo/servo/issues/27039#issuecomment-654400150 +# https://github.com/servo/servo/issues/27515#issuecomment-671474054 [patch."https://github.com/servo/webrender"] webrender = { git = "https://github.com/jdm/webrender", branch = "crash-backtrace" } webrender_api = { git = "https://github.com/jdm/webrender", branch = "crash-backtrace" } diff --git a/components/canvas/Cargo.toml b/components/canvas/Cargo.toml index 83f75931ee0..40605dbb9a1 100644 --- a/components/canvas/Cargo.toml +++ b/components/canvas/Cargo.toml @@ -25,7 +25,7 @@ euclid = "0.20" font-kit = "0.10" fnv = "1.0" gfx = { path = "../gfx" } -gleam = "0.11" +gleam = "0.12" half = "1" ipc-channel = "0.14" log = "0.4" diff --git a/components/compositing/Cargo.toml b/components/compositing/Cargo.toml index 0d4fc881921..048344af294 100644 --- a/components/compositing/Cargo.toml +++ b/components/compositing/Cargo.toml @@ -21,7 +21,7 @@ crossbeam-channel = "0.4" embedder_traits = { path = "../embedder_traits" } euclid = "0.20" gfx_traits = { path = "../gfx_traits" } -gleam = { version = "0.11", optional = true } +gleam = { version = "0.12", optional = true } image = "0.23" ipc-channel = "0.14" keyboard-types = "0.5" diff --git a/components/gfx/Cargo.toml b/components/gfx/Cargo.toml index 947918e6da8..0d96a7ed783 100644 --- a/components/gfx/Cargo.toml +++ b/components/gfx/Cargo.toml @@ -43,9 +43,9 @@ xi-unicode = "0.1.0" [target.'cfg(target_os = "macos")'.dependencies] byteorder = "1.0" -core-foundation = "0.7" -core-graphics = "0.19" -core-text = "15.0" +core-foundation = "0.9" +core-graphics = "0.22" +core-text = "19.0" [target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] freetype = "0.7" diff --git a/components/servo/Cargo.toml b/components/servo/Cargo.toml index 15aff372673..7c431f1c6b3 100644 --- a/components/servo/Cargo.toml +++ b/components/servo/Cargo.toml @@ -53,7 +53,7 @@ env_logger = "0.7" euclid = "0.20" gfx = { path = "../gfx" } gfx_traits = { path = "../gfx_traits" } -gleam = "0.11" +gleam = "0.12" gstreamer = { version = "0.15", features = ["v1_16"], optional = true } ipc-channel = "0.14" keyboard-types = "0.5" diff --git a/servo-tidy.toml b/servo-tidy.toml index 153f0e87847..0bb3eae35cb 100644 --- a/servo-tidy.toml +++ b/servo-tidy.toml @@ -39,7 +39,6 @@ packages = [ "num-rational", "parking_lot", "parking_lot_core", - "png", "wayland-sys", # https://github.com/servo/servo/issues/26933