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

All Superinterfaces:
PrinterFont

public interface ScalableFont
extends PrinterFont

The ScalableFont interface represents a scalable printer font. Scalable fonts can be scaled to change their size, specifying different point size. Some printers may not support Scalable fonts.

Example: Get a scalable font to print text
 
 
	Connector connector = Connector.getInstance();

	DriverInfo[] printers = connector.listDrivers(ConnectionType.PRINTER);
	PrinterParameters parameters = new PrinterParameters(printers[0]);

	parameters.setPrinterMode(PrinterParameters.GRAPHIC_MODE);
	GraphicPrinter printer = (GraphicPrinter)connector.open(parameters);
 		
	PrinterFont[] fonts = printer.listFonts(0, PrinterFont.FONTTYPE_SCALABLE, 0);
	if (fonts.length > 0) {
		ScalableFont smallFont = (ScalableFont)fonts[0];
		smallFont.setFontSize(16.5f);  
			
		printer.drawText(smallFont, 0, 200, "I like rotation",	GraphicPrinter.ROTATE_90_DEGREES);
	}
		
	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
 float getFontSize()
          Returns the font size in points.
 void setFontSize(float size)
          Sets the font size in points.
 
Methods inherited from interface com.sap.ip.me.api.pios.printer.PrinterFont
getConfiguredSize, getDescription, getHeight, getMetrics, getName, getOptions, getType
 

Method Detail

setFontSize

public void setFontSize(float size)
                 throws PrinterException
Sets the font size in points. The valid range for the font size value is from 1-72. A value greater than 72 will be trated as 72. A value less than 1 will be trated as 1.

Parameters:
size - the new font size
Throws:
PrinterException - thrown if value is out of range

getFontSize

public float getFontSize()
Returns the font size in points.

Returns:
The font size in point.


Copyright © 2005 SAP AG. All Rights Reserved.