servo / font-kit

A cross-platform font loading library written in Rust
Apache License 2.0
678 stars 100 forks source link

servo-fontconfig causes issues with fontconfig 2.23 in ubuntu 20.06(or others) #181

Open bruceloco opened 3 years ago

bruceloco commented 3 years ago

The dependency on servo-fontconfig causes issues because it was built with an earlier version of fontconfig this tends to mess up with most linux systems causing runtime errors of the following:

Fontconfig warning: "/etc/fonts/fonts.conf", line 5: unknown element "its:rules" Fontconfig warning: "/etc/fonts/fonts.conf", line 6: unknown element "its:translateRule" Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'translate' Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'selector' Fontconfig error: "/etc/fonts/fonts.conf", line 7: invalid attribute 'xmlns:its' Fontconfig error: "/etc/fonts/fonts.conf", line 7: invalid attribute 'version' ......

I changes the original toml file to the following replacing servo-fontconfig to fontconfig, now it runs properly.

THIS FILE IS AUTOMATICALLY GENERATED BY CARGO

#

When uploading crates to the registry Cargo will automatically

"normalize" Cargo.toml files for maximal compatibility

with all versions of Cargo and also rewrite path dependencies

to registry (e.g., crates.io) dependencies

#

If you believe there's an error in this file please file an

issue against the rust-lang/cargo repository. If you're

editing this file be aware that the upstream Cargo.toml

will likely look very different (and much more reasonable)

[package] edition = "2018" name = "font-kit" version = "0.7.1" authors = ["Patrick Walton pcwalton@mimiga.net"] exclude = ["resources/**"] description = "A cross-platform font loading library" homepage = "https://github.com/servo/font-kit" readme = "README.md" license = "MIT/Apache-2.0" repository = "https://github.com/servo/font-kit" [dependencies.bitflags] version = "1"

[dependencies.byteorder] version = "1.2"

[dependencies.float-ord] version = "0.2"

[dependencies.freetype] version = "^0.4.1" optional = true

[dependencies.lazy_static] version = "1.1"

[dependencies.libc] version = "0.2"

[dependencies.log] version = "0.4"

[dependencies.pathfinder_geometry] version = "0.5"

[dependencies.pathfinder_simd] version = "0.5"

[dependencies.fontconfig] version = "0.2.0"

[dev-dependencies.colored] version = "1.6"

[dev-dependencies.pbr] version = "1.0"

[dev-dependencies.prettytable-rs] version = "0.8"

[features] loader-freetype = ["freetype"] loader-freetype-default = ["loader-freetype"] [target."cfg(any(target_os = \"macos\", target_os = \"ios\"))".dependencies.core-foundation] version = "0.7"

[target."cfg(any(target_os = \"macos\", target_os = \"ios\"))".dependencies.core-graphics] version = "0.19"

[target."cfg(any(target_os = \"macos\", target_os = \"ios\"))".dependencies.core-text] version = "15" [target."cfg(not(any(target_arch = \"wasm32\", target_family = \"windows\", target_os = \"android\")))".dependencies.dirs] version = "2.0" [target."cfg(not(any(target_family = \"windows\", target_os = \"macos\", target_os = \"ios\")))".dependencies.freetype] version = "^0.4.1" [target."cfg(not(any(target_family = \"windows\", target_os = \"macos\", target_os = \"ios\", target_arch = \"wasm32\")))".dependencies.fontconfig] version = "0.2.0" [target."cfg(not(target_arch = \"wasm32\"))".dependencies.walkdir] version = "2.1" [target."cfg(target_family = \"windows\")".dependencies.dwrote] version = "0.11" default-features = false

[target."cfg(target_family = \"windows\")".dependencies.winapi] version = "0.3" features = ["dwrite", "minwindef", "sysinfoapi", "winbase", "winnt"]