Enum Class StandardFont

java.lang.Object
java.lang.Enum<StandardFont>
cloud.opencode.base.pdf.font.StandardFont
All Implemented Interfaces:
PdfFont, Serializable, Comparable<StandardFont>, Constable

public enum StandardFont extends Enum<StandardFont> implements PdfFont
Standard PDF Fonts - The 14 standard Type 1 fonts 标准 PDF 字体 - 14 种标准 Type 1 字体

These fonts are guaranteed to be available in all PDF viewers.

这些字体保证在所有 PDF 阅读器中可用。

Features | 主要功能:

  • Helvetica, Times, and Courier font families - Helvetica、Times 和 Courier 字体族
  • Bold, italic, and bold-italic variants - 粗体、斜体和粗斜体变体
  • Symbol and ZapfDingbats fonts - Symbol 和 ZapfDingbats 字体
  • Family and style query methods - 字体族和样式查询方法

Usage Examples | 使用示例:

StandardFont font = StandardFont.HELVETICA_BOLD;
boolean bold = font.isBold();       // true
boolean mono = font.isMonospace();   // false
String name = font.getPdfName();     // "Helvetica-Bold"

Security | 安全性:

  • Thread-safe: Yes — immutable enum - 线程安全: 是 — 不可变枚举
  • Null-safe: N/A — enum values are never null - 空值安全: 不适用 — 枚举值不会为空
Since:
JDK 25, opencode-base-pdf V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Enum Constant Details

    • HELVETICA

      public static final StandardFont HELVETICA
      Helvetica (sans-serif) | Helvetica(无衬线)
    • HELVETICA_BOLD

      public static final StandardFont HELVETICA_BOLD
      Helvetica Bold | Helvetica 粗体
    • HELVETICA_OBLIQUE

      public static final StandardFont HELVETICA_OBLIQUE
      Helvetica Oblique (Italic) | Helvetica 斜体
    • HELVETICA_BOLD_OBLIQUE

      public static final StandardFont HELVETICA_BOLD_OBLIQUE
      Helvetica Bold Oblique | Helvetica 粗斜体
    • TIMES_ROMAN

      public static final StandardFont TIMES_ROMAN
      Times Roman (serif) | Times Roman(衬线)
    • TIMES_BOLD

      public static final StandardFont TIMES_BOLD
      Times Bold | Times 粗体
    • TIMES_ITALIC

      public static final StandardFont TIMES_ITALIC
      Times Italic | Times 斜体
    • TIMES_BOLD_ITALIC

      public static final StandardFont TIMES_BOLD_ITALIC
      Times Bold Italic | Times 粗斜体
    • COURIER

      public static final StandardFont COURIER
      Courier (monospace) | Courier(等宽)
    • COURIER_BOLD

      public static final StandardFont COURIER_BOLD
      Courier Bold | Courier 粗体
    • COURIER_OBLIQUE

      public static final StandardFont COURIER_OBLIQUE
      Courier Oblique | Courier 斜体
    • COURIER_BOLD_OBLIQUE

      public static final StandardFont COURIER_BOLD_OBLIQUE
      Courier Bold Oblique | Courier 粗斜体
    • SYMBOL

      public static final StandardFont SYMBOL
      Symbol font | Symbol 字体
    • ZAPF_DINGBATS

      public static final StandardFont ZAPF_DINGBATS
      ZapfDingbats font | ZapfDingbats 字体
  • Method Details

    • values

      public static StandardFont[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static StandardFont valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getName

      public String getName()
      Description copied from interface: PdfFont
      Gets font name 获取字体名称
      Specified by:
      getName in interface PdfFont
      Returns:
      font name | 字体名称
    • getPdfName

      public String getPdfName()
      Description copied from interface: PdfFont
      Gets PDF font name (internal name) 获取 PDF 字体名称(内部名称)
      Specified by:
      getPdfName in interface PdfFont
      Returns:
      PDF internal name | PDF 内部名称
    • isEmbedded

      public boolean isEmbedded()
      Description copied from interface: PdfFont
      Checks if font is embedded 检查字体是否嵌入
      Specified by:
      isEmbedded in interface PdfFont
      Returns:
      true if embedded | 如果嵌入返回 true
    • isHelvetica

      public boolean isHelvetica()
      Checks if this is a Helvetica variant 检查是否为 Helvetica 变体
      Returns:
      true if Helvetica family | 如果是 Helvetica 系列返回 true
    • isTimes

      public boolean isTimes()
      Checks if this is a Times variant 检查是否为 Times 变体
      Returns:
      true if Times family | 如果是 Times 系列返回 true
    • isCourier

      public boolean isCourier()
      Checks if this is a Courier variant 检查是否为 Courier 变体
      Returns:
      true if Courier family | 如果是 Courier 系列返回 true
    • isMonospace

      public boolean isMonospace()
      Checks if this is a monospace font 检查是否为等宽字体
      Returns:
      true if monospace | 如果是等宽字体返回 true
    • isBold

      public boolean isBold()
      Checks if this is a bold variant 检查是否为粗体变体
      Returns:
      true if bold | 如果是粗体返回 true
    • isItalic

      public boolean isItalic()
      Checks if this is an italic/oblique variant 检查是否为斜体变体
      Returns:
      true if italic | 如果是斜体返回 true