Switch Material Design icons to using the iconfont

Rather than managing all the Material Design icons manually, we now
manage them using an icon font. The icon font contains glyphs for each
icon in an efficient vector format.

This patch updates the FLX tooling to include the MaterialIcons font and
updates the Icon widget to use the font instead of asset images.

Fixes #2313
Fixes #2218
Fixes #2009
Fixes #994
This commit is contained in:
Adam Barth
2016-03-01 20:27:35 -08:00
parent 6e2d654962
commit 870894fc68
46 changed files with 1234 additions and 382 deletions

1
bin/cache/material_fonts.version vendored Normal file
View File

@@ -0,0 +1 @@
https://storage.googleapis.com/flutter_infra/flutter/fonts/b1e27075635f686ce12784a90125de693b4c360c/fonts.zip

28
bin/cache/update_material_fonts.sh vendored Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e
FLUTTER_ROOT=$(dirname $(dirname $(dirname "${BASH_SOURCE[0]}")))
MATERIAL_FONTS_STAMP_PATH="$FLUTTER_ROOT/bin/cache/material_fonts.stamp"
MATERIAL_FONTS_VERSION=`cat "$FLUTTER_ROOT/bin/cache/material_fonts.version"`
if [ ! -f "$MATERIAL_FONTS_STAMP_PATH" ] || [ "$MATERIAL_FONTS_VERSION" != `cat "$MATERIAL_FONTS_STAMP_PATH"` ]; then
echo "Downloading Material Design fonts..."
MATERIAL_FONTS_URL="$MATERIAL_FONTS_VERSION"
MATERIAL_FONTS_PATH="$FLUTTER_ROOT/bin/cache/artifacts/material_fonts"
MATERIAL_FONTS_ZIP="$FLUTTER_ROOT/bin/cache/material_fonts.zip"
mkdir -p -- "$MATERIAL_FONTS_PATH"
curl --progress-bar -continue-at=- --location --output "$MATERIAL_FONTS_ZIP" "$MATERIAL_FONTS_URL"
rm -rf -- "$MATERIAL_FONTS_PATH"
unzip -o -q "$MATERIAL_FONTS_ZIP" -d "$MATERIAL_FONTS_PATH"
rm -f -- "$MATERIAL_FONTS_ZIP"
echo "$MATERIAL_FONTS_VERSION" > "$MATERIAL_FONTS_STAMP_PATH"
fi