You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you so much for fixing #20. Internal font loading works correctly when using "/" path separator (i.e. "c64/platoon2"), however the internal font list still returns paths with the windows path separator (\).
Configuration
OS type and version: Windows 10 21H1
JVM type and version: 11.0.13
Scala version: 2.12.13
Figlet4s version: 0.3.1
Needless to say, using C64 fonts from the internal lists as-is fails:
val text = "hello, world!"
val font = Figlet4s.internalFonts.find(_.startsWith("c64")).get
println(font)
val banner = Figlet4s.builder(text).withInternalFont(font).render().asString()
This fails witth:
[info] running Test
c64\1943____
[error] (run-main-d) com.colofabrix.scala.figlet4s.errors$FigletLoadingError
[error] com.colofabrix.scala.figlet4s.errors$FigletLoadingError
[error] at com.colofabrix.scala.figlet4s.errors$FigletLoadingError$.apply(errors.scala:69)
[error] at com.colofabrix.scala.figlet4s.core.Braket$.withResource(Braket.scala:28)
[error] at com.colofabrix.scala.figlet4s.core.FontFileReader$.readInternal(FontFileReader.scala:27)
[error] at com.colofabrix.scala.figlet4s.core.Figlet4sClient$.$anonfun$loadFontInternal$2(Figlet4sClient.scala:48)
[error] at cats.package$$anon$1.flatMap(package.scala:73)
[error] at com.colofabrix.scala.figlet4s.unsafe.package$$anon$1.flatMap(package.scala:69)
[error] at cats.FlatMap$Ops.flatMap(FlatMap.scala:229)
[error] at cats.FlatMap$Ops.flatMap$(FlatMap.scala:229)
[error] at cats.FlatMap$ToFlatMapOps$$anon$2.flatMap(FlatMap.scala:243)
[error] at com.colofabrix.scala.figlet4s.core.Figlet4sClient$.$anonfun$loadFontInternal$1(Figlet4sClient.scala:47)
[error] at cats.package$$anon$1.flatMap(package.scala:73)
[error] at com.colofabrix.scala.figlet4s.unsafe.package$$anon$1.flatMap(package.scala:69)
[error] at cats.FlatMap$Ops.flatMap(FlatMap.scala:229)
[error] at cats.FlatMap$Ops.flatMap$(FlatMap.scala:229)
[error] at cats.FlatMap$ToFlatMapOps$$anon$2.flatMap(FlatMap.scala:243)
[error] at com.colofabrix.scala.figlet4s.core.Figlet4sClient$.loadFontInternal(Figlet4sClient.scala:46)
[error] at com.colofabrix.scala.figlet4s.options.OptionsBuilder$$anonfun$compileFonts$1.applyOrElse(OptionsBuilder.scala:245)
[error] at com.colofabrix.scala.figlet4s.options.OptionsBuilder$$anonfun$compileFonts$1.applyOrElse(OptionsBuilder.scala:225)
[error] at scala.PartialFunction$OrElse.apply(PartialFunction.scala:172)
[error] at scala.Function$.$anonfun$untupled$1(Function.scala:110)
[error] at cats.instances.ListInstances$$anon$1.step$1(list.scala:153)
[error] at cats.instances.ListInstances$$anon$1.$anonfun$foldM$2(list.scala:158)
[error] at cats.package$$anon$1.tailRecM(package.scala:76)
[error] at com.colofabrix.scala.figlet4s.unsafe.package$$anon$1.tailRecM(package.scala:72)
[error] at cats.instances.ListInstances$$anon$1.foldM(list.scala:158)
[error] at cats.instances.ListInstances$$anon$1.foldM(list.scala:17)
[error] at cats.Foldable$Ops.foldM(Foldable.scala:975)
[error] at cats.Foldable$Ops.foldM$(Foldable.scala:974)
[error] at cats.Foldable$ToFoldableOps$$anon$6.foldM(Foldable.scala:1008)
[error] at com.colofabrix.scala.figlet4s.options.OptionsBuilder$.compile(OptionsBuilder.scala:206)
[error] at com.colofabrix.scala.figlet4s.options.OptionsBuilder.compile(OptionsBuilder.scala:163)
[error] at com.colofabrix.scala.figlet4s.unsafe.OptionsBuilderMixin$OptionsBuilderOps.buildOptions$lzycompute(OptionsBuilderMixin.scala:15)
[error] at com.colofabrix.scala.figlet4s.unsafe.OptionsBuilderMixin$OptionsBuilderOps.buildOptions(OptionsBuilderMixin.scala:15)
[error] at com.colofabrix.scala.figlet4s.unsafe.OptionsBuilderMixin$OptionsBuilderOps.render(OptionsBuilderMixin.scala:32)
[error] at Test$.delayedEndpoint$Test$1(Test.scala:27)
[error] at Test$delayedInit$body.apply(Test.scala:8)
[error] at scala.Function0.apply$mcV$sp(Function0.scala:39)
[error] at scala.Function0.apply$mcV$sp$(Function0.scala:39)
[error] at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
[error] at scala.App.$anonfun$main$1$adapted(App.scala:80)
[error] at scala.collection.immutable.List.foreach(List.scala:431)
[error] at scala.App.main(App.scala:80)
[error] at scala.App.main$(App.scala:78)
[error] at Test$.main(Test.scala:8)
[error] at Test.main(Test.scala)
[error] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[error] Caused by: java.lang.NullPointerException
[error] at java.base/java.io.Reader.<init>(Reader.java:167)
[error] at java.base/java.io.InputStreamReader.<init>(InputStreamReader.java:125)
[error] at scala.io.BufferedSource.reader(BufferedSource.scala:26)
[error] at scala.io.BufferedSource.bufferedReader(BufferedSource.scala:27)
[error] at com.colofabrix.scala.figlet4s.core.FontFileReader$.tapSource(FontFileReader.scala:43)
[error] at com.colofabrix.scala.figlet4s.core.FontFileReader$.$anonfun$readInternal$1(FontFileReader.scala:27)
[error] at com.colofabrix.scala.figlet4s.core.Braket$.withResource(Braket.scala:24)
[error] at com.colofabrix.scala.figlet4s.core.FontFileReader$.readInternal(FontFileReader.scala:27)
[error] at com.colofabrix.scala.figlet4s.core.Figlet4sClient$.$anonfun$loadFontInternal$2(Figlet4sClient.scala:48)
[error] at cats.package$$anon$1.flatMap(package.scala:73)
[error] at com.colofabrix.scala.figlet4s.unsafe.package$$anon$1.flatMap(package.scala:69)
[error] at cats.FlatMap$Ops.flatMap(FlatMap.scala:229)
[error] at cats.FlatMap$Ops.flatMap$(FlatMap.scala:229)
[error] at cats.FlatMap$ToFlatMapOps$$anon$2.flatMap(FlatMap.scala:243)
[error] at com.colofabrix.scala.figlet4s.core.Figlet4sClient$.$anonfun$loadFontInternal$1(Figlet4sClient.scala:47)
[error] at cats.package$$anon$1.flatMap(package.scala:73)
[error] at com.colofabrix.scala.figlet4s.unsafe.package$$anon$1.flatMap(package.scala:69)
[error] at cats.FlatMap$Ops.flatMap(FlatMap.scala:229)
[error] at cats.FlatMap$Ops.flatMap$(FlatMap.scala:229)
[error] at cats.FlatMap$ToFlatMapOps$$anon$2.flatMap(FlatMap.scala:243)
[error] at com.colofabrix.scala.figlet4s.core.Figlet4sClient$.loadFontInternal(Figlet4sClient.scala:46)
[error] at com.colofabrix.scala.figlet4s.options.OptionsBuilder$$anonfun$compileFonts$1.applyOrElse(OptionsBuilder.scala:245)
[error] at com.colofabrix.scala.figlet4s.options.OptionsBuilder$$anonfun$compileFonts$1.applyOrElse(OptionsBuilder.scala:225)
[error] at scala.PartialFunction$OrElse.apply(PartialFunction.scala:172)
[error] at scala.Function$.$anonfun$untupled$1(Function.scala:110)
[error] at cats.instances.ListInstances$$anon$1.step$1(list.scala:153)
[error] at cats.instances.ListInstances$$anon$1.$anonfun$foldM$2(list.scala:158)
[error] at cats.package$$anon$1.tailRecM(package.scala:76)
[error] at com.colofabrix.scala.figlet4s.unsafe.package$$anon$1.tailRecM(package.scala:72)
[error] at cats.instances.ListInstances$$anon$1.foldM(list.scala:158)
[error] at cats.instances.ListInstances$$anon$1.foldM(list.scala:17)
[error] at cats.Foldable$Ops.foldM(Foldable.scala:975)
[error] at cats.Foldable$Ops.foldM$(Foldable.scala:974)
[error] at cats.Foldable$ToFoldableOps$$anon$6.foldM(Foldable.scala:1008)
[error] at com.colofabrix.scala.figlet4s.options.OptionsBuilder$.compile(OptionsBuilder.scala:206)
[error] at com.colofabrix.scala.figlet4s.options.OptionsBuilder.compile(OptionsBuilder.scala:163)
[error] at com.colofabrix.scala.figlet4s.unsafe.OptionsBuilderMixin$OptionsBuilderOps.buildOptions$lzycompute(OptionsBuilderMixin.scala:15)
[error] at com.colofabrix.scala.figlet4s.unsafe.OptionsBuilderMixin$OptionsBuilderOps.buildOptions(OptionsBuilderMixin.scala:15)
[error] at com.colofabrix.scala.figlet4s.unsafe.OptionsBuilderMixin$OptionsBuilderOps.render(OptionsBuilderMixin.scala:32)
[error] at Test$.delayedEndpoint$Test$1(Test.scala:27)
[error] at Test$delayedInit$body.apply(Test.scala:8)
[error] at scala.Function0.apply$mcV$sp(Function0.scala:39)
[error] at scala.Function0.apply$mcV$sp$(Function0.scala:39)
[error] at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
[error] at scala.App.$anonfun$main$1$adapted(App.scala:80)
[error] at scala.collection.immutable.List.foreach(List.scala:431)
[error] at scala.App.main(App.scala:80)
[error] at scala.App.main$(App.scala:78)
[error] at Test$.main(Test.scala:8)
[error] at Test.main(Test.scala)
[error] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
Notes
As I wrote in #20, resources always use / path separator, regardless of the OS path separators, thus treating resource paths as Path object is little erroneous. At the very list you'll want to do something like this in the end: .replaceAll(File.pathSeparator, "/").
The text was updated successfully, but these errors were encountered:
In the previous release, I ran all tests under Windows and they all passed. That case is not covered (which is weird, I test internal fonts loading) or something else happend.
Thank you so much for fixing #20. Internal font loading works correctly when using "/" path separator (i.e.
"c64/platoon2"
), however the internal font list still returns paths with the windows path separator (\
).Configuration
OS type and version: Windows 10 21H1
JVM type and version: 11.0.13
Scala version: 2.12.13
Figlet4s version: 0.3.1
Steps
Problem
Needless to say, using C64 fonts from the internal lists as-is fails:
This fails witth:
Notes
As I wrote in #20, resources always use
/
path separator, regardless of the OS path separators, thus treating resource paths as Path object is little erroneous. At the very list you'll want to do something like this in the end:.replaceAll(File.pathSeparator, "/")
.The text was updated successfully, but these errors were encountered: