Fonts JSON Schema - HB-Hridoy/th-m-l-t GitHub Wiki

📦 JSON Font Configuration

{
  "ProjectName": "t4",
  "Author": "hridoy",
  "Version": "1.0",
  "Fonts": {
    "f1": "f1.ttf",
    "title": "titleFont.otf",
    "caps": "caps.TTF"
  }
}

✅ Required Fields

  • Top-level Fonts object is mandatory.

  • Each entry inside Fonts must follow:

    • Key → A font tag (used as a reference)
    • Value → The font file name

📌 Font Tag Rules (Keys of Fonts)

  • ✅ Must match: [a-zA-Z_][a-zA-Z0-9_]{0,31}

    • Starts with a letter or underscore
    • Allows letters, digits, and underscores
    • Max length: 32 characters
  • ❌ Cannot use reserved tags:

    • default
    • null
    • thmlt
  • ❌ Duplicates are not allowed

If invalid, the tag will be renamed automatically (e.g., f1, f2, etc.)


📁 Font File Name Rules (Values of Fonts)

  • Must be a valid string ending in:

    • .ttf
    • .otf
  • ✅ File extension is case-insensitive

  • ❌ Other formats like .woff, .svg, etc. are not supported

  • ✅ Duplicates allowed if needed


❌ Invalid Example

{
  "Fonts": {
    "default": "MyFont.woff",
    "123": "notAFont.ttf",
    "long-tag-name-that-is-way-too-long-for-the-spec": "a.otf"
  }
}

Will be auto-corrected to:

{
  "Fonts": {
    "f1": "default.ttf",
    "f2": "notAFont.ttf",
    "f3": "a.otf"
  }
}

✅ Best Practices

  • Use meaningful and short font tags ("body", "h1", "logo", etc.)
  • Keep font file names consistent with your assets
  • Avoid using reserved keywords or numeric-only tags