Skip to content

Commit

Permalink
修复::TextifyChars 变量名拼错
Browse files Browse the repository at this point in the history
  • Loading branch information
oovm committed Aug 3, 2018
1 parent 46223af commit 94298d1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Packages/Module/TextArt.wl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
(* ::Section:: *)
(*函数说明*)
BeginPackage["TextArt`"];
TextifyChars::usage = "";
Textify::usage = "这里应该填这个函数的说明,如果要换行用\"\r\"\r就像这样";
TextifyChars::usage = "TextifyChars 预渲染 Textify 所需的字符.";
Textify::usage = "字符画, 使用字符近似的表示原来的图画.";
(* ::Section:: *)
(*程序包正体*)
(* ::Subsection::Closed:: *)
Expand All @@ -43,7 +43,7 @@ TextifyCleanMemory[] := With[
Options[TextifyChars] = {FontFamily -> "Source Sans Pro", FontSize -> 12, RasterSize -> 50, ClearAll -> False};
TextifyChars[lang_String, opt___] := Module[
{chars = Alphabet[lang]},
If[ListQ@chars, Textify[chars, opt], Textify[Alphabet[], opt]]
If[ListQ@chars, TextifyChars[chars, opt], TextifyChars[Alphabet[], opt]]
];
TextifyChars[chars_List, OptionsPattern[]] := Module[
{fnt, gridWidth, gridHeight, light},
Expand Down
33 changes: 27 additions & 6 deletions docs/TextArt/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,39 @@ $head="https://raw.githubusercontent.com/GalAster/Illusory/master/Packages/Modul
Import[$head<>"TextArt.wl"];
```

## LineWeb

- `LineWeb[img, k:100]`
## TextifyChars

### 参数说明

- img 类型为 `Image`, 表示需要转化的图片
- k 类型为 `Integer`, 表示最终结果的线密度
::: tip `TextifyChars[lang]`
- lang 类型为 `String`, 表示所使用的字母表, 等价于使用 `Alphabet`.
:::

### 可选项

::: tip `TextifyChars[chars]`
- chars 类型为 `List`, 表示需要渲染的字符列表.
:::


### 可选项

- FontFamily -> "Source Sans Pro"
- 字体
- FontSize -> 12
- 字号, 最好不要超过渲染大小的一半
- RasterSize -> 50
- 渲染大小, 越大计算遮盖度越精确.
- ClearAll -> False
- 是否清除字体渲染缓存
- 一般来说字体字号字符不同都会产生缓存, 低于上千时无需清除.

### 返回值

`Association`, 包含下一步 Textify 所需的各种信息.


默认情况下渲染每个字符需要 75-90 毫秒, 但是只有第一遍需要渲染.



### 标准示例
Expand All @@ -34,3 +52,6 @@ Import[]
```

**测试输出:**


## Textify

0 comments on commit 94298d1

Please sign in to comment.