Clone this repo:
  1. fd292b6 remove redundant experiment (#20) by Phil Quitslund · 3 weeks ago master
  2. b007f8f opt out the tool/generate.dart script (#19) by Jacob MacDonald · 3 weeks ago
  3. 3e5b984 Bump SDK constraints for pub (#18) by Nate Bosch · 4 weeks ago 1.2.0-nullsafety.3
  4. 000c24d allow the 2.12 prerelease sdks (#17) by Jacob MacDonald · 6 weeks ago 1.2.0-nullsafety.2
  5. cf45746 Prepare for the 2.11 dev SDKs (#16) by Nate Bosch · 10 weeks ago 1.2.0-nullsafety.1

This library contains getters for useful Unicode glyphs as well as plain ASCII alternatives. It‘s intended to be used in command-line applications that may run in places where Unicode isn’t well-supported and libraries that may be used by those applications.

We recommend that you import this library with the prefix “glyph”. For example:

import 'package:term_glyph/term_glyph.dart' as glyph;

/// Formats [items] into a bulleted list, with one item per line.
String bulletedList(List<String> items) => => "${glyph.bullet} $item").join("\n");


Some shells are unable to display Unicode characters, so this package is able to transparently switch its glyphs to ASCII alternatives by setting the ascii attribute. When this attribute is true, all glyphs use ASCII characters instead. It currently defaults to false, although in the future it may default to true for applications running on the Dart VM on Windows. For example:

import 'dart:io';

import 'package:term_glyph/term_glyph.dart' as glyph;

void main() {
  glyph.ascii = Platform.isWindows;

  // Prints "Unicode => ASCII" on Windows, "Unicode ━▶ ASCII" everywhere else.
  print("Unicode ${glyph.rightArrow} ASCII");

All ASCII glyphs are guaranteed to be the same number of characters as the corresponding Unicode glyphs, so that they line up properly when printed on a terminal. The specific ASCII text for a given Unicode glyph may change over time; this is not considered a breaking change.