Skip to content

Resource pack syntax

replaceitem edited this page Apr 20, 2024 · 4 revisions

Since symbolchat 1.2.0 the symbol tabs and the symbol fonts can be modified using resourcepacks. This page contains information on how that works. You can also look at the data of the built in tabs and fonts for reference.

Custom symbol tabs

Creating a custom symbol tab requires creating a file in assets/[namespace]/symbol_tabs/tabname.json. The basic syntax looks like this:

{
    "icon": "πŸ™‚",
    "order": 1,
    "symbols": [
        "[namespace]:[symbols file]"
    ]
}

Possible values

  • icon Icon of the tab. If this is a single codepoint/symbol it is directly used as the icon. Otherwise it's treated as an identifier pointing to a gui sprite texture
  • order Symbol tabs are sorted in ascending order
  • type (Defaults to "symbols") When set to "kaomojis", makes the buttons in the tab occupy the whole width
  • search_bar (Defaults to false) When true, the tab has a search bar
  • symbols: The symbols list references identifiers of symbols files located in assets/[namespace]/symbols/[symbols file].txt. All symbols (more specifically, all codepoints) inside that file will be added to the tab. If the symbols consist of more than one codepoint (like for kaomojis), the file can instead be specified with a type like this:
{
    "split": "line",
    "id": "[namespace]:[symbols file]"
}

Where split can be "codepoint" (default) or "line".

Using the predefined symbol list identifiers symbol_chat:favorites and symbol-chat:custom_kaomojis will always contain the favorited symbols and custom added kaomojis from the config.

Custom symbol fonts

Fonts are defined in assets/[namespace]/symbol_fonts with the following format:

{
    "order": 220,
    "mappings": {
        ...
    }
}

order defines the sorting in the font dropdown.

mappings defines the key value pairs how characters will be changed. This can have different formats:

  • Single codepoint mapping, either with string or a codepoint integer on the right side:
{
    "A": "𝙰",
    "B": 120433, // Decimal of hex 1D671 which is the codepoint number of 𝙱
    "W": "VV" // Mapping single codepoint V to conver to multiple
}
  • Multiple codepoints in two strings (Must have same codepoint length)
{
    "ABCDEFGHIJKLMNOPQRSTUVWXYZ": "π™°π™±π™²π™³π™΄π™΅π™Άπ™·π™Έπ™Ήπ™Ίπ™»π™Όπ™½π™Ύπ™Ώπš€πšπš‚πšƒπš„πš…πš†πš‡πšˆπš‰"
}
  • Codepoint range (At least one side has to have a defined length, the other side can be open ended)
{
    "A..Z": "𝙰..", // Left side defines length
    "a..": "𝚊..𝚣", // Right side defines length
    "0..9": "𝟢..𝟿", // Both sides define length (must match)
    "0..": "𝟢𝟷𝟸𝟹𝟺𝟻𝟼𝟽𝟾𝟿", // Also possible
    "0123456789": "𝟢..𝟿" // Works too
}
  • List
{
    "0..9": ["zero","one","two","three","four","five","six","seven","eight","nine"]
}

Clone this wiki locally