pluginiPlugin

Add Custom Fonts

Adding custom fonts allows for more personalized text rendering for interfaces and other text elements.

Add TTF Font Files to the Font Assets Directory

First, place the .ttf font files in the font assets directory. The path is as follows:

plugins/Xerr/core/assets/font/ttf/

For example, place the pop.ttf file into the plugins/Xerr/core/assets/font/ttf/ directory.

Create the Configuration File

Next, create a configuration file named [custom].yml in the plugins/Xerr/core/assets/font/ directory to define the font settings.

The directory structure will look like this:

pop.ttf
123.yml

Edit the Configuration File

In the corresponding configuration file, set the relevant parameters for the font. Here is an example configuration:

plugins/Xerr/core/asstes/font/123.yaml
# Font unique id
xxx:
  # Font filename without extension
  ttf: pop
  # Font size
  size: 8
  # Rendering resolution. Setting a higher value can improve font clarity
  oversample: 5.0

Reload the Configuration

After completing the configuration, the plugin needs to reload the configuration file to apply the settings.

Run the following command to reload the plugin's configuration and generate the resource pack:

/xerr pack

Summary

By following the above steps, you can easily add custom fonts to the plugin and adjust font size and clarity. Remember to reload the plugin and the resource pack after modifying the configuration to ensure all changes take effect smoothly.

On this page