Browse Source

Mention BMFont is supported;

bjorn 9 months ago
parent
commit
6855474a63
4 changed files with 27 additions and 27 deletions
  1. 12 12
      api/init.lua
  2. 4 3
      api/lovr/data/newRasterizer.lua
  3. 5 6
      api/lovr/graphics/Font/init.lua
  4. 6 6
      api/lovr/graphics/newFont.lua

+ 12 - 12
api/init.lua

@@ -3682,7 +3682,7 @@ return {
         {
           name = "newRasterizer",
           summary = "Create a new Rasterizer.",
-          description = "Creates a new Rasterizer from a TTF file.",
+          description = "Creates a new Rasterizer from a TTF or BMFont file.",
           key = "lovr.data.newRasterizer",
           module = "lovr.data",
           variants = {
@@ -3692,7 +3692,7 @@ return {
                 {
                   name = "size",
                   type = "number",
-                  description = "The resolution to render the fonts at, in pixels.  Higher resolutions use more memory and processing power but may provide better quality results for some fonts/situations.",
+                  description = "The resolution to render the font at, in pixels (TTF only).  Higher resolutions use more memory and processing power but may provide better quality results for some fonts/situations.",
                   default = "32"
                 }
               },
@@ -3714,7 +3714,7 @@ return {
                 {
                   name = "size",
                   type = "number",
-                  description = "The resolution to render the fonts at, in pixels.  Higher resolutions use more memory and processing power but may provide better quality results for some fonts/situations.",
+                  description = "The resolution to render the font at, in pixels (TTF only).  Higher resolutions use more memory and processing power but may provide better quality results for some fonts/situations.",
                   default = "32"
                 }
               },
@@ -3736,7 +3736,7 @@ return {
                 {
                   name = "size",
                   type = "number",
-                  description = "The resolution to render the fonts at, in pixels.  Higher resolutions use more memory and processing power but may provide better quality results for some fonts/situations.",
+                  description = "The resolution to render the font at, in pixels (TTF only).  Higher resolutions use more memory and processing power but may provide better quality results for some fonts/situations.",
                   default = "32"
                 }
               },
@@ -12149,17 +12149,17 @@ return {
           },
           variants = {
             {
-              description = "Creates a new Font from a TTF file.",
+              description = "Creates a new Font from a font file.",
               arguments = {
                 {
                   name = "filename",
                   type = "string",
-                  description = "A path to a TTF file."
+                  description = "A path to a TTF or BMFont file."
                 },
                 {
                   name = "size",
                   type = "number",
-                  description = "The size of the Font in pixels.  Larger sizes are slower to initialize and use more memory, but have better quality.",
+                  description = "The size of the Font in pixels (TTF only).  Larger sizes are slower to initialize and use more memory, but have better quality.",
                   default = "32"
                 },
                 {
@@ -12178,17 +12178,17 @@ return {
               }
             },
             {
-              description = "Creates a new Font from TTF data.",
+              description = "Creates a new Font from font data.",
               arguments = {
                 {
                   name = "blob",
                   type = "Blob",
-                  description = "A Blob containing TTF file data."
+                  description = "A Blob containing TTF or BMFont file data."
                 },
                 {
                   name = "size",
                   type = "number",
-                  description = "The size of the Font in pixels.  Larger sizes are slower to initialize and use more memory, but have better quality.",
+                  description = "The size of the Font in pixels (TTF only).  Larger sizes are slower to initialize and use more memory, but have better quality.",
                   default = "32"
                 },
                 {
@@ -12212,7 +12212,7 @@ return {
                 {
                   name = "size",
                   type = "number",
-                  description = "The size of the Font in pixels.  Larger sizes are slower to initialize and use more memory, but have better quality.",
+                  description = "The size of the Font in pixels (TTF only).  Larger sizes are slower to initialize and use more memory, but have better quality.",
                   default = "32"
                 },
                 {
@@ -14141,7 +14141,7 @@ return {
         {
           name = "Font",
           summary = "A Font used to render text.",
-          description = "Font objects are used to render text with `Pass:text`.  The active font can be changed using `Pass:setFont`.  The default font is Varela Round, which is used when no font is active, and can be retrieved using `lovr.graphics.getDefaultFont`.  Custom fonts can be loaded from TTF files using `lovr.graphics.newFont`.\n\nEach Font uses a `Rasterizer` to load the TTF file and create images for each glyph. As text is drawn, the Font uploads images from the Rasterizer to a GPU texture atlas as needed.  The Font also performs text layout and mesh generation for strings of text.\n\nLÖVR uses a text rendering technique called \"multichannel signed distance fields\" (MSDF), which makes the font rendering remain crisp when text is viewed up close.",
+          description = "Font objects are used to render text with `Pass:text`.  The active font can be changed using `Pass:setFont`.  The default font is Varela Round, which is used when no font is active, and can be retrieved using `lovr.graphics.getDefaultFont`.  Custom fonts can be loaded from TTF and BMFont files using `lovr.graphics.newFont`.\n\nEach Font uses a `Rasterizer` to load the font and create images for each glyph. As text is drawn, the Font uploads images from the Rasterizer to a GPU texture atlas as needed.  The Font also performs text layout and mesh generation for strings of text.\n\nFor TTF fonts, LÖVR uses a text rendering technique called \"multichannel signed distance fields\" (MSDF), which makes the font rendering remain crisp when text is viewed up close.",
           key = "Font",
           module = "lovr.graphics",
           constructors = {

+ 4 - 3
api/lovr/data/newRasterizer.lua

@@ -1,6 +1,6 @@
 return {
   summary = 'Create a new Rasterizer.',
-  description = 'Creates a new Rasterizer from a TTF file.',
+  description = 'Creates a new Rasterizer from a TTF or BMFont file.',
   arguments = {
     filename = {
       type = 'string',
@@ -14,8 +14,9 @@ return {
       type = 'number',
       default = '32',
       description = [[
-        The resolution to render the fonts at, in pixels.  Higher resolutions use more memory and
-        processing power but may provide better quality results for some fonts/situations.
+        The resolution to render the font at, in pixels (TTF only).  Higher resolutions use more
+        memory and processing power but may provide better quality results for some
+        fonts/situations.
       ]]
     }
   },

+ 5 - 6
api/lovr/graphics/Font/init.lua

@@ -3,16 +3,15 @@ return {
   description = [[
     Font objects are used to render text with `Pass:text`.  The active font can be changed using
     `Pass:setFont`.  The default font is Varela Round, which is used when no font is active, and can
-    be retrieved using `lovr.graphics.getDefaultFont`.  Custom fonts can be loaded from TTF files
-    using `lovr.graphics.newFont`.
+    be retrieved using `lovr.graphics.getDefaultFont`.  Custom fonts can be loaded from TTF and
+    BMFont files using `lovr.graphics.newFont`.
 
-    Each Font uses a `Rasterizer` to load the TTF file and create images for each glyph. As text is
+    Each Font uses a `Rasterizer` to load the font and create images for each glyph. As text is
     drawn, the Font uploads images from the Rasterizer to a GPU texture atlas as needed.  The Font
     also performs text layout and mesh generation for strings of text.
 
-    LÖVR uses a text rendering technique called "multichannel signed distance fields" (MSDF), which
-    makes the font rendering remain crisp when text is viewed up close.
-
+    For TTF fonts, LÖVR uses a text rendering technique called "multichannel signed distance fields"
+    (MSDF), which makes the font rendering remain crisp when text is viewed up close.
   ]],
   constructors = {
     'lovr.graphics.newFont',

+ 6 - 6
api/lovr/graphics/newFont.lua

@@ -5,11 +5,11 @@ return {
   arguments = {
     filename = {
       type = 'string',
-      description = 'A path to a TTF file.'
+      description = 'A path to a TTF or BMFont file.'
     },
     blob = {
       type = 'Blob',
-      description = 'A Blob containing TTF file data.'
+      description = 'A Blob containing TTF or BMFont file data.'
     },
     rasterizer = {
       type = 'Rasterizer',
@@ -19,8 +19,8 @@ return {
       type = 'number',
       default = '32',
       description = [[
-        The size of the Font in pixels.  Larger sizes are slower to initialize and use more memory,
-        but have better quality.
+        The size of the Font in pixels (TTF only).  Larger sizes are slower to initialize and use
+        more memory, but have better quality.
       ]]
     },
     spread = {
@@ -42,12 +42,12 @@ return {
   },
   variants = {
     {
-      description = 'Creates a new Font from a TTF file.',
+      description = 'Creates a new Font from a font file.',
       arguments = { 'filename', 'size', 'spread' },
       returns = { 'font' }
     },
     {
-      description = 'Creates a new Font from TTF data.',
+      description = 'Creates a new Font from font data.',
       arguments = { 'blob', 'size', 'spread' },
       returns = { 'font' }
     },