|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The BitmappedFont interface represents a bitmapped printer font. These types of fonts are fixed in size but their height and width can be altered independently by using a height or width multiplying factor.
Example: Using a bitmapped font to print text
Connector connector = Connector.getInstance();
DriverInfo[] printers = connector.listDrivers(ConnectionType.PRINTER);
PrinterParameters parameters = new PrinterParameters(printers[0]);
parameters.setPrinterMode(PrinterParameters.LINE_MODE);
LinePrinter printer = (LinePrinter)connector.open(parameters);
PrinterFont[] fonts = printer.listFonts(0, PrinterFont.FONTTYPE_BITMAPPED, 0);
if (fonts.length > 0) {
BitmappedFont bitmapFont = (BitmappedFont)fonts[0];
bitmapFont.setHeightFactor(2); // increase height by twice it's normal size
printer.printText(bitmapFont, "Bitmapped font", LinePrinter.NO_ALIGNMENT);
}
printer.doPrint(1);
printer.close();
PrinterConnection
,
PrinterFont
Field Summary |
Fields inherited from interface com.sap.ip.me.api.pios.printer.PrinterFont |
FONTTYPE_BITMAPPED, FONTTYPE_SCALABLE, OPTION_ANY, OPTION_BOLD, OPTION_ITALIC, OPTION_NORMAL, OPTION_UNDERLINE |
Method Summary | |
int |
getHeightFactor()
Returns the height factor used to increase the standard height of the font. |
int |
getWidthFactor()
Returns the width factor used to increase the standard width of the font. |
void |
setHeightFactor(int yFactor)
Sets the height factor used to increase the standard height of the font. |
void |
setWidthFactor(int xFactor)
Sets the width factor used to increase the standard width of the font. |
Methods inherited from interface com.sap.ip.me.api.pios.printer.PrinterFont |
getConfiguredSize, getDescription, getHeight, getMetrics, getName, getOptions, getType |
Method Detail |
public void setWidthFactor(int xFactor) throws PrinterException
xFactor
- the width factor
PrinterException
- thrown if parameter value is out of rangepublic void setHeightFactor(int yFactor) throws PrinterException
yFactor
- the height factor
PrinterException
- thrown if parameter value is out of rangepublic int getWidthFactor()
public int getHeightFactor()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |