p-hatan/ mirror

pub repository

mirror.p-hatan.com

term_glyph

1.2.2

Useful Unicode glyphs and ASCII substitutes.

Cached in Iran · Upstream SHA-256 matched

Download archive

Readme

Build Status pub package package publisher

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) =>
    items.map((item) => "${glyph.bullet} $item").join("\n");

ASCII Mode

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.

Changelog

1.2.2

  • Require Dart 3.1
  • Move to dart-lang/tools monorepo.

1.2.1

  • Migrate to package:lints.
  • Populate the pubspec repository field.

1.2.0

  • Stable release for null safety.
  • Update SDK constraints to >=2.12.0-0 <3.0.0 based on beta release guidelines.

1.1.0

  • Add a GlyphSet class that can be used to easily choose which set of glyphs to use for a particular chunk of code.

  • Add asciiGlyphs, unicodeGlyphs, and glyphs getters that provide access to GlyphSets.

1.0.1

  • Set max SDK version to <3.0.0.

1.0.0

  • Initial version.

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add term_glyph
pubspec.yaml
name: term_glyph
version: 1.2.2
description: Useful Unicode glyphs and ASCII substitutes.
repository: https://github.com/dart-lang/tools/tree/main/pkgs/term_glyph

environment:
  sdk: ^3.1.0

dev_dependencies:
  csv: ^6.0.0
  dart_flutter_team_lints: ^3.0.0
  dart_style: ^2.0.0
  test: ^1.16.6

Version history

VersionPublishedArchiveSHA-256
1.0.02017-01-06T01:48:24.071ZCached58d9dfe40ad80d419b7a69542b3eefc9eae64cd95fc7dccaa84beb06cd8a1f79
1.0.12018-07-17T17:18:51.851569ZCached4526f8a4ced91369c4aa1b166532b285ad0d41376c07a665754193a0b6a05bde
1.1.02019-01-10T01:28:02.303526ZCached20bd11d476c7267071bf13c3a6aff1627f7bb9149985122637e284864cc9d155
1.2.0-nullsafety2020-07-29T16:23:51.220281ZCached7086f21e1ab03af1e05a2952b78d6ac91f521e4b7452576ab30ee4a7f1d3d942
1.2.0-nullsafety.12020-09-22T16:56:45.009904ZCached7fde27202991e8d3dd92e73547d0a26c46bb3cf6aa21a21018c8b6d5c006686b
1.2.0-nullsafety.22020-10-23T21:33:38.244228ZCached21d9c931a06db8b63df15e6435778733b13897cd7c77cf855483a87524e83b98
1.2.0-nullsafety.32020-11-03T22:36:54.776382ZCached24fdfbe81eb0d4f3699d6f377c9142db390baee5c2a8cd2bf919f1b452d7030d
1.2.02021-02-02T23:21:11.938521ZCacheda88162591b02c1f3a3db3af8ce1ea2b374bd75a7bb8d5e353bcfbdc79d719830
1.2.12022-06-15T20:49:59.502761ZCacheda29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
1.2.22024-12-17T09:33:15.487660ZCached7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e

Dependencies

No direct dependencies declared.