[]
        
(Showing Draft Content)

IFontOption

Interface IFontOption

All Known Subinterfaces:
ICodabar, ICode128, ICode39, ICode49, ICode93, IEAN13, IEAN8, IGS1128

public interface IFontOption
Represents font options for barcode label text.

This interface defines the font-related options exposed by barcode objects that support label text, including font family, style, weight, text decoration, alignment, and size. It is typically used together with IBarcode and ILabelOption on barcode values returned by barcode formulas.


 worksheet.getRange("A1").setValue("123456789");
 worksheet.getRange("B1").setFormula(
         "=BC_CODE128(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",true,\"bottom\","
                 + "\"auto\",\"Arial\",\"italic\",\"bold\",\"underline\",\"left\",14,10,10,0,0)");
 IFontOption fontOption = (IFontOption) worksheet.getRange("B1").getValue();
 String fontFamily = fontOption.getFontFamily();
 String fontStyle = fontOption.getFontStyle();
 String fontWeight = fontOption.getFontWeight();
 String fontTextDecoration = fontOption.getFontTextDecoration();
 String fontTextAlign = fontOption.getFontTextAlign();
 int fontSize = fontOption.getFontSize();
 
  • Method Details

    • getFontFamily

      String getFontFamily()
      Gets the font family of barcode label text.

      The default value is "sans-serif".

      
       worksheet.getRange("A1").setValue("123456789");
       worksheet.getRange("B1").setFormula(
               "=BC_CODE128(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",true,\"bottom\","
                       + "\"auto\",\"Arial\",\"italic\",\"bold\",\"underline\",\"left\",14,10,10,0,0)");
       IFontOption fontOption = (IFontOption) worksheet.getRange("B1").getValue();
       String fontFamily = fontOption.getFontFamily();
       
      Returns:
      The font family of barcode label text.
    • getFontStyle

      String getFontStyle()
      Gets the font style of barcode label text.

      The default value is "normal".

      
       worksheet.getRange("A1").setValue("123456789");
       worksheet.getRange("B1").setFormula(
               "=BC_CODE128(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",true,\"bottom\","
                       + "\"auto\",\"Arial\",\"italic\",\"bold\",\"underline\",\"left\",14,10,10,0,0)");
       IFontOption fontOption = (IFontOption) worksheet.getRange("B1").getValue();
       String fontStyle = fontOption.getFontStyle();
       
      Returns:
      The font style of barcode label text.
    • getFontWeight

      String getFontWeight()
      Gets the font weight of barcode label text.

      The default value is "normal".

      
       worksheet.getRange("A1").setValue("123456789");
       worksheet.getRange("B1").setFormula(
               "=BC_CODE128(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",true,\"bottom\","
                       + "\"auto\",\"Arial\",\"italic\",\"bold\",\"underline\",\"left\",14,10,10,0,0)");
       IFontOption fontOption = (IFontOption) worksheet.getRange("B1").getValue();
       String fontWeight = fontOption.getFontWeight();
       
      Returns:
      The font weight of barcode label text.
    • getFontTextDecoration

      String getFontTextDecoration()
      Gets the text decoration of barcode label text.

      The default value is "none".

      
       worksheet.getRange("A1").setValue("123456789");
       worksheet.getRange("B1").setFormula(
               "=BC_CODE128(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",true,\"bottom\","
                       + "\"auto\",\"Arial\",\"italic\",\"bold\",\"underline\",\"left\",14,10,10,0,0)");
       IFontOption fontOption = (IFontOption) worksheet.getRange("B1").getValue();
       String fontTextDecoration = fontOption.getFontTextDecoration();
       
      Returns:
      The text decoration of barcode label text.
    • getFontTextAlign

      String getFontTextAlign()
      Gets the alignment of barcode label text.

      The default value is "center".

      
       worksheet.getRange("A1").setValue("123456789");
       worksheet.getRange("B1").setFormula(
               "=BC_CODE128(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",true,\"bottom\","
                       + "\"auto\",\"Arial\",\"italic\",\"bold\",\"underline\",\"left\",14,10,10,0,0)");
       IFontOption fontOption = (IFontOption) worksheet.getRange("B1").getValue();
       String fontTextAlign = fontOption.getFontTextAlign();
       
      Returns:
      The alignment of barcode label text.
    • getFontSize

      int getFontSize()
      Gets the numeric font size of barcode label text.

      The return type is int. The default value is 12, which corresponds to the formula parameter default of 12px.

      
       worksheet.getRange("A1").setValue("123456789");
       worksheet.getRange("B1").setFormula(
               "=BC_CODE128(A1,\"rgb(0, 0, 0)\",\"rgb(255, 255, 255)\",true,\"bottom\","
                       + "\"auto\",\"Arial\",\"italic\",\"bold\",\"underline\",\"left\",14,10,10,0,0)");
       IFontOption fontOption = (IFontOption) worksheet.getRange("B1").getValue();
       int fontSize = fontOption.getFontSize();
       
      Returns:
      The numeric font size of barcode label text.