• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Martomate / Hexacraft / 7351367576

28 Dec 2023 06:50PM UTC coverage: 51.185% (-0.1%) from 51.312%
7351367576

push

github

Martomate
Refactor: Made Chunk not know if it has been saved to file

9 of 12 new or added lines in 2 files covered. (75.0%)

110 existing lines in 32 files now uncovered.

2829 of 5527 relevant lines covered (51.19%)

0.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.67
/game/src/main/scala/hexacraft/text/Fonts.scala
1
package hexacraft.text
2

3
import hexacraft.infra.fs.FileUtils
4
import hexacraft.renderer.TextureSingle
5
import hexacraft.text.font.{FntFile, Font, FontMetaData}
6

7
import scala.collection.mutable
8

9
object Fonts {
1✔
10
  private val fonts = mutable.HashMap.empty[String, Font]
11

1✔
12
  loadFont("Verdana", "font/Verdana")
13

1✔
UNCOV
14
  def loadFont(name: String, path: String): Font = {
×
15
    if (fonts contains name) fonts(name)
1✔
16
    else {
1✔
17
      val atlas = TextureSingle.getTexture(path).id
18

1✔
19
      val metaDataFile = FileUtils.getResourceFile(path + ".fnt").get
1✔
20
      val metaDataLines = FileUtils.readLinesFromUrl(metaDataFile)
1✔
21
      val metaData = FontMetaData.fromFntFile(FntFile.fromLines(metaDataLines))
22

1✔
23
      val f = Font(atlas, metaData)
1✔
24
      fonts(name) = f
25
      f
26
    }
27
  }
28

1✔
29
  def get(name: String): Option[Font] = fonts.get(name)
30
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc