Skip to content

Commit

Permalink
Fixed wrong path extraction from font name
Browse files Browse the repository at this point in the history
  • Loading branch information
ColOfAbRiX committed Apr 21, 2021
1 parent 0563817 commit 83dca64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private[figlet4s] object FontFileReader {
*/
def readInternal[F[_]: Sync, A](path: String, codec: Codec)(f: (File, BufferedSource) => F[A]): F[A] = {
def is = Source.fromInputStream(this.getClass.getClassLoader.getResourceAsStream(path))(codec)
def file = new File(this.getClass.getClassLoader.getResource(path).toString())
def file = new File(this.getClass.getClassLoader.getResource(path).getPath)
Braket.withResource(tapSource(is))(f(file, _))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@
// class DebuggingSpecs extends AnyFlatSpec with Matchers with OriginalFigletTesting with Figlet4sMatchers {

// "Debugging" should "help me fixing issues" taggedAs (ManualRunTest) in {
// Figlet4s.loadFontInternal("c64/a_zooloo")
// Figlet4s.loadFontInternal("c64/star_war")

// val text = "!\"£$ABCD1234abcd[]{}"
// val text = "C&F"

// val builder =
// Figlet4s
// .builder(text)
// .withMaxWidth(250)
// .withInternalFont("c64/star_war")
// .withHorizontalLayout(HorizontalLayout.HorizontalSmushing)
// .withInternalFont("standard")
// .withHorizontalLayout(HorizontalLayout.FontDefault)
// .withPrintDirection(PrintDirection.LeftToRight)

// println("COMPUTED:")
// val computed = builder.render()
Expand Down

0 comments on commit 83dca64

Please sign in to comment.