Class DXFStyle

  • All Implemented Interfaces:
    DXFObject

    public class DXFStyle
    extends DXFTableRecord
    Class representing a text style for use in a DXF document. Encapsulates text parameters (font, style), and associates an arbitrary "name" for use in text entities which use that style. Unfortunately, some programs (e.g. LibreCAD) use the "name" - group code 2 - as the name of the font file, skipping the style table. Thus we use the font file name (group code 3) as the "name" (group code 2) to accommodate those programs skipping the style table. Grrr....
    Author:
    jsevy
    • Constructor Summary

      Constructors 
      Constructor Description
      DXFStyle​(java.awt.Font font)
      Create a style object corresponding to the supplied Java typeface object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object otherStyle)
      Equals method for use in determining if a Style is already present; overrides Object equals method.
      java.lang.String getStyleName()
      Get the name for this style object, for use within a DXFText entity.
      java.lang.String toDXFString()
      Implementation of DXFObject interface method; creates DXF text representing the text style.
      • Methods inherited from class java.lang.Object

        getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DXFStyle

        public DXFStyle​(java.awt.Font font)
        Create a style object corresponding to the supplied Java typeface object.
        Parameters:
        font - Font whose parameters (size, style, typeface) should be represented in the style object
    • Method Detail

      • toDXFString

        public java.lang.String toDXFString()
        Implementation of DXFObject interface method; creates DXF text representing the text style.
        Specified by:
        toDXFString in interface DXFObject
        Overrides:
        toDXFString in class DXFTableRecord
      • equals

        public boolean equals​(java.lang.Object otherStyle)
        Equals method for use in determining if a Style is already present; overrides Object equals method.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        otherStyle - Another style representing a font
        Returns:
        True if the associated Android fonts used to create the styles are equal
      • getStyleName

        public java.lang.String getStyleName()
        Get the name for this style object, for use within a DXFText entity.
        Returns:
        identifier for this Style