程序包 org.bukkit.map

# 类 MapFont

java.lang.Object
org.bukkit.map.MapFont

直接已知子类:
  `MinecraftFont`

public class MapFont extends Object
Represents a bitmap font drawable to a map.

- ## 嵌套类概要

  嵌套类
  修饰符和类型
  类
  说明
  `static class`
  `MapFont.CharacterSprite`
  Represents the graphics for a single character in a MapFont.

- ## 字段概要

  字段
  修饰符和类型
  字段
  说明
  `protected boolean`
  `malleable`

- ## 构造器概要

  构造器
  构造器
  说明
  `MapFont()`

- ## 方法概要

  修饰符和类型
  方法
  说明
  `@Nullable MapFont.CharacterSprite`
  `getChar(char ch)`
  Get the sprite for a given character.
  `int`
  `getHeight()`
  Get the height of this font.
  `int`
  `getWidth(@NotNull String text)`
  Get the width of the given text as it would be rendered using this font.
  `boolean`
  `isValid(@NotNull String text)`
  Check whether the given text is valid.
  `void`
  `setChar(char ch, @NotNull MapFont.CharacterSprite sprite)`
  Set the sprite for a given character.

  ### 从类继承的方法 java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 字段详细资料

  - ### malleable

    protected boolean malleable

- ## 构造器详细资料

  - ### MapFont

    public MapFont()

- ## 方法详细资料

  - ### setChar

    public void setChar(char ch, @NotNull @NotNull MapFont.CharacterSprite sprite)
    Set the sprite for a given character.
    参数:
      `ch` - The character to set the sprite for.
      `sprite` - The CharacterSprite to set.
    抛出:
      `IllegalStateException` - if this font is static.

  - ### getChar

    @Nullable public @Nullable MapFont.CharacterSprite getChar(char ch)
    Get the sprite for a given character.
    参数:
      `ch` - The character to get the sprite for.
    返回:
      The CharacterSprite associated with the character, or null if there is none.

  - ### getWidth

    public int getWidth(@NotNull @NotNull String text)
    Get the width of the given text as it would be rendered using this font.
    参数:
      `text` - The text.
    返回:
      The width in pixels.

  - ### getHeight

    public int getHeight()
    Get the height of this font.
    返回:
      The height of the font.

  - ### isValid

    public boolean isValid(@NotNull @NotNull String text)
    Check whether the given text is valid.
    参数:
      `text` - The text.
    返回:
      True if the string contains only defined characters, false otherwise.