搜尋套件、儲存庫與 APP 分類

enough_ascii_art 封面
套件詳情v1.1.2

enough_ascii_art

使用圖像轉ASCII、FIGlet文字橫幅支援和表情符號轉文字轉換生成ASCII藝術。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
780
喜歡數
27
Pub 分數
150

安裝套件

flutter pub add enough_ascii_art

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Enough ASCII Art 是一個 Flutter 套件,可讓開發者從影像產生 ASCII 藝術,使用 FIGlet 字型建立文字橫幅,並將表情符號轉換為描述性文字。它支援多個平台,包括 Android、iOS、Web、macOS、Windows 和 Linux。此套件非常適合在應用程式中加入復古風格的視覺元素或裝飾性文字。透過 pub add 簡單整合,它為 Flutter 應用中的創意文字渲染與藝術效果提供輕量級解決方案。

適用情境

  • 添加復古風格文字效果
  • 從圖像生成ASCII藝術
  • 使用FIGlet字體創建橫幅文字
  • 將表情符號轉換為文字描述
  • 使用ASCII裝飾增強UI

主要特色

  • 圖像轉ASCII
  • FIGlet 文字橫幅支援
  • 表情符號轉文字
  • 跨平台相容性
  • 簡單的 pub.dev 集成

適合對象

  • 創意應用介面
  • 復古主題應用
  • 基於文字的視覺效果
  • 帶有ASCII視覺效果的教育工具
  • 具有風格化文字的遊戲

使用建議

  • 大圖像的效能可能會有所不同
  • FIGlet 字型的自訂選項有限
  • 依賴外部ASCII生成邏輯
  • 未針對高頻率更新進行優化
  • 可能需要字型資源管理

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

An ASCII art library for Dart developers.

Available under the commercial friendly MPL Mozilla License 2.0.

Usage

Things you can do with enough_ascii_art:

  • Generate a textual representation of an image using convertImage(..).
  • Create FIGlet text banners with renderFiglet(..).
  • Convert ASCII text into UTF-8 "fonts" like 𝕕𝕠𝕦𝕓𝕝𝕖 𝕤𝕥𝕣𝕦𝕔𝕜 with renderUnicode(..).
  • Convert common UTF-8 emoticons to their text-representation with convertEmoticons(..).

Usage example:

import 'dart:io';
import 'package:enough_ascii_art/enough_ascii_art.dart' as art;
import 'package:image/image.dart' as img;

void main() async {
  final bytes = await File('./example/enough.jpg').readAsBytes();
  final image = img.decodeImage(bytes)!;
  var asciiImage = art.convertImage(image, maxWidth: 40, invert: true);
  print('');
  print(asciiImage);

  var helloWithUtf8Smileys = 'hello world 😛';
  var helloWithTextSmileys =
      art.convertEmoticons(helloWithUtf8Smileys, art.EmoticonStyle.western);
  print('');
  print(helloWithTextSmileys);
  print('');

  print('cosmic:');
  var fontText = await File('./example/cosmic.flf').readAsString();
  var figure = art.renderFiglet('ENOUGH', art.Font.text(fontText));
  print(figure);
  print('');

  var unicode = art.renderUnicode('hello world', art.UnicodeFont.doublestruck);
  print('double struck:');
  print(unicode);
}

The above code renders the following output:

%%%%%%%%%%%%%%%%%%@%@%#%#%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%##      -@%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%.        .#%%%%%%%%%%%
%%%%%%%%%%%%%%%%%#          #%%%%%%%%%%%
%%%%%%%%%%%%%%%%#@           %%%%%%%%%%%
%%%%%%%%%%%%% #*  #      @   %%%%%%%%%%%
%%%%%%%%%%%%%%-    *   =%    #%%%%%%%%%%
%%%%%%%%%%%%%%@#      *%     .#%%%%%%%%%
%%%%%%%%%%%%%%%%-    .@%%       %%%%%%%%
%%%%%%%%%%%%%%%=    @%%@          #%%%%%
%%%%%%%%%%%%%%#     #%%=            ##%%
%%%%%%%%%%%%%%%.      .               #%
%%%%%%%%%%%%%%%%@                      *
%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%                 #
%%%%%%%%%%%%%%%%%%%%%%-              +%%
%%%%%%%%%%%%%%%%%%%%%%%.             %%%
%%%%%%%%%%%%%%%%%%%%%%%.           :%%%%
%%%%%%%%%%%%%%%%%%%%%%.             +@%%
%%%%%%%%%%%%%%%%%%%%%%    +%%%%%@    @%%
%%%%%%%%%%%%%%%%%%%%%.    @%%%%%#     %%
%%%%%%%%%%%%%%%%%%%%%     #%%%%%@     %%
%%%%%%%%%%%%%%%%%%%%%%-  -%%%%%%      %%


hello world :-P

cosmic:
.,:::::::::.    :::.    ...      ...    :::  .,-:::::/    ::   .:
;;;;''''`;;;;,  `;;; .;;;;;;;.   ;;     ;;;,;;-'````'    ,;;   ;;,
 [[cccc   [[[[[. '[[,[[     \[[,[['     [[[[[[   [[[[[[/,[[[,,,[[[
 $$""""   $$$ "Y$c$$$$$,     $$$$$      $$$"$$c.    "$$ "$$$"""$$$
 888oo,__ 888    Y88"888,_ _,88P88    .d888 `Y8bo,,,o88o 888   "88o
 """"YUMMMMMM     YM  "YMMMMMP"  "YmmMMMM""   `'YMUP"YMM MMM    YMM

double struck:
𝕙𝕖𝕝𝕝𝕠 𝕨𝕠𝕣𝕝𝕕

Installation

Add this dependency your pubspec.yaml file:

dependencies:
  enough_ascii_art: ^1.0.0

The latest version or enough_ascii_art is enough_ascii_art version.

Features and bugs

Please file feature requests and bugs at the issue tracker.

Run Example

After checking out this project, you can run the example from the root with this command:

dart ./example/enough_ascii_art_example.dart

Contribute & Known Limitations

Any contributions are welcome!

Known limitations:

  • Images are always converted to grayscale
  • The FIGlet banners are currently only supported with left-to-right text direction
  • The FIGlet banners are not wrapped into multiple lines
  • You cannot list all available FIGlet fonts, but instead need to know their names (check out the figlet/fonts directory!)
  • Currently only western style text emoticons are available

Please help removing these limitations!

Some more examples


shadow:
 ____|  \  |  _ \  |   |  ___| |   |
 __|     \ | |   | |   | |     |   |
 |     |\  | |   | |   | |   | ___ |
_____|_| \_|\___/ \___/ \____|_|  _|



smslant:
   _____  ______  __  _________ __
  / __/ |/ / __ \/ / / / ___/ // /
 / _//    / /_/ / /_/ / (_ / _  /
/___/_/|_/\____/\____/\___/_//_/



eftifont:
 ___  _  _  _  _ _  __  _ _
| __|| \| |/ \| | |/ _|| U |
| _| | \\ ( o ) U ( |_n|   |
|___||_|\_|\_/|___|\__/|_n_|



big:
 ______ _   _  ____  _    _  _____ _    _
|  ____| \ | |/ __ \| |  | |/ ____| |  | |
| |__  |  \| | |  | | |  | | |  __| |__| |
|  __| | . ` | |  | | |  | | | |_ |  __  |
| |____| |\  | |__| | |__| | |__| | |  | |
|______|_| \_|\____/ \____/ \_____|_|  |_|




isometric1:
      ___           ___           ___           ___           ___           ___
     /\  \         /\__\         /\  \         /\__\         /\  \         /\__\
    /::\  \       /::|  |       /::\  \       /:/  /        /::\  \       /:/  /
   /:/\:\  \     /:|:|  |      /:/\:\  \     /:/  /        /:/\:\  \     /:/__/
  /::\~\:\  \   /:/|:|  |__   /:/  \:\  \   /:/  /  ___   /:/  \:\  \   /::\  \ ___
 /:/\:\ \:\__\ /:/ |:| /\__\ /:/__/ \:\__\ /:/__/  /\__\ /:/__/_\:\__\ /:/\:\  /\__\
 \:\~\:\ \/__/ \/__|:|/:/  / \:\  \ /:/  / \:\  \ /:/  / \:\  /\ \/__/ \/__\:\/:/  /
  \:\ \:\__\       |:/:/  /   \:\  /:/  /   \:\  /:/  /   \:\ \:\__\        \::/  /
   \:\ \/__/       |::/  /     \:\/:/  /     \:\/:/  /     \:\/:/  /        /:/  /
    \:\__\         /:/  /       \::/  /       \::/  /       \::/  /        /:/  /
     \/__/         \/__/         \/__/         \/__/         \/__/         \/__/


chunky:
 _______ _______ _______ _______ _______ _______
|    ___|    |  |       |   |   |     __|   |   |
|    ___|       |   -   |   |   |    |  |       |
|_______|__|____|_______|_______|_______|___|___|

所屬分類

依賴

依賴清單 2 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。