short xPos = 0;  for (int j = 0; j < this.characterMap.length; j++ ) { char mapCharacter = this.characterMap[j]; byte width = this.characterWidths[ j ]; if ( inputCharacter == mapCharacter ) { xPositions[ i ] = xPos; widths[ i ] = width;  completeWidth += width; break; } xPos += width;
if (inputCharacter == '\n') { indeces[i] = BitMapFontViewer.ABSOLUTE_LINE_BREAK; } else { indeces[i] = this.characterMap.indexOf( inputCharacter );
	public BitMapFontViewer getViewer( String input ) {		if (this.fontImage == null) {			InputStream in = null;			try {				in = getClass().getResourceAsStream(this.fontUrl);				if (in == null) {					return null;				}				DataInputStream dataIn = new DataInputStream( in );				this.hasMixedCase = dataIn.readBoolean();				String map = dataIn.readUTF();				this.characterMap = map.toCharArray();				int length = map.length();				this.characterWidths = new byte[ length ];				for (int i = 0; i < length; i++ ) {					this.characterWidths[i] = dataIn.readByte();				}				this.fontImage = Image.createImage( in );				this.fontHeight = this.fontImage.getHeight();				this.fontUrl = null;			} catch (IOException e) {				//#debug error				System.out.println("Unable to load bitmap-font [" + this.fontUrl + "]" + e);				return null;			} finally {				try { 					in.close();				} catch (IOException e) {					//#debug error					System.out.println("Unable to close bitmap-font stream" + e);				}			}		}		//int imageWidth = this.fontImage.getWidth();		// get the x/y-position and width for each character:		if (!this.hasMixedCase) {			input = input.toLowerCase();		}		int length = input.length();		short[] xPositions = new short[ length ];		//short[] yPositions = new short[ length ];		byte[] widths = new byte[ length ];		int completeWidth = 0;		for (int i = length - 1; i >= 0; i-- ) {			char inputCharacter = input.charAt(i);			short xPos = 0;			//short yPos = 0;			for (int j = 0; j < this.characterMap.length; j++ ) {				char mapCharacter = this.characterMap[j];				byte width = this.characterWidths[ j ];				if ( inputCharacter == mapCharacter ) {					xPositions[ i ] = xPos;					widths[ i ] = width;					//yPositions[ i ] = yPos;					completeWidth += width;					break;				}				xPos += width;				//if (xPos >= imageWidth) {				//	xPos = 0;					//yPos += this.fontHeight;				//}			}		}		return new BitMapFontViewer( this.fontImage, xPositions, widths, completeWidth, this.fontHeight );	}