Text+
DevForum Topic
  • Welcome
  • Installation
  • Fundamentals
    • Introduction
    • Line breaks
    • Customization
      • Fonts
      • Scale-size
      • Truncation
    • Modification
    • Text bounds
  • Fine-control
    • Introduction
    • Full iteration
  • Specific indexing and iteration
  • Transform and style
  • Custom fonts
    • Introduction
    • Font to XML
    • XML to Lua
    • Upload font image
    • Import to Text+
Powered by GitBook
On this page
  1. Custom fonts

Import to Text+

Locate the TextPlus module in your explorer. Open the CustomFonts module located inside of it.

Add your font like this:

return {
	MyFont = -- Paste converted XML here.
}

Add your image id for the font in the same table as the Size and Characters, like this:

MyFont = {
	Image = 0, -- Image id.
	-- Converted XML:
	Size = 32,
	Characters = {
		
	}
}

For fonts that have multiple weights and/or styles, it's recommended to use the following format:

return {
	-- Fonts.
	MyFont = {
		-- Weights.
		Bold = {
			-- Styles.
			Italic = {
				Image = 0, -- Image id.
				-- Converted XML:
				Size = 32,
				Characters = {
					
				}
			}
		}
	}
}

Use the custom font

Using custom fonts is extremely simple.

Instead of providing a Font object, directly reference the custom font table like this:

TextPlus.Create(
	frame,
	"Text",
	{
		Font = TextPlus.CustomFonts.MyFont
	}
)

Don't require the fonts module. Simply require the TextPlus module; the custom fonts table will be accessible from there.

PreviousUpload font image

Last updated 6 days ago