com.aspose.barcode.generation

Class FontUnit

  • java.lang.Object
    • com.aspose.barcode.generation.FontUnit


  • public final class FontUnit
    extends java.lang.Object

    Defines a particular format for text, including font face, size, and style attributes where size in Unit value property.


      This sample shows how to create and save a BarCode image.
      
             BarCodeGenerator generator = new BarCodeGenerator(EncodeTypes.CODE_128);
             generator.getCodeTextStyle().getFont().setStyle(FontStyle.ITALIC);
             generator.getCodeTextStyle().getFont().getSize().setPoint(18);
             generator.save("test.png");
            

    • Constructor Summary

      Constructors 
      Constructor and Description
      FontUnit(java.lang.String familyName, float sizeValue, GraphicsUnit graphicsUnit, float dpi, int style) 
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method and Description
      java.lang.String getFamilyName()
      Gets or sets the face name of this Font.
      com.aspose.ms.System.Drawing.Font getFont()
      Deprecated. 
      Unit getSize()
      Gets or sets size of this FontUnit in Unit value.
      int getStateHash() 
      int getStyle()
      Gets or sets style information for this FontUnit.
      void setFamilyName(java.lang.String value)
      Gets or sets the face name of this Font.
      void setStyle(int value)
      Gets or sets style information for this FontUnit.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FontUnit

        public FontUnit(java.lang.String familyName,
                        float sizeValue,
                        GraphicsUnit graphicsUnit,
                        float dpi,
                        int style)
    • Method Detail

      • getFamilyName

        public java.lang.String getFamilyName()

        Gets or sets the face name of this Font.

      • setFamilyName

        public void setFamilyName(java.lang.String value)

        Gets or sets the face name of this Font.

      • getStyle

        public int getStyle()

        Gets or sets style information for this FontUnit.

      • setStyle

        public void setStyle(int value)

        Gets or sets style information for this FontUnit.

      • getSize

        public Unit getSize()

        Gets or sets size of this FontUnit in Unit value.

        Throws:
        java.lang.IllegalArgumentException - <p>The <b>Size</b> parameter value is less than or equal to 0.</p>
      • getFont

        @Deprecated
        public com.aspose.ms.System.Drawing.Font getFont()
        Deprecated. 
      • getStateHash

        public int getStateHash()