Git Product home page Git Product logo

jfiglet's Introduction

jfiglet

Java implementation of FIGfonts to create ascii art banners. My goals were:

  • distributed as a maven dependency
  • should be small

I started out from Benoît Rigaut, Juillet work found at www.rigaut.com

Figlet

figlet is a command-line tool which helps you to create ascii banners like this:

      _ _____ ___ ____ _     _____ _____
     | |  ___|_ _/ ___| |   | ____|_   _|
  _  | | |_   | | |  _| |   |  _|   | |
 | |_| |  _|  | | |_| | |___| |___  | |
  \___/|_|   |___\____|_____|_____| |_|

Figlet has a specification which is included into the repo for easy access here

Usage

you can use it from command line or from java code

Maven dependency

add the following maven dependency to your pom.xml

<dependency>
	<groupId>com.github.lalyos</groupId>
	<artifactId>jfiglet</artifactId>
	<version>0.0.9</version>
</dependency>

Usage - code

Then one could use number of convertOneLine(...) static methods to do the magic

import com.github.lalyos.jfiglet.FigletFont;
import java.io.File;

public class App {
  public static void main(String[] args) {
    // using default font standard.flf, obtained from maven artifact
    String asciiArt1 = FigletFont.convertOneLine("hello");
    System.out.println(asciiArt1);
    
    // using font font2.flf, located somewhere in classpath under path /flf/font2.flf
    String asciiArt2 = FigletFont.convertOneLine(FigletFont.class.getResourceAsStream("/flf/font2.flf"), "hello");
    System.out.println(asciiArt2);
    
    asciiArt2 = FigletFont.convertOneLine("classpath:/flf/font2.flf", "hello");     
    System.out.println(asciiArt2);                
    
    // using font font3.flf, located in file system under path /opt/font3.flf
    String asciiArt3 = FigletFont.convertOneLine(new File("/opt/font3.flf"), "hello");     
    System.out.println(asciiArt3);

    asciiArt3 = FigletFont.convertOneLine("/opt/font3.flf", "hello");     
    System.out.println(asciiArt3);

    // using font font4.flf, from www 
    String asciiArt4 = FigletFont.convertOneLine("http://myhost.com/font4.flf", "hello");     
    System.out.println(asciiArt4);                
  }
}

Usage - command line

You can use the jar from the central repo, or use the latest development version from sourcecode;

Usage: java -jar jfiglet.jar [-f FLF] MESSAGE
Prints MESSAGE to stdout as ASCII art using Figlet font
Example: java -jar jfiglet.jar -f "/opt/myfont.flf" "Hello World"


Figlet font:
  -f  FLF is font file location within file system, java classpath or www.
      When FLF starts with `http://'|`https://' file will be fetched from WWW,
      if FLF starts from `classpath:' then it will be looked for in JRE classpath,
      otherwise FLF if path to file in file system

from source

git clone [email protected]:lalyos/jfiglet.git
cd jfiglet
mvn exec:java -Dexec.arguments="jfiglet rulez"

from maven central

curl -o jfiglet.jar https://repo1.maven.org/maven2/com/github/lalyos/jfiglet/0.0.9/jfiglet-0.0.9.jar
java -jar jfiglet.jar "text to convert"

Related projects

First I wrapped http://artii.herokuapp.com/ which is based on the artii gem I found 2 java implementations:

Todo

  • vertical smush-ing
  • add more fonts: first i wanted to keep it small, but want to deliver a couple of fonts included in the jar, or maybe as a separate maven dependency

jfiglet's People

Contributors

bartoleo avatar cowwoc avatar eshepelyuk avatar kdvolder avatar lalyos avatar mbenson avatar mcwarman avatar x4d3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jfiglet's Issues

Does the method convertOneLine need to throw an exception?

I want to use jfiglet as a dependency.

The method convertOneLine(String message) uses an internal font, so it won't happen that it is not found and an IOException is thrown. Does the method need to throw an exception then or could it try/catch internally?

Dual licensing

Would you be open to dual-licensing jfiglet, such that consumers of the library could choose the terms of the GPL or some more business-friendly license e.g. BSD or Apache?

Add module-info.java

Users of JPMS need this library to provide a module-info.java file. Otherwise, we get the following compile-time warning:

Required filename-based automodules detected: [jfiglet-0.0.9.jar]. Please don't publish this project to a public artifact repository!

See the end of https://www.baeldung.com/maven-multi-release-jars#1-maven-compiler-plugin if you want to maintain backwards compatibility with JDK 1.8 or earlier.

Per https://endoflife.date/java versions earlier than JDK 11 are no longer actively supported, even for long-term support, so you could theoretically just require JDK 11 from now on and avoid generating a multi-release JAR.

is not working with Calvin S figlet

I have tried to use with Calvin S figlet (https://github.com/xero/figlet-fonts/blob/master/Calvin%20S.flf), but the result is not looking good.
for input "test" outputs:
����������������
� ��� �����
� ���������
expected:

┌┬┐┌─┐┌─┐┌┬┐
 │ ├┤ └─┐ │ 
 ┴ └─┘└─┘ ┴ 

problem with some characters (extended)

there are problems with 'extended' characters

I think that the problem is in flf parser... (I look into code and a way to fix it...)

for example:
java -jar jfiglet-0.0.1.jar ù
/ _ \
/_/ _
@
x0103 LATIN SMALL LETTER A WITH BREV
_/


Horizontal spacing increased 0.7 -> 0.8

I ran the code fragment below and get quite different results between 0.7 and 0.8. I prefer 0.7 results. Was this change intended?

FigletFont.convertOneLine(
                    cls.getResourceAsStream("/flf/cybermedium.flf"), "amsa-util");

0.7:

____ _  _ ____ ____   _  _ ___ _ _    
|__| |\/| [__  |__|   |  |  |  | |    
|  | |  | ___] |  |   |__|  |  | |___ 

0.8:

 ____  _  _  ____  ____     _  _  ___  _  _    
 |__|  |\/|  [__   |__|     |  |   |   |  |    
 |  |  |  |  ___]  |  |     |__|   |   |  |___ 

cc @philipgroom @superevensteven

Release 0.0.9

Hello!!! Please release 0.0.9 with latest changes!!! Is reallly nice work!

corrupt jarfile

After trying to use jfiglet from maven central like described in the README.md

curl -o jfiglet.jar http://central.maven.org/maven2/com/github/lalyos/jfiglet/0.0.8/jfiglet-0.0.8.jar
java -jar jfiglet.jar "text to convert"

I get the following error:

Error: Invalid or corrupt jarfile jfiglet.jar

the jar file is present:

-rw-r--r--. 1 me mygroup 2522 Oct  5 11:23 jfiglet.jar

but seems to be invalid:

$ jar -tf jfiglet.jar 
java.util.zip.ZipException: zip END header not found
	at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1469)
	at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1477)
	at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1315)
	at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1277)
	at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:709)
	at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:243)
	at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:172)
	at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:143)
	at jdk.jartool/sun.tools.jar.Main.list(Main.java:1502)
	at jdk.jartool/sun.tools.jar.Main.run(Main.java:361)
	at jdk.jartool/sun.tools.jar.Main.main(Main.java:1683)

Maybe the link is not correct?

Logback issue

There is a Premature end of file problem with the logback.xml file in the jar.

Reported exception:
ch.qos.logback.core.joran.spi.JoranException: Problem parsing XML document. See previously reported errors.
    at ch.qos.logback.core.joran.event.SaxEventRecorder.recordEvents(SaxEventRecorder.java:67)
    at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:134)
    at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
    at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
    at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
    at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
    at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
    at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
    at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
    at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
    at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
    at net.liftweb.common.Logback$.withFile(Logging.scala:324)
    at net.liftweb.util.LoggingAutoConfigurer$$anonfun$apply$1$$anonfun$apply$mcV$sp$2$$anonfun$apply$6.apply(Log.scala:67)
    at net.liftweb.util.LoggingAutoConfigurer$$anonfun$apply$1$$anonfun$apply$mcV$sp$2$$anonfun$apply$6.apply(Log.scala:67)
    at net.liftweb.common.Full.map(Box.scala:553)
    at net.liftweb.util.LoggingAutoConfigurer$$anonfun$apply$1$$anonfun$apply$mcV$sp$2.apply(Log.scala:67)
    at net.liftweb.util.LoggingAutoConfigurer$$anonfun$apply$1$$anonfun$apply$mcV$sp$2.apply(Log.scala:66)
    at net.liftweb.common.Full.map(Box.scala:553)
    at net.liftweb.util.LoggingAutoConfigurer$$anonfun$apply$1.apply$mcV$sp(Log.scala:66)
    at net.liftweb.common.Logger$$anonfun$checkConfig$1.apply(Logging.scala:24)
    at net.liftweb.common.Logger$$anonfun$checkConfig$1.apply(Logging.scala:24)
    at net.liftweb.common.Full.foreach(Box.scala:551)
    at net.liftweb.common.Logger$.checkConfig$lzycompute(Logging.scala:24)
    at net.liftweb.common.Logger$.checkConfig(Logging.scala:23)
    at net.liftweb.common.Logger$class._logger(Logging.scala:122)
    at bootstrap.liftweb.Boot._logger(Boot.scala:30)
    at net.liftweb.common.Logger$class.net$liftweb$common$Logger$$logger(Logging.scala:120)
    at bootstrap.liftweb.Boot.net$liftweb$common$Logger$$logger$lzycompute(Boot.scala:30)
    at bootstrap.liftweb.Boot.net$liftweb$common$Logger$$logger(Boot.scala:30)
    at net.liftweb.common.Logger$class.info(Logging.scala:195)
    at bootstrap.liftweb.Boot.info(Boot.scala:30)
    at bootstrap.liftweb.Boot.boot(Boot.scala:102)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at net.liftweb.util.ClassHelpers$$anonfun$createInvoker$1.apply(ClassHelpers.scala:364)
    at net.liftweb.util.ClassHelpers$$anonfun$createInvoker$1.apply(ClassHelpers.scala:362)
    at net.liftweb.http.DefaultBootstrap$$anonfun$boot$1.apply(LiftRules.scala:2006)
    at net.liftweb.http.DefaultBootstrap$$anonfun$boot$1.apply(LiftRules.scala:2006)
    at net.liftweb.common.Full.map(Box.scala:553)
    at net.liftweb.http.DefaultBootstrap$.boot(LiftRules.scala:2006)
    at net.liftweb.http.provider.HTTPProvider$class.bootLift(HTTPProvider.scala:88)
    at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:928)
    at net.liftweb.http.provider.servlet.ServletFilterProvider$class.init(ServletFilterProvider.scala:40)
    at net.liftweb.http.LiftFilter.init(LiftServlet.scala:928)
    at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:263)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1238)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:480)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:172)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.Server.doStart(Server.java:277)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at com.earldouglas.xsbtwebplugin.Jetty7Runner.start(Jetty7Runner.scala:104)
    at com.earldouglas.xsbtwebplugin.Container$$anonfun$containerSettings$7.apply(Container.scala:64)
    at com.earldouglas.xsbtwebplugin.Container$$anonfun$containerSettings$7.apply(Container.scala:63)
    at sbt.Scoped$$anonfun$hf7$1.apply(Structure.scala:583)
    at sbt.Scoped$$anonfun$hf7$1.apply(Structure.scala:583)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49)
    at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
    at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:41)
    at sbt.std.Transform$$anon$5.work(System.scala:71)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.Execute.work(Execute.scala:238)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file.
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1239)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)
    at ch.qos.logback.core.joran.event.SaxEventRecorder.recordEvents(SaxEventRecorder.java:61)
    ... 83 more
14:00:54,942 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
14:00:54,942 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
14:00:54,942 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/Volumes/Home/.ivy2/cache/com.github.lalyos/jfiglet/jars/jfiglet-0.0.1.jar!/logback.xml]
14:00:54,970 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@3d87a249 - URL [jar:file:/Volumes/Home/.ivy2/cache/com.github.lalyos/jfiglet/jars/jfiglet-0.0.1.jar!/logback.xml] is not of type file
14:00:54,981 |-ERROR in ch.qos.logback.core.joran.event.SaxEventRecorder@13af862e - XML_PARSING - Parsing fatal error on line 1 and column 1 org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file.
    at org.xml.sax.SAXParseException: Premature end of file.
    at  at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
    at  at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
    at  at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
    at  at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
    at  at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)
    at  at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1019)
    at  at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
    at  at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
    at  at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    at  at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
    at  at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
    at  at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at  at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
    at  at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
    at  at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)
    at  at ch.qos.logback.core.joran.event.SaxEventRecorder.recordEvents(SaxEventRecorder.java:61)
    at  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:134)
    at  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
    at  at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
    at  at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
    at  at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
    at  at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
    at  at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
    at  at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
    at  at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
    at  at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
    at  at net.liftweb.common.Logback$.withFile(Logging.scala:324)
    at  at net.liftweb.util.LoggingAutoConfigurer$$anonfun$apply$1$$anonfun$apply$mcV$sp$2$$anonfun$apply$6.apply(Log.scala:67)
    at  at net.liftweb.util.LoggingAutoConfigurer$$anonfun$apply$1$$anonfun$apply$mcV$sp$2$$anonfun$apply$6.apply(Log.scala:67)
    at  at net.liftweb.common.Full.map(Box.scala:553)
    at  at net.liftweb.util.LoggingAutoConfigurer$$anonfun$apply$1$$anonfun$apply$mcV$sp$2.apply(Log.scala:67)
    at  at net.liftweb.util.LoggingAutoConfigurer$$anonfun$apply$1$$anonfun$apply$mcV$sp$2.apply(Log.scala:66)
    at  at net.liftweb.common.Full.map(Box.scala:553)
    at  at net.liftweb.util.LoggingAutoConfigurer$$anonfun$apply$1.apply$mcV$sp(Log.scala:66)
    at  at net.liftweb.common.Logger$$anonfun$checkConfig$1.apply(Logging.scala:24)
    at  at net.liftweb.common.Logger$$anonfun$checkConfig$1.apply(Logging.scala:24)
    at  at net.liftweb.common.Full.foreach(Box.scala:551)
    at  at net.liftweb.common.Logger$.checkConfig$lzycompute(Logging.scala:24)
    at  at net.liftweb.common.Logger$.checkConfig(Logging.scala:23)
    at  at net.liftweb.common.Logger$class._logger(Logging.scala:122)
    at  at bootstrap.liftweb.Boot._logger(Boot.scala:30)
    at  at net.liftweb.common.Logger$class.net$liftweb$common$Logger$$logger(Logging.scala:120)
    at  at bootstrap.liftweb.Boot.net$liftweb$common$Logger$$logger$lzycompute(Boot.scala:30)
    at  at bootstrap.liftweb.Boot.net$liftweb$common$Logger$$logger(Boot.scala:30)
    at  at net.liftweb.common.Logger$class.info(Logging.scala:195)
    at  at bootstrap.liftweb.Boot.info(Boot.scala:30)
    at  at bootstrap.liftweb.Boot.boot(Boot.scala:102)
    at  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at  at java.lang.reflect.Method.invoke(Method.java:606)
    at  at net.liftweb.util.ClassHelpers$$anonfun$createInvoker$1.apply(ClassHelpers.scala:364)
    at  at net.liftweb.util.ClassHelpers$$anonfun$createInvoker$1.apply(ClassHelpers.scala:362)
    at  at net.liftweb.http.DefaultBootstrap$$anonfun$boot$1.apply(LiftRules.scala:2006)
    at  at net.liftweb.http.DefaultBootstrap$$anonfun$boot$1.apply(LiftRules.scala:2006)
    at  at net.liftweb.common.Full.map(Box.scala:553)
    at  at net.liftweb.http.DefaultBootstrap$.boot(LiftRules.scala:2006)
    at  at net.liftweb.http.provider.HTTPProvider$class.bootLift(HTTPProvider.scala:88)
    at  at net.liftweb.http.LiftFilter.bootLift(LiftServlet.scala:928)
    at  at net.liftweb.http.provider.servlet.ServletFilterProvider$class.init(ServletFilterProvider.scala:40)
    at  at net.liftweb.http.LiftFilter.init(LiftServlet.scala:928)
    at  at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)
    at  at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at  at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)
    at  at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:263)
    at  at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1238)
    at  at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)
    at  at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:480)
    at  at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at  at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
    at  at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:172)
    at  at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at  at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at  at org.eclipse.jetty.server.Server.doStart(Server.java:277)
    at  at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at  at com.earldouglas.xsbtwebplugin.Jetty7Runner.start(Jetty7Runner.scala:104)
    at  at com.earldouglas.xsbtwebplugin.Container$$anonfun$containerSettings$7.apply(Container.scala:64)
    at  at com.earldouglas.xsbtwebplugin.Container$$anonfun$containerSettings$7.apply(Container.scala:63)
    at  at sbt.Scoped$$anonfun$hf7$1.apply(Structure.scala:583)
    at  at sbt.Scoped$$anonfun$hf7$1.apply(Structure.scala:583)
    at  at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49)
    at  at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
    at  at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
    at  at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:41)
    at  at sbt.std.Transform$$anon$5.work(System.scala:71)
    at  at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
    at  at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
    at  at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at  at sbt.Execute.work(Execute.scala:238)
    at  at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
    at  at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
    at  at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
    at  at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
    at  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at  at java.lang.Thread.run(Thread.java:744)

Remove oss-parent from pom.xml

The top-level pom.xml contains:

<parent>
  <groupId>org.sonatype.oss</groupId>
  <artifactId>oss-parent</artifactId>
  <version>9</version>
</parent>

Per https://github.com/sonatype/oss-parents this parent pom is deprecated.

The replacement looks something like this:

<build>
  <plugins>
    <plugin>
      <groupId>org.sonatype.plugins</groupId>
      <artifactId>nexus-staging-maven-plugin</artifactId>
      <version>1.6.13</version>
      <extensions>true</extensions>
      <configuration>
        <serverId>maven-central-releases</serverId>
        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
      </configuration>
    </plugin>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-source-plugin</artifactId>
      <version>3.2.1</version>
      <executions>
        <execution>
          <id>attach-sources</id>
          <goals>
            <goal>jar-no-fork</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
    <plugin>
      <artifactId>maven-javadoc-plugin</artifactId>
      <version>${maven-javadoc-plugin.version}</version>
    </plugin>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-gpg-plugin</artifactId>
      <version>3.0.1</version>
      <executions>
        <execution>
          <id>sign-artifacts</id>
          <phase>verify</phase>
          <goals>
            <goal>sign</goal>
          </goals>
          <configuration>
            <!-- See https://maven.apache.org/guides/mini/guide-encryption.html -->
            <passphraseServerId>gpg.passphrase</passphraseServerId>
            <!-- See https://stackoverflow.com/a/53992951/14731 -->
            <gpgArguments>
              <arg>--pinentry-mode</arg>
              <arg>loopback</arg>
            </gpgArguments>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

If you run into any trouble, https://central.sonatype.org/publish/publish-guide/ explains what you need to do.

Chops-off first character of every line of every character

For example if you use Bulbhead font. It is supposed to look like this:

 ____  __  __  __    ____  _   _  ____    __    ____  
(  _ \(  )(  )(  )  (  _ \( )_( )( ___)  /__\  (  _ \ 
 ) _ < )(__)(  )(__  ) _ < ) _ (  )__)  /(__)\  )(_) )
(____/(______)(____)(____/(_) (_)(____)(__)(__)(____/ 

Jfiglet produces this:

____ __  __ __   ____ _   _ ____   __   ____  
  _ \  )(  )  )    _ \ )_( ) ___) /__\    _ \ 
) _ <)(__)( )(__ ) _ <) _ ( )__) /(__)\ )(_) )
____/______)____)____/_) (_)____)__)(__)____/ 

As far as I can tell this kind of 'chopping' happens with every font (I haven't tried all of them obviously).

Slant font does not work correctly

At first, cool project, thank you!

However, I want to use the slant.flf font, but the first columns of each letter were cut off:

   ___    ____   ______   ____    ______   ______  ______   __  __   ____      __   __ __   __    __  ___   _   __  ____    ____   ____    ____   _____ ______  __  ___    ___       __  _  ___  _______
  /   |  / __ ) / ____/  / __ \  / ____/  / ____/ / ____/  / / / /  /  _/     / /  / //_/  / /   /  |/  /  / | / / / __ \  / __ \ / __ \  / __ \ / ___//_  __/ / / / / |  / / |     / / | |/ / \/ /__  /
 / /| | / __  |/ /      / / / / / __/    / /_    / / __   / /_/ /   / /  __  / /  / ,<    / /   / /|_/ /  /  |/ / / / / / / /_/ // / / / / /_/ / \__ \  / /   / / / /  | / /  | /| / /  |   / \  /  / / 
/ ___ |/ /_/ /  /___   / /_/ / / /___   / __/     /_/ /  / __  /  _/ /    /_/ /  / /| |  / /___/ /  / /  / /|  /   /_/ / / ____/  /_/ / / _, _/ ___/ / / /     /_/ /   |/ /   |/ |/ /  /   |  / /  / /__
_/  |_|_____/  ____/   _____/  _____/   _/       ____/   _/ /_/   ___/   ____/   _/ |_|  _____/_/  /_/   _/ |_/   ____/  _/      ___\_\ _/ |_|  ____/  _/     ____/   ___/   __/|__/   _/|_|  _/   ____/

          __              __        ____           __     _       _    __     __                                                       __                                          
 ____ _  / /_  _____ ____/ / ___   / __/  ____ _  / /_   (_)     (_)  / /__  / /  ____ ___   ____  ____    ____  ____ _  _____  _____ / /_ __  ___   ___      __  _  __  __  ______
/ __ `/ / __ \/ ___// __  / / _ \ / /_   / __ `/ / __ \ / /     / /  / //_/ / /  / __ `__ \ / __ \/ __ \  / __ \/ __ `/ / ___/ / ___// __// / / / | / / | /| / / | |/_/ / / / /_  /
 /_/ / / /_/ / /__   /_/ /    __// __/  / /_/ / / / / // /     / /  / ,<   / /  / / / / / // / / / /_/ / / /_/ / /_/ / / /    (__  )  /_   /_/ /  |/ /  |/ |/ / _>  <  / /_/ / / /_
__,_/  _.___/ ___/  __,_/   ___/ _/     \__, /  _/ /_/ _/   __/ /   _/|_|  _/   _/ /_/ /_/ _/ /_/ ____/ / .___/ __, /  _/     ____/  __/  __,_/  ___/  __/|__/  _/|_|  \__, /  ___/
                                        ____/               ___/                                        _/       /_/                                                   ____/       

I am using the following Java code:

System.out.println(
    FigletFont.convertOneLine(
        FigletFont.class.getClassLoader().getResourceAsStream("slant.flf"),
        "Hello World"
    )
);

ArrayIndexOutOfBoundsException some flf fonts

C:\Users\cloud\IdeaProjects\Essentials\Essential\src\main\resources\font>java -jar jfiglet.jar -f hanglg16.flf "text to
convert"
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 8481 out of bounds for length 1024
        at com.github.lalyos.jfiglet.FigletFont.<init>(FigletFont.java:153)
        at com.github.lalyos.jfiglet.FigletFont.convertOneLine(FigletFont.java:195)
        at com.github.lalyos.jfiglet.FigletFont.convertOneLine(FigletFont.java:215)
        at com.github.lalyos.jfiglet.JFiglet.main(JFiglet.java:39)

flf font link: https://github.com/cmatsuoka/figlet-fonts/tree/master/cjkfonts
all flf fonts

Slant font rendering is suboptimal

Hey there, I've tried to use the embedded Slant font, but the rendering leaves something to be desired:

Reproducible:

println(FigletFont.convertOneLine(classOf[FigletFont].getResourceAsStream("/slant.flf"), "Test"))

Expected:

  ______          __ 
 /_  __/__  _____/ /_
  / / / _ \/ ___/ __/
 / / /  __(__  ) /_  
/_/  \___/____/\__/ 

Actual:

 ______              __ 
/_  __/ ___   _____ / /_
 / /   / _ \ / ___// __/
/ /      __/(__  )  /_  
_/     ___/ ____/  __/  

I get the feeling that the borders being left out is unintentional (as you said smushing needs some coding). I wouldn't complain if this wasn't one of the two embedded fonts :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.