blob: 7eb865d1b6c1ae2478351e9a52db619a8c8951d5 [file] [log] [blame]
# Copyright 2016 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/package.gni")
import("//build/rust/rustc_binary.gni")
rustc_binary("font_server") {
name = "font_server"
with_unit_tests = true
edition = "2018"
deps = [
"//garnet/public/fidl/fuchsia.fonts:fuchsia.fonts-rustc",
"//garnet/public/lib/fidl/rust/fidl",
"//garnet/public/rust/fdio",
"//garnet/public/rust/fuchsia-app",
"//garnet/public/rust/fuchsia-async",
"//garnet/public/rust/fuchsia-zircon",
"//third_party/rust-crates/rustc_deps:failure",
"//third_party/rust-crates/rustc_deps:futures-preview",
"//third_party/rust-crates/rustc_deps:getopts",
"//third_party/rust-crates/rustc_deps:libc",
"//third_party/rust-crates/rustc_deps:log",
"//third_party/rust-crates/rustc_deps:serde",
"//third_party/rust-crates/rustc_deps:serde_derive",
"//third_party/rust-crates/rustc_deps:serde_json",
"//third_party/rust-crates/rustc_deps:unicase",
"//zircon/public/fidl/fuchsia-mem:fuchsia-mem-rustc",
]
non_rust_deps = [ "//third_party/freetype2" ]
}
package("fonts") {
deps = [
":font_server",
]
binary = "font_server"
meta = [
{
path = rebase_path("meta/fonts.cmx")
dest = "fonts.cmx"
},
]
resources = [
{
path = rebase_path("manifest.json")
dest = "manifest.json"
},
]
fonts = [
"material/MaterialIcons-Regular.ttf",
"roboto/Roboto-Light.ttf",
"roboto/Roboto-Medium.ttf",
"roboto/Roboto-Regular.ttf",
]
foreach(font, fonts) {
resources += [
{
path = rebase_path("third_party/${font}")
file_name = get_path_info(font, "file")
dest = "fonts/${file_name}"
},
]
}
}
rustc_binary("font_provider_test") {
testonly = true
edition = "2018"
deps = [
"//garnet/public/fidl/fuchsia.fonts:fuchsia.fonts-rustc",
"//garnet/public/lib/fidl/rust/fidl",
"//garnet/public/rust/fdio",
"//garnet/public/rust/fuchsia-app",
"//garnet/public/rust/fuchsia-async",
"//garnet/public/rust/fuchsia-zircon",
"//third_party/rust-crates/rustc_deps:failure",
"//third_party/rust-crates/rustc_deps:futures-preview",
]
source_root = "tests/font_provider_test.rs"
}
package("font_provider_tests") {
testonly = true
# Necessary to work around ZX-2727.
deprecated_system_image = true
deps = [
":font_provider_test",
":font_server",
]
tests = [
{
name = "font_provider_test"
},
{
name = "font_server_bin_test"
},
]
resources = [
{
path = rebase_path("tests/test_manifest.json")
dest = "testdata/test_fonts/manifest.json"
},
]
# TODO(sergeyu): Noto CJK fonts are not included in the default fonts package
# due to their size. Currently they are used only for tests. Once PKG-47 is
# implemented it will be possible to customize set of fonts on higher levels,
# which will allow to include these fonts in the default font package.
fonts = [
"noto-cjk/NotoSansCJK-Regular.ttc",
"noto-cjk/NotoSerifCJK-Regular.ttc",
]
foreach(font, fonts) {
resources += [
{
path = rebase_path("third_party/${font}")
file_name = get_path_info(font, "file")
dest = "testdata/test_fonts/${file_name}"
},
]
}
}