font1x = Font.colorMarked( BitmapCache.get( Assets.FONTS1X ), 0x00000000, BitmapText.Font.LATIN_FULL ); font1x.baseLine = 6; font15x = Font.colorMarked( BitmapCache.get( Assets.FONTS15X ), 12, 0x00000000, BitmapText.Font.LATIN_FULL ); font15x.baseLine = 9; font2x = Font.colorMarked( BitmapCache.get( Assets.FONTS2X ), 14, 0x00000000, BitmapText.Font.LATIN_FULL ); font2x.baseLine = 11; font25x = Font.colorMarked( BitmapCache.get( Assets.FONTS25X ), 17, 0x00000000, BitmapText.Font.LATIN_FULL ); font25x.baseLine = 13; font3x = Font.colorMarked( BitmapCache.get( Assets.FONTS3X ), 22, 0x00000000, BitmapText.Font.LATIN_FULL ); font3x.baseLine = 17;
pixelFont = Font.colorMarked( BitmapCache.get( Assets.PIXELFONT), 0x00000000, BitmapText.Font.LATIN_FULL ); pixelFont.baseLine = 6; font1x = Font.colorMarked( BitmapCache.get( Assets.FONT1X), 22, 0x00000000, BitmapText.Font.LATIN_FULL ); font1x.baseLine = 17; font2x = Font.colorMarked( BitmapCache.get( Assets.FONT2X), 44, 0x00000000, BitmapText.Font.LATIN_FULL ); font2x.baseLine = 38;
for (pos=0; pos < width; pos++) { for (int j=0; j < height; j++) { if (colorNotMatch(bitmap, pos, j, color)) break spaceMeasuring; add( ' ', new RectF( 0, 0, (float)pos / width, vHeight-0.01f ) ); if (colorNotMatch( bitmap, separator, j, color)) { found = true; break; if (colorNotMatch(bitmap, separator, j, color)) { found = false; break; add( ch, new RectF( (float)start / width, (float)line / bitmap.getHeight(), (float)separator / width, (float)line / bitmap.getHeight() + vHeight) ); separator++; lineHeight = baseLine = height( frames.get( chars.charAt( 0 ) ) );
pixelFont = Font.colorMarked( BitmapCache.get( Assets.PIXELFONT), 0x00000000, BitmapText.Font.LATIN_FULL ); pixelFont.baseLine = 6;
public Font( SmartTexture tx, int width, int height, String chars ) { super( tx ); texture = tx; int length = chars.length(); float uw = (float)width / tx.width; float vh = (float)height / tx.height; float left = 0; float top = 0; float bottom = vh; for (int i=0; i < length; i++) { RectF rect = new RectF( left, top, left += uw, bottom ); add( chars.charAt( i ), rect ); if (left >= 1) { left = 0; top = bottom; bottom += vh; } } lineHeight = baseLine = height; }
public Font( SmartTexture tx, int width, int height, String chars ) { super( tx ); texture = tx; autoUppercase = chars.equals( LATIN_UPPER ); int length = chars.length(); float uw = (float)width / tx.width; float vh = (float)height / tx.height; float left = 0; float top = 0; float bottom = vh; for (int i=0; i < length; i++) { RectF rect = new RectF( left, top, left += uw, bottom ); add( chars.charAt( i ), rect ); if (left >= 1) { left = 0; top = bottom; bottom += vh; } } lineHeight = baseLine = height; }
public synchronized void measure() { width = 0; height = 0; if (text == null) { text = ""; } int length = text.length(); for (int i=0; i < length; i++) { RectF rect = font.get( text.charAt( i ) ); float w = font.width( rect ); float h = font.height( rect ); width += w + font.tracking; if (h > height) { height = h; } } if (length > 0) { width -= font.tracking; } }
public synchronized void measure() { width = 0; height = 0; if (text == null) { text = ""; } int length = text.length(); for (int i=0; i < length; i++) { RectF rect = font.get( text.charAt( i ) ); float w = font.width( rect ); float h = font.height( rect ); width += w + font.tracking; if (h > height) { height = h; } } if (length > 0) { width -= font.tracking; } }
public void measure() { width = 0; height = 0; if (text == null) { text = ""; } int length = text.length(); for (int i=0; i < length; i++) { RectF rect = font.get( text.charAt( i ) ); float w = font.width( rect ); float h = font.height( rect ); width += w + font.tracking; if (h > height) { height = h; } } if (length > 0) { width -= font.tracking; } }
public Font( SmartTexture tx, int width, int height, String chars ) { super( tx ); texture = tx; int length = chars.length(); float uw = (float)width / tx.width; float vh = (float)height / tx.height; float left = 0; float top = 0; float bottom = vh; for (int i=0; i < length; i++) { RectF rect = new RectF( left, top, left += uw, bottom ); add( chars.charAt( i ), rect ); if (left >= 1) { left = 0; top = bottom; bottom += vh; } } lineHeight = baseLine = height; }