Skip to content

Commit

Permalink
Only return the code file for the font as a source
Browse files Browse the repository at this point in the history
  • Loading branch information
davesmith00000 committed Apr 24, 2024
1 parent 1a83a96 commit 878e501
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ object FontGen {

helper.drawFontSheet((imageOut / outImageFileName).toIO, charDetails, sheetWidth, sheetHeight, fontOptions)

Seq(
file,
imageOut / outImageFileName
)
Seq(file)
}

def sanitiseName(name: String, ext: String): String = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ class GeneratorAcceptanceTests extends munit.FunSuite {

test("Can generate font bitmap and FontInfo from TTF file") {

os.makeDir.all(targetDir / Generators.OutputDirName / "images")
val imageOutDir = targetDir / Generators.OutputDirName / "images"

os.makeDir.all(imageOutDir)

val options: FontOptions =
FontOptions("my font", 16, CharSet.Alphanumeric)
Expand All @@ -34,13 +36,13 @@ class GeneratorAcceptanceTests extends munit.FunSuite {

val files =
IndigoGenerators("com.example.test")
.embedFont("MyFont", sourceFontTTF, options, targetDir / Generators.OutputDirName / "images")
.embedFont("MyFont", sourceFontTTF, options, imageOutDir)
.toSourcePaths(targetDir)

files.toList match {
case fontInfo :: png :: Nil =>
case fontInfo :: Nil =>
assert(os.exists(fontInfo))
assert(os.exists(png))
assert(os.exists(imageOutDir / "MyFont.png"))

case _ =>
fail(
Expand Down

0 comments on commit 878e501

Please sign in to comment.