|
| 1 | +``` |
| 2 | + _____ _ _ |
| 3 | +| __|_|___ ___| |___ |
| 4 | +| __| | . | . | | -_| |
| 5 | +|__| |_|_ |_ |_|___| |
| 6 | + |___|___| |
| 7 | +``` |
| 8 | + |
| 9 | +[](https://github.com/drewnoakes/figgle/actions/) |
| 10 | +[](https://www.nuget.org/packages/Figgle/) |
| 11 | + |
| 12 | +## ASCII banner generation for .NET |
| 13 | + |
| 14 | +```c# |
| 15 | +Console.WriteLine( |
| 16 | + FiggleFonts.Standard.Render("Hello, World!")); |
| 17 | +``` |
| 18 | + |
| 19 | +Produces... |
| 20 | + |
| 21 | +``` |
| 22 | + _ _ _ _ __ __ _ _ _ |
| 23 | + | | | | ___| | | ___ \ \ / /__ _ __| | __| | | |
| 24 | + | |_| |/ _ \ | |/ _ \ \ \ /\ / / _ \| '__| |/ _` | | |
| 25 | + | _ | __/ | | (_) | \ V V / (_) | | | | (_| |_| |
| 26 | + |_| |_|\___|_|_|\___( ) \_/\_/ \___/|_| |_|\__,_(_) |
| 27 | + |/ |
| 28 | +``` |
| 29 | + |
| 30 | +Use Figgle's source generator to embed just the fonts you want into your assembly, or—if the text to render is known ahead of time—render that text during compilation, so you don't need to ship Figgle binaries with your app. |
| 31 | + |
| 32 | +## Installation |
| 33 | + |
| 34 | +Figgle ships as NuGet packages that target .NET Standard 2.0, so runs almost everywhere. |
| 35 | + |
| 36 | +| Project | Badges | Description | |
| 37 | +| :------ | :----- | :---------- | |
| 38 | +| [Figgle][figgle] | [![v][figgle-v]][figgle-nuget] [![dl][figgle-dl]][figgle-nuget] | The core library. Supports parsing font files and rendering text. | |
| 39 | +| [Figgle.Fonts][fonts] | [![v][fonts-v]][fonts-nuget] [![dl][fonts-dl]][fonts-nuget] | A collection of 250+ [FIGlet](http://www.figlet.org/) fonts, for use with Figgle. | |
| 40 | +| [Figgle.Generator][generator] | [![v][gen-v]][gen-nuget] [![dl][gen-dl]][gen-nuget] | A source generator to embedding fonts and render static text at compile-time. | |
| 41 | + |
| 42 | +[figgle]: https://github.com/drewnoakes/figgle/tree/master/src/Figgle |
| 43 | +[fonts]: https://github.com/drewnoakes/figgle/tree/master/src/Figgle.Fonts |
| 44 | +[generator]: https://github.com/drewnoakes/figgle/tree/master/src/Figgle.Generator |
| 45 | + |
| 46 | +[figgle-v]: https://img.shields.io/nuget/v/Figgle |
| 47 | +[figgle-dl]: https://img.shields.io/nuget/dt/Figgle |
| 48 | +[figgle-nuget]: https://www.nuget.org/packages/Figgle/ |
| 49 | + |
| 50 | +[fonts-v]: https://img.shields.io/nuget/v/Figgle.Fonts |
| 51 | +[fonts-dl]: https://img.shields.io/nuget/dt/Figgle.Fonts |
| 52 | +[fonts-nuget]: https://www.nuget.org/packages/Figgle.Fonts/ |
| 53 | + |
| 54 | +[gen-v]: https://img.shields.io/nuget/v/Figgle.Generator |
| 55 | +[gen-dl]: https://img.shields.io/nuget/dt/Figgle.Generator |
| 56 | +[gen-nuget]: https://www.nuget.org/packages/Figgle.Generator/ |
| 57 | + |
| 58 | +## Sample apps |
| 59 | + |
| 60 | +If you just want to see some code (it's not that complex) check out one of the following sample projects: |
| 61 | + |
| 62 | +| Sample | Description | |
| 63 | +| :----- | :---------- | |
| 64 | +| [Basics](samples/1-basics) | The easiest option, if you don't care about application size or memory use. | |
| 65 | +| [Static text generation](samples/2-static-text) | **For statically-known text**, have a source generator embed the rendered text directly into your assembly. Uses the `Figgle.Generator` package, and uses a single attribute to render the text at compile time. If all Figgle text is rendered this way, you don't have to ship any `Figgle` assembly with your app. | |
| 66 | +| [Embed font from package](samples/3-embed-font-from-package) | **For dynamic text, using a font from the `Figgle.Fonts` package** via an attribute. The font is embedded directly into your assembly. With this approach, you only need the lightweight `Figgle` package at runtime. | |
| 67 | +| [Embed font from `.flf` file](samples/4-embed-font-from-file) | **For dynamic text, using a `.flf` font file** via an attribute and `<AdditionalFiles>` project item in the `.csproj`. The font is embedded directly into your assembly. With this approach, you only need the lightweight `Figgle` package at runtime. | |
| 68 | + |
| 69 | +## More output examples |
| 70 | + |
| 71 | +Using `FiggleFonts.Graffiti`: |
| 72 | + |
| 73 | +``` |
| 74 | + ___ ___ .__ .__ __ __ .__ .___._. |
| 75 | + / | \ ____ | | | | ____ / \ / \___________| | __| _/| | |
| 76 | +/ ~ \_/ __ \| | | | / _ \ \ \/\/ / _ \_ __ \ | / __ | | | |
| 77 | +\ Y /\ ___/| |_| |_( <_> ) \ ( <_> ) | \/ |__/ /_/ | \| |
| 78 | + \___|_ / \___ >____/____/\____/ /\ \__/\ / \____/|__| |____/\____ | __ |
| 79 | + \/ \/ )/ \/ \/ \/ |
| 80 | +``` |
| 81 | + |
| 82 | +Using `FiggleFonts.ThreePoint`: |
| 83 | + |
| 84 | +``` |
| 85 | +|_| _ || _ \ / _ _| _|| |
| 86 | +| |(/_||(_), \/\/ (_)| |(_|. |
| 87 | +``` |
| 88 | + |
| 89 | +Using `FiggleFonts.Ogre`: |
| 90 | + |
| 91 | +``` |
| 92 | + _ _ __ __ _ _ _ |
| 93 | + /\ /\___| | | ___ / / /\ \ \___ _ __| | __| | / \ |
| 94 | + / /_/ / _ \ | |/ _ \ \ \/ \/ / _ \| '__| |/ _` |/ / |
| 95 | +/ __ / __/ | | (_) | \ /\ / (_) | | | | (_| /\_/ |
| 96 | +\/ /_/ \___|_|_|\___( ) \/ \/ \___/|_| |_|\__,_\/ |
| 97 | + |/ |
| 98 | +``` |
| 99 | + |
| 100 | +Using `FiggleFonts.Rectangles`: |
| 101 | + |
| 102 | +``` |
| 103 | + __ |
| 104 | + _____ _ _ _ _ _ _ _| | |
| 105 | +| | |___| | |___ | | | |___ ___| |_| | | |
| 106 | +| | -_| | | . |_ | | | | . | _| | . |__| |
| 107 | +|__|__|___|_|_|___| | |_____|___|_| |_|___|__| |
| 108 | + |_| |
| 109 | +``` |
| 110 | + |
| 111 | +Using `FiggleFonts.Slant`: |
| 112 | + |
| 113 | +``` |
| 114 | + __ __ ____ _ __ __ ____ |
| 115 | + / / / /__ / / /___ | | / /___ _____/ /___/ / / |
| 116 | + / /_/ / _ \/ / / __ \ | | /| / / __ \/ ___/ / __ / / |
| 117 | + / __ / __/ / / /_/ / | |/ |/ / /_/ / / / / /_/ /_/ |
| 118 | +/_/ /_/\___/_/_/\____( ) |__/|__/\____/_/ /_/\__,_(_) |
| 119 | + |/ |
| 120 | +``` |
0 commit comments