[fonts] Remove most default fonts.
TEST: built and ran.
Change-Id: I383179c1e469e931319616dfb7840fff60d6abf0
diff --git a/garnet/bin/fonts/BUILD.gn b/garnet/bin/fonts/BUILD.gn
index ace94fed..6dbdf37 100644
--- a/garnet/bin/fonts/BUILD.gn
+++ b/garnet/bin/fonts/BUILD.gn
@@ -55,75 +55,6 @@
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") {
- 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/garnet/bin/fonts/manifest.json b/garnet/bin/fonts/manifest.json
index a820c02d..219f8c7 100644
--- a/garnet/bin/fonts/manifest.json
+++ b/garnet/bin/fonts/manifest.json
@@ -1,184 +1,32 @@
{
"families": [
{
+ "family": "Material Icons",
+ "aliases": [
+ "MaterialIcons"
+ ],
+ "fallback": false,
+ "fonts": [
+ {
+ "asset": "fonts/MaterialIcons-Regular.ttf"
+ }
+ ]
+ },
+ {
"family": "Roboto",
- "fallback_group": "sans-serif",
"fallback": true,
+ "fallback_group": "sans-serif",
"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/garnet/bin/fonts/manifest_minimal.json b/garnet/bin/fonts/manifest_minimal.json
deleted file mode 100644
index c933aaa..0000000
--- a/garnet/bin/fonts/manifest_minimal.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "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/garnet/bin/fonts/tests/font_provider_test.rs b/garnet/bin/fonts/tests/font_provider_test.rs
index 15ac87d..87772f9 100644
--- a/garnet/bin/fonts/tests/font_provider_test.rs
+++ b/garnet/bin/fonts/tests/font_provider_test.rs
@@ -76,18 +76,18 @@
Some("Roboto".to_string())
))
.context("Failed to load Roboto")?;
- let roboto_slab = await!(get_font_info_basic(
+ let material_icons = await!(get_font_info_basic(
&font_provider,
- Some("Roboto Slab".to_string())
+ Some("Material Icons".to_string())
))
- .context("Failed to load Roboto Slab")?;
+ .context("Failed to load Material Icons")?;
// Roboto should be returned by default.
assert!(default == roboto);
- // Roboto Slab request should return a different font.
- assert!(default.vmo_koid != roboto_slab.vmo_koid);
- assert!(default.buffer_id != roboto_slab.buffer_id);
+ // Material Icons request should return a different font.
+ assert!(default.vmo_koid != material_icons.vmo_koid);
+ assert!(default.buffer_id != material_icons.buffer_id);
Ok(())
}
@@ -96,17 +96,17 @@
let (_app, font_provider) = start_provider_with_default_fonts()?;
// Both requests should return the same font.
- let robotoslab = await!(get_font_info_basic(
+ let materialicons = await!(get_font_info_basic(
&font_provider,
- Some("RobotoSlab".to_string())
+ Some("MaterialIcons".to_string())
))
- .context("Failed to load RobotoSlab")?;
- let roboto_slab = await!(get_font_info_basic(
+ .context("Failed to load MaterialIcons")?;
+ let material_icons = await!(get_font_info_basic(
&font_provider,
- Some("Roboto Slab".to_string())
+ Some("Material Icons".to_string())
))
- .context("Failed to load Roboto Slab")?;
- assert!(robotoslab == roboto_slab);
+ .context("Failed to load Material Icons")?;
+ assert!(materialicons == material_icons);
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("robotoslab"))?;
+ let family_info = await!(font_provider.get_family_info("materialicons"))?;
assert!(family_info.is_some());
let family_info = family_info.unwrap();
- assert!(family_info.name == "Roboto Slab");
+ assert!(family_info.name == "Material Icons");
assert!(family_info.styles.len() > 0);
Ok(())
diff --git a/garnet/packages/prod/all b/garnet/packages/prod/all
index 9ac0ebc..876b43bd 100644
--- a/garnet/packages/prod/all
+++ b/garnet/packages/prod/all
@@ -35,7 +35,6 @@
"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/garnet/packages/prod/fonts_minimal b/garnet/packages/prod/fonts_minimal
deleted file mode 100644
index 6acc388..0000000
--- a/garnet/packages/prod/fonts_minimal
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "packages": [
- "//garnet/bin/fonts:fonts_minimal"
- ]
-}
diff --git a/garnet/packages/products/interactive_minimal b/garnet/packages/products/interactive_minimal
index 42c7602..c93ca41 100644
--- a/garnet/packages/products/interactive_minimal
+++ b/garnet/packages/products/interactive_minimal
@@ -1,6 +1,6 @@
{
"imports": [
"garnet/packages/products/interactive_base",
- "garnet/packages/prod/fonts_minimal"
+ "garnet/packages/prod/fonts"
]
}