[]
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();
intThe 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();
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();
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();
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();
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();
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();