diff --git a/FIGlet Text.novaextension/CHANGELOG.md b/FIGlet Text.novaextension/CHANGELOG.md index 9ae0a1e..7cef63e 100644 --- a/FIGlet Text.novaextension/CHANGELOG.md +++ b/FIGlet Text.novaextension/CHANGELOG.md @@ -1,3 +1,10 @@ +## Version 1.8 +- fixed missing font links +- added BDF and C64 font sets + +## Version 1.7.1 +- removed unneeded filesystem entitlement (again) + ## Version 1.7 - added 'Preview All Installed FIGlet Fonts' to Extensions menu diff --git a/FIGlet Text.novaextension/README.md b/FIGlet Text.novaextension/README.md index 6ff017b..46f05ed 100644 --- a/FIGlet Text.novaextension/README.md +++ b/FIGlet Text.novaextension/README.md @@ -13,12 +13,11 @@ ## FIGlet FIGlet Text requires [FIGlet](http://www.figlet.org) to be installed locally. This extension assumes FIGlet has been installed using [Homebrew](https://brew.sh). Once Homebrew is installed, simply run `brew install figlet` to install FIGlet. -## Monospaced Fonts -It is recommended to only use a monospaced font in Nova. Not doing so may result in garbled looking FIGlet conversions. - # How to Use FIGlet Text FIGlet Text will add a 'Convert Selection to FIGlet' menu item to the Editor menu. Make one or more selections in the editor and run the command. +# Known Issues +- selected text with non-whitespace characters preceding the selection will output the text on each line + # Planned Features -- additional fonts - borders diff --git a/FIGlet Text.novaextension/Scripts/main.js b/FIGlet Text.novaextension/Scripts/main.js index 9ca2386..b7e9b59 100644 --- a/FIGlet Text.novaextension/Scripts/main.js +++ b/FIGlet Text.novaextension/Scripts/main.js @@ -11,11 +11,24 @@ * @returns a Disposable, see Nova extension docs https://docs.nova.app/api-reference/disposable/ */ nova.commands.register('figlet', (workspace, figletArgs, textToConvert, postConversion) => { + const fontSubDir = nova.config.get('figlet_text.font', 'string').match(/^.*\/\s*/) + const fontDir = () => { + if ( fontSubDir !== null) { + return '/usr/local/Cellar/figlet/2.2.5/share/figlet/fonts/' + fontSubDir + } + return '/usr/local/Cellar/figlet/2.2.5/share/figlet/fonts/' + } + let args = ['figlet'] for (const arg in figletArgs) { args.push(figletArgs[arg]) } - args.push(textToConvert) + + args.push( + '-d' + fontDir(), + '-f' + nova.config.get('figlet_text.font', 'string').replace(fontSubDir, ''), + textToConvert + ) const process = new Process('/usr/bin/env', {args}) @@ -48,7 +61,6 @@ nova.commands.register('figlet', (workspace, figletArgs, textToConvert, postConv // FIGlet convert the selected text in the editor nova.commands.register('figletTextEditor', editor => { let figConfig = { - font: '-f' + nova.config.get('figlet_text.font', 'string'), outputWidth: '-w' + nova.config.get('figlet_text.outputWidth', 'number'), textDirection: nova.config.get('figlet_text.textDirection', 'string'), justification: nova.config.get('figlet_text.justification', 'string'), @@ -142,8 +154,7 @@ nova.commands.register('figletTextEditor', editor => { nova.commands.register('figletTextFontPreview', workspace => { let figConfig = { kerning: '-k', - outputWidth: '-w' + 2000, - font: '-f' + nova.config.get('figlet_text.font', 'string') + outputWidth: '-w' + 2000 } let text = nova.config.get('figlet_text.previewText', 'string') @@ -162,7 +173,7 @@ nova.config.onDidChange('figlet_text.previewText', (newValue, oldValue) => { }) -// preview all installed FIGlet fonts in an editor +// preview all installed FIGlet distributed fonts in an new editor nova.commands.register('figletTextFontPreviewAll', workspace => { let message = 'Enter a custom preview text. Leave blank to use the font name for each font preview text output.' let options = {label: 'Preview Text', placeholder: 'Use Font Name', prompt: 'Generate Previews'} diff --git a/FIGlet Text.novaextension/extension.json b/FIGlet Text.novaextension/extension.json index ed3532d..785d941 100644 --- a/FIGlet Text.novaextension/extension.json +++ b/FIGlet Text.novaextension/extension.json @@ -3,14 +3,14 @@ "name": "FIGlet Text", "organization": "Dan Remollino", "description": "Convert selected text to FIGlet. Great for adding readable text to the Minimap, creating l33t text headers, and organizing files.", - "version": "1.7", + "version": "1.8", "categories": ["commands", "formatters"], "entitlements": { "clipboard": false, "process": true, "requests": false, - "filesystem": "readwrite" + "filesystem": false }, "main": "main.js", @@ -24,7 +24,7 @@ { "key": "figlet_text.font", "title": "Font", - "description": "The FIGlet font to use when converting text.", + "description": "The Homebrew install of FIGlet includes three font sets...\n\nFIGlet (unprefixed): The default fonts distributed with FIGlet\nBDF (bdffonts): BDF-format (X Windows) fonts distributed by the X Consortium\nC64 (C64-fonts): Commodore 64 fonts converted by by David Proper", "type": "enum", "radio": false, "values": [ @@ -47,12 +47,14 @@ "bigchief", "binary", "block", + "broadway", "bubble", "bulbhead", "calgphy2", "caligraphy", "catwalk", "chunky", + "cjkfonts.re", "coinstak", "colossal", "computer", @@ -60,18 +62,23 @@ "contrast", "cosmic", "cosmike", + "crawford", "cricket", "cursive", "cyberlarge", "cybermedium", "cybersmall", + "decimal", "diamond", "digital", "doh", "doom", "dotmatrix", + "double", "drpepper", + "dwhistled", "eftichess", + "eftichessC", "eftifont", "eftipiti", "eftirobot", @@ -79,12 +86,17 @@ "eftiwall", "eftiwater", "epic", + "fe", "fender", "fourtops", + "fraktur", "fuzzy", "goofy", "gothic", + "graceful", + "gradient", "graffiti", + "hex", "hollywood", "invita", "isometric1", @@ -97,6 +109,7 @@ "jerusalem", "katakana", "kban", + "l4me", "larry3d", "lcd", "lean", @@ -112,13 +125,18 @@ "mnemonic", "morse", "moscow", + "mshebrew210", "nancyj-fancy", "nancyj-underlined", "nancyj", "nipples", "ntgreek", + "nvscript", "o8", + "Obanner.RE", + "octal", "ogre", + "os2", "pawp", "peaks", "pebbles", @@ -153,6 +171,7 @@ "smslant", "smtengwar", "speed", + "stacey", "stampatello", "standard", "starwars", @@ -174,8 +193,269 @@ "twopoint", "univers", "usaflag", - "wavy", - "weird" + "weird", + "whimsy", + "", + "bdffonts/5x7", + "bdffonts/5x8", + "bdffonts/6x9", + "bdffonts/6x10", + "bdffonts/brite", + "bdffonts/briteb", + "bdffonts/britebi", + "bdffonts/britei", + "bdffonts/chartr", + "bdffonts/chartri", + "bdffonts/clb6x10", + "bdffonts/clb8x8", + "bdffonts/clb8x10", + "bdffonts/cli8x8", + "bdffonts/clr4x6", + "bdffonts/clr5x6", + "bdffonts/clr5x8", + "bdffonts/clr5x10", + "bdffonts/clr6x6", + "bdffonts/clr6x8", + "bdffonts/clr6x10", + "bdffonts/clr7x8", + "bdffonts/clr7x10", + "bdffonts/clr8x8", + "bdffonts/clr8x10", + "bdffonts/cour", + "bdffonts/courb", + "bdffonts/courbi", + "bdffonts/couri", + "bdffonts/helv", + "bdffonts/helvb", + "bdffonts/helvbi", + "bdffonts/helvi", + "bdffonts/sans", + "bdffonts/sansb", + "bdffonts/sansbi", + "bdffonts/sansi", + "bdffonts/sbook", + "bdffonts/sbookb", + "bdffonts/sbookbi", + "bdffonts/sbooki", + "bdffonts/times", + "bdffonts/tty", + "bdffonts/ttyb", + "bdffonts/utopia", + "bdffonts/utopiab", + "bdffonts/utopiabi", + "bdffonts/utopiai", + "bdffonts/xbrite", + "bdffonts/xbriteb", + "bdffonts/xbritebi", + "bdffonts/xbritei", + "bdffonts/xchartr", + "bdffonts/xchartri", + "bdffonts/xcour", + "bdffonts/xcourb", + "bdffonts/xcourbi", + "bdffonts/xcouri", + "bdffonts/xhelv", + "bdffonts/xhelvb", + "bdffonts/xhelvbi", + "bdffonts/xhelvi", + "bdffonts/xsans", + "bdffonts/xsansb", + "bdffonts/xsansbi", + "bdffonts/xsansi", + "bdffonts/xsbook", + "bdffonts/xsbookb", + "bdffonts/xsbookbi", + "bdffonts/xsbooki", + "bdffonts/xtimes", + "bdffonts/xtty", + "bdffonts/xttyb", + "", + "C64-fonts/4x4_offr", + "C64-fonts/64f1____", + "C64-fonts/1943____", + "C64-fonts/a_zooloo", + "C64-fonts/advenger", + "C64-fonts/aquaplan", + "C64-fonts/asc_____", + "C64-fonts/ascii___", + "C64-fonts/assalt_m", + "C64-fonts/asslt__m", + "C64-fonts/atc_____", + "C64-fonts/atc_gran", + "C64-fonts/b_m__200", + "C64-fonts/battle_s", + "C64-fonts/battlesh", + "C64-fonts/baz__bil", + "C64-fonts/beer_pub", + "C64-fonts/bubble__", + "C64-fonts/bubble_b", + "C64-fonts/c_ascii_", + "C64-fonts/c_consen", + "C64-fonts/c1______", + "C64-fonts/c2______", + "C64-fonts/caus_in_", + "C64-fonts/char1___", + "C64-fonts/char2___", + "C64-fonts/char3___", + "C64-fonts/char4___", + "C64-fonts/charact1", + "C64-fonts/charact2", + "C64-fonts/charact3", + "C64-fonts/charact4", + "C64-fonts/charact5", + "C64-fonts/charact6", + "C64-fonts/characte", + "C64-fonts/charset_", + "C64-fonts/coil_cop", + "C64-fonts/com_sen_", + "C64-fonts/computer", + "C64-fonts/convoy__", + "C64-fonts/d_dragon", + "C64-fonts/dcs_bfmo", + "C64-fonts/deep_str", + "C64-fonts/demo_1__", + "C64-fonts/demo_2__", + "C64-fonts/demo_m__", + "C64-fonts/devilish", + "C64-fonts/druid___", + "C64-fonts/e__fist_", + "C64-fonts/ebbs_1__", + "C64-fonts/ebbs_2__", + "C64-fonts/eca_____", + "C64-fonts/etcrvs__", + "C64-fonts/f15_____", + "C64-fonts/faces_of", + "C64-fonts/fair_mea", + "C64-fonts/fairligh", + "C64-fonts/fantasy_", + "C64-fonts/fbr_stri", + "C64-fonts/fbr_tilt", + "C64-fonts/fbr1____", + "C64-fonts/fbr2____", + "C64-fonts/fbr12___", + "C64-fonts/finalass", + "C64-fonts/fireing_", + "C64-fonts/flyn_sh", + "C64-fonts/fp1_____", + "C64-fonts/fp2_____", + "C64-fonts/funky_dr", + "C64-fonts/future_1", + "C64-fonts/future_2", + "C64-fonts/future_3", + "C64-fonts/future_4", + "C64-fonts/future_5", + "C64-fonts/future_6", + "C64-fonts/future_7", + "C64-fonts/future_8", + "C64-fonts/gauntlet", + "C64-fonts/ghost_bo", + "C64-fonts/gothic__", + "C64-fonts/gothic", + "C64-fonts/grand_pr", + "C64-fonts/green_be", + "C64-fonts/hades___", + "C64-fonts/heavy_me", + "C64-fonts/heroboti", + "C64-fonts/high_noo", + "C64-fonts/hills___", + "C64-fonts/home_pak", + "C64-fonts/house_of", + "C64-fonts/hypa_bal", + "C64-fonts/hyper___", + "C64-fonts/inc_raw_", + "C64-fonts/italics_", + "C64-fonts/joust___", + "C64-fonts/kgames_i", + "C64-fonts/kik_star", + "C64-fonts/krak_out", + "C64-fonts/lazy_jon", + "C64-fonts/letter_w", + "C64-fonts/letterw3", + "C64-fonts/lexible_", + "C64-fonts/mad_nurs", + "C64-fonts/magic_ma", + "C64-fonts/master_o", + "C64-fonts/mayhem_d", + "C64-fonts/mcg_____", + "C64-fonts/mig_ally", + "C64-fonts/modern__", + "C64-fonts/new_asci", + "C64-fonts/nfi1____", + "C64-fonts/notie_ca", + "C64-fonts/npn_____", + "C64-fonts/odel_lak", + "C64-fonts/ok_beer_", + "C64-fonts/outrun__", + "C64-fonts/p_s_h_m_", + "C64-fonts/p_skateb", + "C64-fonts/pacos_pe", + "C64-fonts/panther_", + "C64-fonts/pawn_ins", + "C64-fonts/phonix__", + "C64-fonts/platoon_", + "C64-fonts/platoon2", + "C64-fonts/pod_____", + "C64-fonts/r2-d2___", + "C64-fonts/rad_____", + "C64-fonts/rad_phan", + "C64-fonts/radical_", + "C64-fonts/rainbow_", + "C64-fonts/rally_s2", + "C64-fonts/rally_sp", + "C64-fonts/rampage_", + "C64-fonts/rastan__", + "C64-fonts/raw_recu", + "C64-fonts/rci_____", + "C64-fonts/ripper!_", + "C64-fonts/road_rai", + "C64-fonts/rockbox_", + "C64-fonts/rok_____", + "C64-fonts/roman___", + "C64-fonts/roman", + "C64-fonts/script__", + "C64-fonts/skate_ro", + "C64-fonts/skateord", + "C64-fonts/skateroc", + "C64-fonts/sketch_s", + "C64-fonts/sm______", + "C64-fonts/space_op", + "C64-fonts/spc_demo", + "C64-fonts/star_war", + "C64-fonts/stealth_", + "C64-fonts/stencil1", + "C64-fonts/stencil2", + "C64-fonts/street_s", + "C64-fonts/subteran", + "C64-fonts/super_te", + "C64-fonts/t__of_ap", + "C64-fonts/tav1____", + "C64-fonts/taxi____", + "C64-fonts/tec_7000", + "C64-fonts/tec1____", + "C64-fonts/tecrvs__", + "C64-fonts/ti_pan__", + "C64-fonts/timesofl", + "C64-fonts/tomahawk", + "C64-fonts/top_duck", + "C64-fonts/trashman", + "C64-fonts/triad_st", + "C64-fonts/ts1_____", + "C64-fonts/tsm_____", + "C64-fonts/tsn_base", + "C64-fonts/twin_cob", + "C64-fonts/type_set", + "C64-fonts/ucf_fan_", + "C64-fonts/ugalympi", + "C64-fonts/unarmed_", + "C64-fonts/usa_____", + "C64-fonts/usa_pq__", + "C64-fonts/vortron_", + "C64-fonts/war_of_w", + "C64-fonts/yie_ar_k", + "C64-fonts/yie-ar__", + "C64-fonts/z-pilot_", + "C64-fonts/zig_zag_", + "C64-fonts/zone7___" ], "default": "banner3" }, @@ -189,12 +469,11 @@ { "key": "figlet_text.preview", "title": "Preview", - "description": "Admittedly, this isn't the ideal preview as Nova uses a non-monospaced output for the Preview textbox above. Use the Extensions -> Preview All Installed FIGlet Fonts menu item to generate an accurate, custom text FIGlet font preview document.", + "description": "Admittedly, this isn't the ideal preview as Nova uses a non-monospaced output for the Preview textbox above.\n\nUse the Extensions -> Preview All Installed FIGlet Fonts menu item to generate an accurate, custom text FIGlet font preview document. This will only output the FIGlet distributed font set.", "type": "text" } ] }, - { "type": "section", "required": false, @@ -230,7 +509,6 @@ } ] }, - { "type": "section", "required": false,