Commit 9b7764d4 authored by P.Y. Laligand's avatar P.Y. Laligand Committed by GitHub

Added an option to allow default fonts to not be packed in an flx file. (#6710)

Fonts should never be bundled on Fuchsia.
parent 46b60773
......@@ -48,7 +48,7 @@ Future<Null> main(List<String> args) async {
workingDirPath: argResults[_kOptionWorking],
packagesPath: argResults[_kOptionPackages],
manifestPath: defaultManifestPath,
includeRobotoFonts: true,
includeDefaultFonts: false,
);
if (buildResult != 0) {
printError('Error building $outputPath: $buildResult.');
......
......@@ -69,6 +69,7 @@ class AssetBundle {
String manifestPath: defaultManifestPath,
String workingDirPath,
String packagesPath,
bool includeDefaultFonts: true,
bool includeRobotoFonts: true,
bool reportLicensedPackages: false
}) async {
......@@ -120,7 +121,7 @@ class AssetBundle {
}
List<_Asset> materialAssets = <_Asset>[];
if (usesMaterialDesign) {
if (usesMaterialDesign && includeDefaultFonts) {
materialAssets.addAll(_getMaterialAssets(_kFontSetMaterial));
if (includeRobotoFonts)
materialAssets.addAll(_getMaterialAssets(_kFontSetRoboto));
......@@ -135,7 +136,7 @@ class AssetBundle {
entries.add(_createAssetManifest(assetVariants));
AssetBundleEntry fontManifest =
_createFontManifest(manifestDescriptor, usesMaterialDesign, includeRobotoFonts);
_createFontManifest(manifestDescriptor, usesMaterialDesign, includeDefaultFonts, includeRobotoFonts);
if (fontManifest != null)
entries.add(fontManifest);
......@@ -311,9 +312,10 @@ AssetBundleEntry _createAssetManifest(Map<_Asset, List<_Asset>> assetVariants) {
AssetBundleEntry _createFontManifest(Map<String, dynamic> manifestDescriptor,
bool usesMaterialDesign,
bool includeDefaultFonts,
bool includeRobotoFonts) {
List<Map<String, dynamic>> fonts = <Map<String, dynamic>>[];
if (usesMaterialDesign) {
if (usesMaterialDesign && includeDefaultFonts) {
fonts.addAll(_getMaterialFonts(AssetBundle._kFontSetMaterial));
if (includeRobotoFonts)
fonts.addAll(_getMaterialFonts(AssetBundle._kFontSetRoboto));
......
......@@ -131,6 +131,7 @@ Future<int> assemble({
String privateKeyPath: defaultPrivateKeyPath,
String workingDirPath,
String packagesPath,
bool includeDefaultFonts: true,
bool includeRobotoFonts: true,
bool reportLicensedPackages: false
}) async {
......@@ -145,6 +146,7 @@ Future<int> assemble({
manifestPath: manifestPath,
workingDirPath: workingDirPath,
packagesPath: packagesPath,
includeDefaultFonts: includeDefaultFonts,
includeRobotoFonts: includeRobotoFonts,
reportLicensedPackages: reportLicensedPackages
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment