AnsiLove.framework:可可框架,用于渲染ANSi ASCII艺术

  • y9_984831
    了解作者
  • 344.1KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-15 08:25
    上传日期
AnsiLove.framework 我认为这是可可框架,以赞扬过去的美好时光。 它具有渲染ANSi / ASCII艺术的能力,并且还可以处理SAUCE记录。 告诉我更多 有两个类负责所有魔术: ALAnsiGenerator和ALSauceMachine 。 前者ALAnsiGenerator从ANSi源文件创建可用于Retina的PNG图像。 一件事又一件事,图像是只读的。 因此,如果您正在寻找以真实文本模式生成输出的内容(例如,作为NSAttributedString实例),那是错误的。 但是,如果您正在寻找当今可用的最完整,最准确的ANSi艺术资源渲染,那么您来对地方了。 后者ALSauceMachine正在读取SAUCE记录,并将这些值作为Objective-C属性返回。 版本信息 :当前架构版本6.1.0基于- : 2.2.1 特征 渲染所有已知的ANSi / ASCII美
AnsiLove_framework-master.zip
  • AnsiLove.framework-master
  • .gitignore
    476B
  • AnsiLove.xcodeproj
  • project.pbxproj
    27.3KB
  • LICENSE
    1.5KB
  • AnsiLove
  • Include
  • gd_color_map.h
    478B
  • gdfontl.h
    551B
  • gdfontmb.h
    519B
  • png.h
    142.8KB
  • gd_io.h
    3.1KB
  • gd.h
    50KB
  • gd_errors.h
    1.5KB
  • pnglibconf.h
    7KB
  • entities.h
    4.8KB
  • gdcache.h
    2.8KB
  • gdfontg.h
    553B
  • pngconf.h
    22.9KB
  • gdfx.h
    2.3KB
  • gdpp.h
    50.9KB
  • gdfonts.h
    515B
  • gdfontt.h
    546B
  • Classes
  • ALSauceMachine.h
    2.5KB
  • ALAnsiLove.m
    88KB
  • ALSubStr.h
    380B
  • albinfonts.h
    1.4KB
  • ALAnsiLove.h
    2.1KB
  • ALExplode.h
    660B
  • ALSauceMachine.m
    9.9KB
  • ALExplode.m
    956B
  • ALBinFonts.m
    571.3KB
  • ALSubStr.m
    399B
  • ALAnsiGenerator.h
    1.4KB
  • AnsiLove.h
    275B
  • alconfig.h
    833B
  • ALAnsiGenerator.m
    10KB
  • ALFileSize.h
    345B
  • ALFileSize.m
    870B
  • Library
  • libpng16.16.dylib
    172.7KB
  • libgd.3.dylib
    305.7KB
  • AnsiLove-Info.plist
    970B
  • en.lproj
  • InfoPlist.strings
    45B
  • AnsiLove-Prefix.pch
    147B
  • AnsiLoveGUI
  • main.m
    371B
  • ALAppDelegate.h
    1.5KB
  • AnsiLoveGUI-Prefix.pch
    153B
  • ALAppDelegate.m
    10.2KB
  • AnsiLoveGUI-Info.plist
    1.1KB
  • en.lproj
  • Credits.rtf
    431B
  • InfoPlist.strings
    45B
  • MainMenu.xib
    65.3KB
  • README.md
    14.1KB
内容介绍
# AnsiLove.framework This is a Cocoa framework I consider as tribute to the good old days™. It's capable of rendering ANSi / ASCII art and it also handles SAUCE records. # Tell me more There are two classes responsible for all the magic: `ALAnsiGenerator` and `ALSauceMachine`. The former, `ALAnsiGenerator` creates Retina-ready PNG images from ANSi source files. What with one thing and another, images are read-only. So if you're looking for something that generates output in real textmode, maybe as a NSAttributedString instance, you're wrong. However, if you're seeking the most complete and accurate rendering of ANSi art sources available these days, you came to the right place. The latter, `ALSauceMachine` is reading SAUCE records and returns these values as Objective-C properties. # Version info Current framework release: `6.1.0` - based on: [AnsiLove/C](https://github.com/AnsiLove/AnsiLove-C) `2.2.1` # Features Rendering of all known ANSi / ASCII art file types: - ANSi (.ANS) - Binary (.BIN) - Artworx (.ADF) - iCE Draw (.IDF) - Xbin (.XB) [details](http://www.acid.org/info/xbin/xbin.htm) - PCBoard (.PCB) - Tundra (.TND) [details](http://sourceforge.net/projects/tundradraw) - ASCII (.ASC) - Release info (.NFO) - Description in zipfile (.DIZ) Files with custom suffix default to the ANSi renderer (e.g. ICE or CIA). AnsiLove.framework is capabable of processing: - SAUCE records - DOS and Amiga fonts (embedded binary dump) - iCE colors Still not enough? - Output files are highly optimized 4-bit images. - Optionally generate proper Retina @2x.PNG files. - Use custom objects for adjusting output results. - Built-in support for rendering Amiga ASCII. - Everything's Mac App Store conform and sandboxing compliant. - ARC / Automatic Reference Counting # Documentation Let's talk about using the framework in your own projects. First of all, AnsiLove.framework is intended to run on `OS X`, it won't work for `iOS`. You have to download the sources and compile the framework. The Xcode project file contains two build targets, the framework itself and a test app `AnsiLoveGUI`, the latter is optional. Select `AnsiLoveGUI` from the Schemes dropdown in Xcode if you desire to compile that one too. The test app is a good example of implementing AnsiLove.framework, it does not contain much code and what you find there is well commented. So `AnsiLoveGUI` might be your first place to play with the framework after reading this documentation. Being an ARC framework, the test app is a pure ARC project as well. Makes sense, right? ## Implementing the framework in your own sources I assume you know how to add a framework to your own projects, so we just skip that step now. Go to the header of the class you want to use the framework with. Import the framework like this: #import <ansilove/AnsiLove.h rel='nofollow' onclick='return false;'> Create an instance of `ALAnsiGenerator`: ALAnsiGenerator *ansiGen = [ALAnsiGenerator new]; To transform ANSi source files into a beautiful images, `ALAnsiGenerator` comes with just one method you should know: (void)renderAnsiFile:(NSString *)inputFile outputFile:(NSString *)outputFile font:(NSString *)font bits:(NSString *)bits iceColors:(BOOL )iceColors columns:(NSString *)columns retina:(BOOL )generateRetina; Note that generally all objects except `inputFile` are optional. AnsiLove.framework will silently consume `nil` and empty string values and will rely on it's built-in defaults in both cases. ## (NSString *)inputFile The only necessary object you need to pass to `ALAnsiGenerator`. Well, that's logic. If there is no input file, what should be the output? I see you get it. Here is an example for a proper `inputFile` string: /Users/Stefan/Desktop/MyAnsiArtwork.ans I recommend treating this string case-sensitive. As you can see, that string explicitly needs to contain the path and the file name. Keep in mind that any `NSURL` needs to be converted to a string before passing to ALAnsiGenerator. NSURL has a method called `absoluteString` that can be used for easy conversion. NSURL *myURL; NSString *urlString = [myURL absoluteString]; Note that AnsiLove.framework will resolve any tilde in path for you. ## (NSString *)outputFile Formatting of string `outputFile` is identical to string `inputFile`. If you don't set this object, the framework will use the same path / file name you passed as `inputFile` string, addding .PNG suffix automatically. However, if you plan to write your images into a different directory and / or under a different filename, go ahead and customize this object. Just keep in mind that for custom paths the suffix will be added automatically as well. ## (NSString *)font AnsiLove.framework comes with two font families both originating from the golden age of ANSi artists. These font families are `PC` and `AMIGA`, the latter restricted to 8-bit only. Let's have a look at the values you can pass as `font` string. `PC` fonts can be (all case-sensitive): - `80x25` (code page 437) - `80x50` (code page 437, 80x50 mode) - `baltic` (code page 775) - `cyrillic` (code page 855) - `french-canadian` (code page 863) - `greek` (code page 737) - `greek-869` (code page 869) - `hebrew` (code page 862) - `icelandic` (Code page 861) - `latin1` (code page 850) - `latin2` (code page 852) - `nordic` (code page 865) - `portuguese` (Code page 860) - `russian` (code page 866) - `terminus` (modern font, code page 437) - `turkish` (code page 857) `AMIGA` fonts can be (all case-sensitive): - `amiga` (alias to Topaz) - `microknight` (Original MicroKnight version) - `microknight+` (Modified MicroKnight version) - `mosoul` (Original mO'sOul font) - `pot-noodle` (Original P0T-NOoDLE font) - `topaz` (Original Topaz Kickstart 2.x version) - `topaz+` (Modified Topaz Kickstart 2.x+ version) - `topaz500` (Original Topaz Kickstart 1.x version) - `topaz500+` (Modified Topaz Kickstart 1.x version) If you don't set a `font` object either passing `nil` or an empty string to ALAnsiGenerator, AnsiLove.framework will generate images using `80x25`, which is the default DOS font. ## (NSString *)bits Bits can be (all case-sensitive): - `8` (8-bit) - `9` (9-bit) - `ced` - `transparent` - `workbench` Setting the bits to `9` will render the 9th column of block characters, so the output will look like it is displayed in real textmode. Setting the bits to `ced` will cause the input file to be rendered in black on gray, and limit the output to 78 columns (only available for `.ans` files). Used together with an `AMIGA` font, the output will look like it is displayed on Amiga. Setting the bits to `workbench` will cause the input file to be rendered using Amiga Workbench colors (only available for `.ans` files). Settings the bits to `transparent` will produce output files with transparent background (only available for `.ans` files). ## (BOOL)iceColors Setting `iceColors` to `YES` will enable iCE color codes. On the opposite `NO` means that that `iceColors` are disabled, which is the default value. When an ANSi source was created using iCE colors, it was done with a special mode where the blinking was disabled, and you had 16 background colors available. Basically, you had the same choice for background colors as for foreground colors, that's iCE colors. But now the important part: when the ANSi source does not make specific use of iCE colors, you should NOT enable them. The file could look pretty weird in normal mode. So in most cases it's fine to turn iCE colors off. ## (NSString *)columns `columns` is only relevant for ANSi source files with `.BIN` extension and even for those files optional. In most cases conversion will work fine if you don't set this flag, the default value is `160` then. So please pass `columns` only to `.BIN` files and only if you exactly know what you're doing. The sun could explode or even worse: A KITTEN MAY DIE SOMEWHERE. ## (BOOL)generateRetina If you set this to `YES` the Frame
评论
    相关推荐