com.sap.ip.me.api.pios.printer
Interface BitmappedFont

All Superinterfaces:
PrinterFont

public interface BitmappedFont
extends PrinterFont

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

 
 

Since:
MI 2.5
Author:
Abaco
See Also:
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

setWidthFactor

public void setWidthFactor(int xFactor)
                    throws PrinterException
Sets the width factor used to increase the standard width of the font. The valid range for the width factor value is from 1-10. A value greater than 10 will be trated as 10. A value less than 1 will be trated as 1.

Parameters:
xFactor - the width factor
Throws:
PrinterException - thrown if parameter value is out of range

setHeightFactor

public void setHeightFactor(int yFactor)
                     throws PrinterException
Sets the height factor used to increase the standard height of the font. The valid range for the height factor value is from 1-10. A value greater than 10 will be trated as 10. A value less than 1 will be trated as 1.

Parameters:
yFactor - the height factor
Throws:
PrinterException - thrown if parameter value is out of range

getWidthFactor

public int getWidthFactor()
Returns the width factor used to increase the standard width of the font.

Returns:
The width factor.

getHeightFactor

public int getHeightFactor()
Returns the height factor used to increase the standard height of the font.

Returns:
The height factor.


Copyright © 2005 SAP AG. All Rights Reserved.