Browse Source

Add support for fnt bitmap font files

John Cheesman 8 years ago
parent
commit
03aea77c8a
2 changed files with 5 additions and 1 deletions
  1. 3 0
      README.md
  2. 2 1
      cargo.lua

+ 3 - 0
README.md

@@ -93,9 +93,12 @@ Here is a list of default loaders used:
 | ogg       | `love.audio.newSource`    |
 | wav       | `love.audio.newSource`    |
 | txt       | `love.filesystem.read`    |
+| fnt       | `love.graphics.newFont`   |
 
 The loader for `.ttf` and `.otf` files is special. Instead of directly returning an asset, this loader returns a function that accepts a size for the font and returns a new font with the specified size.
 
+The loader for `.fnt` files requires the image file path to be set in the file as it won't be passed to [https://love2d.org/wiki/love.graphics.newFont#Function_3](love.graphics.newFont).
+
 To have cargo ignore files with a certain extension, specify `false` as the loader.
 
 ### Processors

+ 2 - 1
cargo.lua

@@ -34,7 +34,8 @@ cargo.loaders = {
   wav = la and la.newSource,
   txt = lf and lf.read,
   ttf = lg and makeFont,
-  otf = lg and makeFont
+  otf = lg and makeFont,
+  fnt = lg and lg.newFont
 }
 
 cargo.processors = {}