blob: ebfd3e1481b7af115fdaaa9b1fa2e9e07ff6db93 [file] [log] [blame]
# Copyright 2019 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("//src/fonts/build/fonts.gni")
# Generate all the Fuchsia font `package`s from the values in the files listed
# in `font_pkgs_paths`.
all_packages = []
################################################################################
# Generate a `package` for every font
################################################################################
assert(font_pkg_entries != [])
foreach(entry, font_pkg_entries) {
assert(font_pkg_entries != [])
path_prefix = entry.path_prefix
if (path_prefix != "") {
path_prefix = "${path_prefix}/"
}
path_to_asset = "${fonts_dir}/${path_prefix}${entry.file_name}"
package_name = "font-package-${entry.safe_name}"
all_packages += [ ":${package_name}" ]
package(package_name) {
metadata = {
font_barrier = []
font_paths = [ path_to_asset ]
font_file_names = [ entry.file_name ]
fuchsia_package_urls = [ "fuchsia-pkg://fuchsia.com/${package_name}" ]
}
resources = [
{
path = rebase_path(path_to_asset)
dest = entry.file_name
},
]
}
}
# Group of all the single-font packages.
group("all") {
deps = all_packages
}