Skip to content

Commit

Permalink
icons: Add a custom icon font
Browse files Browse the repository at this point in the history
Fixes: #200
  • Loading branch information
gnprice committed Aug 1, 2023
1 parent f29f3cc commit 4070cea
Show file tree
Hide file tree
Showing 19 changed files with 1,938 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ test/model/schemas/*.json -diff
# information independent of any non-generated file in the tree.
# And thankfully it's much less verbose than, say, a yarn.lock.
#pubspec.lock -diff


# Treat SVG files as binary. They're XML, but typically
# generated from a GUI editor and unenlightening to read.
*.svg binary
Binary file added assets/icons/ZulipIcons.ttf
Binary file not shown.
1 change: 1 addition & 0 deletions assets/icons/bot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/globe.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/icons/hash_sign.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/language.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/icons/lock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/icons/mute.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 73 additions & 0 deletions assets/icons/read_receipts.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/topic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/icons/unmute.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions assets/icons/user.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions lib/widgets/icons.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

import 'package:flutter/widgets.dart';

// ignore_for_file: constant_identifier_names

/// Identifiers for Zulip's custom icons.
///
/// Use these with the [Icon] widget, in the same way as one uses
/// the members of the [Icons] class from Flutter's Material library.
abstract final class ZulipIcons {
// Generated code; do not edit.
//
// To add a new icon, or otherwise edit the set of icons:
//
// * Add an SVG file in `assets/icons/`,
// or otherwise edit the SVG files there.
//
// * Then run the command `scripts/icons/build-icon-font`.
// That will update this file and the generated icon font,
// `assets/icons/ZulipIcons.ttf`.
//
// BEGIN GENERATED ICON DATA

/// The Zulip custom icon "bot".
static const IconData bot = IconData(0xf101, fontFamily: "Zulip Icons");

/// The Zulip custom icon "globe".
static const IconData globe = IconData(0xf102, fontFamily: "Zulip Icons");

/// The Zulip custom icon "hash_sign".
static const IconData hash_sign = IconData(0xf103, fontFamily: "Zulip Icons");

/// The Zulip custom icon "language".
static const IconData language = IconData(0xf104, fontFamily: "Zulip Icons");

/// The Zulip custom icon "lock".
static const IconData lock = IconData(0xf105, fontFamily: "Zulip Icons");

/// The Zulip custom icon "mute".
static const IconData mute = IconData(0xf106, fontFamily: "Zulip Icons");

/// The Zulip custom icon "read_receipts".
static const IconData read_receipts = IconData(0xf107, fontFamily: "Zulip Icons");

/// The Zulip custom icon "topic".
static const IconData topic = IconData(0xf108, fontFamily: "Zulip Icons");

/// The Zulip custom icon "unmute".
static const IconData unmute = IconData(0xf109, fontFamily: "Zulip Icons");

/// The Zulip custom icon "user".
static const IconData user = IconData(0xf10a, fontFamily: "Zulip Icons");

// END GENERATED ICON DATA
}
8 changes: 7 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,16 @@ flutter:
assets:
- assets/Source_Code_Pro/LICENSE.md

# If adding a font, remember to account for its license in lib/licenses.dart.
fonts:
# Zulip's custom icons. To use or edit, see class ZulipIcons.
- family: Zulip Icons
fonts:
- asset: assets/icons/ZulipIcons.ttf

- family: Source Code Pro
fonts:
- asset: assets/Source_Code_Pro/SourceCodeVF-Upright.otf
- asset: assets/Source_Code_Pro/SourceCodeVF-Italic.otf
style: italic

# If adding a font, remember to account for its license in lib/licenses.dart.
1 change: 1 addition & 0 deletions scripts/icons/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
Loading

0 comments on commit 4070cea

Please sign in to comment.