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(FontUnit source) 
      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 the face name of this Font.
      com.aspose.ms.System.Drawing.Font getFont()
      Deprecated. 
      Unit getSize()
      Gets size of this FontUnit in Unit value.
      int getStateHash() 
      int getStyle()
      Gets style information for this FontUnit.
      void setFamilyName(java.lang.String value)
      Sets the face name of this Font.
      void setStyle(int value)
      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(FontUnit source)
      • FontUnit

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

      • getFamilyName

        public java.lang.String getFamilyName()

        Gets the face name of this Font.

      • setFamilyName

        public void setFamilyName(java.lang.String value)

        Sets the face name of this Font.

      • getStyle

        public int getStyle()

        Gets style information for this FontUnit.

      • setStyle

        public void setStyle(int value)

        Sets style information for this FontUnit.

      • getSize

        public Unit getSize()

        Gets 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()