Revert "[fonts] Remove most default fonts."
This reverts commit 1844771c4a8588a1550f09d259c21eb21592ebc6.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> [fonts] Remove most default fonts.
>
> Test: built and ran.
>
> Change-Id: I4b322c5d799ddc72efce42e6a53ff12ebfa785c3
TBR=jamesr@google.com,anwilson@google.com,sanjayc@google.com
Change-Id: I35044ffd56a221a5178238461fe9c2f45fb595c2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
diff --git a/bin/fonts/BUILD.gn b/bin/fonts/BUILD.gn
index 7eb865d..8134ebd 100644
--- a/bin/fonts/BUILD.gn
+++ b/bin/fonts/BUILD.gn
@@ -56,6 +56,77 @@
fonts = [
"material/MaterialIcons-Regular.ttf",
+ "roboto/Roboto-BlackItalic.ttf",
+ "roboto/Roboto-Black.ttf",
+ "roboto/Roboto-BoldItalic.ttf",
+ "roboto/Roboto-Bold.ttf",
+ "roboto/Roboto-Italic.ttf",
+ "roboto/Roboto-LightItalic.ttf",
+ "roboto/Roboto-Light.ttf",
+ "roboto/Roboto-MediumItalic.ttf",
+ "roboto/Roboto-Medium.ttf",
+ "roboto/Roboto-Regular.ttf",
+ "roboto/Roboto-ThinItalic.ttf",
+ "roboto/Roboto-Thin.ttf",
+ "robotocondensed/RobotoCondensed-BoldItalic.ttf",
+ "robotocondensed/RobotoCondensed-Bold.ttf",
+ "robotocondensed/RobotoCondensed-Italic.ttf",
+ "robotocondensed/RobotoCondensed-LightItalic.ttf",
+ "robotocondensed/RobotoCondensed-Light.ttf",
+ "robotocondensed/RobotoCondensed-Regular.ttf",
+ "robotomono/RobotoMono-BoldItalic.ttf",
+ "robotomono/RobotoMono-Bold.ttf",
+ "robotomono/RobotoMono-Italic.ttf",
+ "robotomono/RobotoMono-LightItalic.ttf",
+ "robotomono/RobotoMono-Light.ttf",
+ "robotomono/RobotoMono-MediumItalic.ttf",
+ "robotomono/RobotoMono-Medium.ttf",
+ "robotomono/RobotoMono-Regular.ttf",
+ "robotomono/RobotoMono-ThinItalic.ttf",
+ "robotomono/RobotoMono-Thin.ttf",
+ "robotoslab/RobotoSlab-Bold.ttf",
+ "robotoslab/RobotoSlab-Light.ttf",
+ "robotoslab/RobotoSlab-Regular.ttf",
+ "robotoslab/RobotoSlab-Thin.ttf",
+ ]
+ foreach(font, fonts) {
+ resources += [
+ {
+ path = rebase_path("third_party/${font}")
+ file_name = get_path_info(font, "file")
+ dest = "fonts/${file_name}"
+ },
+ ]
+ }
+}
+
+# TODO(sergeyu): Once PKG-47 is fixed it will be possible to separate fonts
+# packages from font_server.
+package("fonts_minimal") {
+ deprecated_bare_package_url = "//build"
+
+ deps = [
+ ":font_server",
+ ]
+
+ binary = "font_server"
+
+ meta = [
+ {
+ path = rebase_path("meta/fonts.cmx")
+ dest = "fonts.cmx"
+ },
+ ]
+
+ resources = [
+ {
+ path = rebase_path("manifest_minimal.json")
+ dest = "manifest.json"
+ },
+ ]
+
+ fonts = [
+ "material/MaterialIcons-Regular.ttf",
"roboto/Roboto-Light.ttf",
"roboto/Roboto-Medium.ttf",
"roboto/Roboto-Regular.ttf",
diff --git a/bin/fonts/manifest.json b/bin/fonts/manifest.json
index 219f8c7..a820c02 100644
--- a/bin/fonts/manifest.json
+++ b/bin/fonts/manifest.json
@@ -1,32 +1,184 @@
{
"families": [
{
- "family": "Material Icons",
- "aliases": [
- "MaterialIcons"
- ],
- "fallback": false,
- "fonts": [
- {
- "asset": "fonts/MaterialIcons-Regular.ttf"
- }
- ]
- },
- {
"family": "Roboto",
- "fallback": true,
"fallback_group": "sans-serif",
+ "fallback": true,
"fonts": [
{
"asset": "fonts/Roboto-Regular.ttf"
},
{
+ "asset": "fonts/Roboto-Italic.ttf",
+ "slant": "italic"
+ },
+ {
+ "asset": "fonts/Roboto-Thin.ttf",
+ "weight": 100
+ },
+ {
+ "asset": "fonts/Roboto-ThinItalic.ttf",
+ "weight": 100,
+ "slant": "italic"
+ },
+ {
"asset": "fonts/Roboto-Light.ttf",
"weight": 300
},
{
+ "asset": "fonts/Roboto-LightItalic.ttf",
+ "weight": 300,
+ "slant": "italic"
+ },
+ {
"asset": "fonts/Roboto-Medium.ttf",
"weight": 500
+ },
+ {
+ "asset": "fonts/Roboto-MediumItalic.ttf",
+ "weight": 500,
+ "slant": "italic"
+ },
+ {
+ "asset": "fonts/Roboto-Bold.ttf",
+ "weight": 700
+ },
+ {
+ "asset": "fonts/Roboto-BoldItalic.ttf",
+ "weight": 700,
+ "slant": "italic"
+ },
+ {
+ "asset": "fonts/Roboto-Black.ttf",
+ "weight": 900
+ },
+ {
+ "asset": "fonts/Roboto-BlackItalic.ttf",
+ "weight": 900,
+ "slant": "italic"
+ }
+ ]
+ },
+ {
+ "family": "Roboto Condensed",
+ "aliases": ["RobotoCondensed"],
+ "fallback_group": "sans-serif",
+ "fallback": true,
+ "fonts": [
+ {
+ "asset": "fonts/RobotoCondensed-Regular.ttf",
+ "width": 3
+ },
+ {
+ "asset": "fonts/RobotoCondensed-Italic.ttf",
+ "width": 3,
+ "slant": "italic"
+ },
+ {
+ "asset": "fonts/RobotoCondensed-Light.ttf",
+ "width": 3,
+ "weight": 300
+ },
+ {
+ "asset": "fonts/RobotoCondensed-LightItalic.ttf",
+ "width": 3,
+ "weight": 300,
+ "slant": "italic"
+ },
+ {
+ "asset": "fonts/RobotoCondensed-Bold.ttf",
+ "width": 3,
+ "weight": 700
+ },
+ {
+ "asset": "fonts/RobotoCondensed-BoldItalic.ttf",
+ "width": 3,
+ "weight": 700,
+ "slant": "italic"
+ }
+ ]
+ },
+ {
+ "family": "Roboto Mono",
+ "aliases": ["RobotoMono"],
+ "fallback_group": "monospace",
+ "fallback": true,
+ "fonts": [
+ {
+ "asset": "fonts/RobotoMono-Regular.ttf"
+ },
+ {
+ "asset": "fonts/RobotoMono-Italic.ttf",
+ "slant": "italic"
+ },
+ {
+ "asset": "fonts/RobotoMono-Thin.ttf",
+ "weight": 100
+ },
+ {
+ "asset": "fonts/RobotoMono-ThinItalic.ttf",
+ "weight": 100,
+ "slant": "italic"
+ },
+ {
+ "asset": "fonts/RobotoMono-Light.ttf",
+ "weight": 300
+ },
+ {
+ "asset": "fonts/RobotoMono-LightItalic.ttf",
+ "weight": 300,
+ "slant": "italic"
+ },
+ {
+ "asset": "fonts/RobotoMono-Medium.ttf",
+ "weight": 500
+ },
+ {
+ "asset": "fonts/RobotoMono-MediumItalic.ttf",
+ "weight": 500,
+ "slant": "italic"
+ },
+ {
+ "asset": "fonts/RobotoMono-Bold.ttf",
+ "weight": 700
+ },
+ {
+ "asset": "fonts/RobotoMono-BoldItalic.ttf",
+ "weight": 700,
+ "slant": "italic"
+ }
+ ]
+ },
+ {
+ "family": "Roboto Slab",
+ "aliases": ["RobotoSlab"],
+ "fallback_group": "serif",
+ "fallback": true,
+ "fonts": [
+ {
+ "asset": "fonts/RobotoSlab-Regular.ttf"
+ },
+ {
+ "asset": "fonts/RobotoSlab-Thin.ttf",
+ "weight": 100
+ },
+ {
+ "asset": "fonts/RobotoSlab-Light.ttf",
+ "weight": 300
+ },
+ {
+ "asset": "fonts/RobotoSlab-Bold.ttf",
+ "weight": 700
+ }
+ ]
+ },
+ {
+ "family": "Material Icons",
+ "aliases": ["MaterialIcons"],
+ "fallback": true,
+ "fonts": [
+ {
+ "asset": "fonts/MaterialIcons-Regular.ttf"
}
]
}
diff --git a/bin/fonts/manifest_minimal.json b/bin/fonts/manifest_minimal.json
new file mode 100644
index 0000000..c933aaa
--- /dev/null
+++ b/bin/fonts/manifest_minimal.json
@@ -0,0 +1,31 @@
+{
+ "families": [
+ {
+ "family": "Material Icons",
+ "aliases": ["MaterialIcons"],
+ "fallback": true,
+ "fonts": [
+ {
+ "asset": "fonts/MaterialIcons-Regular.ttf",
+ }
+ ]
+ },
+ {
+ "family": "Roboto",
+ "fallback": true,
+ "fonts": [
+ {
+ "asset": "fonts/Roboto-Regular.ttf"
+ },
+ {
+ "asset": "fonts/Roboto-Light.ttf",
+ "weight": 300
+ },
+ {
+ "asset": "fonts/Roboto-Medium.ttf",
+ "weight": 500
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/bin/fonts/tests/font_provider_test.rs b/bin/fonts/tests/font_provider_test.rs
index a33c6b6..15ac87d 100644
--- a/bin/fonts/tests/font_provider_test.rs
+++ b/bin/fonts/tests/font_provider_test.rs
@@ -76,18 +76,18 @@
Some("Roboto".to_string())
))
.context("Failed to load Roboto")?;
- let material_icons = await!(get_font_info_basic(
+ let roboto_slab = await!(get_font_info_basic(
&font_provider,
- Some("Material Icons".to_string())
+ Some("Roboto Slab".to_string())
))
- .context("Failed to load Material Icons")?;
+ .context("Failed to load Roboto Slab")?;
// Roboto should be returned by default.
assert!(default == roboto);
- // Material Icons request should return a different font.
- assert!(default.vmo_koid != material_icons.vmo_koid);
- assert!(default.buffer_id != material_icons.buffer_id);
+ // Roboto Slab request should return a different font.
+ assert!(default.vmo_koid != roboto_slab.vmo_koid);
+ assert!(default.buffer_id != roboto_slab.buffer_id);
Ok(())
}
@@ -220,12 +220,12 @@
async fn test_get_family_info() -> Result<(), Error> {
let (_app, font_provider) = start_provider_with_default_fonts()?;
- let family_info = await!(font_provider.get_family_info("materialicons"))?;
+ let family_info = await!(font_provider.get_family_info("robotoslab"))?;
assert!(family_info.is_some());
let family_info = family_info.unwrap();
- assert!(family_info.name == "Material Icons");
+ assert!(family_info.name == "Roboto Slab");
assert!(family_info.styles.len() > 0);
Ok(())
diff --git a/packages/prod/all b/packages/prod/all
index 6b3c950..429b273 100644
--- a/packages/prod/all
+++ b/packages/prod/all
@@ -27,6 +27,7 @@
"garnet/packages/prod/drivers",
"garnet/packages/prod/far",
"garnet/packages/prod/fonts",
+ "garnet/packages/prod/fonts_minimal",
"garnet/packages/prod/fortune",
"garnet/packages/prod/guest_runner",
"garnet/packages/prod/insntrace",
diff --git a/packages/prod/fonts_minimal b/packages/prod/fonts_minimal
new file mode 100644
index 0000000..6acc388
--- /dev/null
+++ b/packages/prod/fonts_minimal
@@ -0,0 +1,5 @@
+{
+ "packages": [
+ "//garnet/bin/fonts:fonts_minimal"
+ ]
+}
diff --git a/packages/products/interactive_minimal b/packages/products/interactive_minimal
index c93ca41..42c7602b 100644
--- a/packages/products/interactive_minimal
+++ b/packages/products/interactive_minimal
@@ -1,6 +1,6 @@
{
"imports": [
"garnet/packages/products/interactive_base",
- "garnet/packages/prod/fonts"
+ "garnet/packages/prod/fonts_minimal"
]
}