font.getData().setScale(scale); layout.setText(font, TEXT); maxWidth = Math.max(maxWidth, layout.width);
missingGlyph = glyph; else if (ch <= Character.MAX_VALUE) setGlyph(ch, glyph); else continue; int second = Integer.parseInt(tokens.nextToken()); if (first < 0 || first > Character.MAX_VALUE || second < 0 || second > Character.MAX_VALUE) continue; Glyph glyph = getGlyph((char)first); tokens.nextToken(); int amount = Integer.parseInt(tokens.nextToken()); Glyph spaceGlyph = getGlyph(' '); if (spaceGlyph == null) { spaceGlyph = new Glyph(); spaceGlyph.id = (int)' '; Glyph xadvanceGlyph = getGlyph('l'); if (xadvanceGlyph == null) xadvanceGlyph = getFirstGlyph(); spaceGlyph.xadvance = xadvanceGlyph.xadvance; setGlyph(' ', spaceGlyph); xGlyph = getGlyph(xChar); if (xGlyph != null) break; if (xGlyph == null) xGlyph = getFirstGlyph(); xHeight = xGlyph.height - padY; capGlyph = getGlyph(capChar); if (capGlyph != null) break;
fontData.getGlyphs(run, str, runStart, runEnd, lastGlyph); if (run.glyphs.size == 0) { glyphRunPool.free(run); int wrapIndex = fontData.getWrapIndex(run.glyphs, i); if ((run.x == 0 && wrapIndex == 0) // Require at least one glyph per line. if (!fontData.isWhitespace((char)run.glyphs.get(wrapIndex).id)) break; if (wrapIndex > 0) { run.glyphs.removeRange(0, wrapIndex - 1); for (; lastIndex > 0; lastIndex--) { Glyph g = previous.glyphs.get(lastIndex); if (!fontData.isWhitespace((char)g.id)) break; previous.width -= previous.xAdvances.get(lastIndex + 1);
fontData.getGlyphs(run, str, runStart, runEnd, lastGlyph); if (run.glyphs.size == 0) { glyphRunPool.free(run); int wrapIndex = fontData.getWrapIndex(run.glyphs, i); if ((run.x == 0 && wrapIndex == 0) // Require at least one glyph per line. if (!fontData.isWhitespace((char)run.glyphs.get(wrapIndex).id)) break; if (wrapIndex > 0) { run.glyphs.removeRange(0, wrapIndex - 1); for (; lastIndex > 0; lastIndex--) { Glyph g = previous.glyphs.get(lastIndex); if (!fontData.isWhitespace((char)g.id)) break; previous.width -= previous.xAdvances.get(lastIndex + 1);
missingGlyph = glyph; else if (ch <= Character.MAX_VALUE) setGlyph(ch, glyph); else continue; int second = Integer.parseInt(tokens.nextToken()); if (first < 0 || first > Character.MAX_VALUE || second < 0 || second > Character.MAX_VALUE) continue; Glyph glyph = getGlyph((char)first); tokens.nextToken(); int amount = Integer.parseInt(tokens.nextToken()); Glyph spaceGlyph = getGlyph(' '); if (spaceGlyph == null) { spaceGlyph = new Glyph(); spaceGlyph.id = (int)' '; Glyph xadvanceGlyph = getGlyph('l'); if (xadvanceGlyph == null) xadvanceGlyph = getFirstGlyph(); spaceGlyph.xadvance = xadvanceGlyph.xadvance; setGlyph(' ', spaceGlyph); xGlyph = getGlyph(xChar); if (xGlyph != null) break; if (xGlyph == null) xGlyph = getFirstGlyph(); xHeight = xGlyph.height - padY; capGlyph = getGlyph(capChar); if (capGlyph != null) break;
BitmapFont.BitmapFontData fontData = font.getData(); fontData.markupEnabled = true; fontData.missingGlyph = fontData.getGlyph(UNKNOWN_CHARACTER); if (fontData.getGlyph('\r') == fontData.missingGlyph) { fontData.setGlyph('\r', fontData.getGlyph('\u00A0')); if (fontData.getGlyph('\t') == fontData.missingGlyph) { BitmapFont.Glyph spaceGlyph = fontData.getGlyph(' '); BitmapFont.Glyph tabGlyph = new BitmapFont.Glyph(); tabGlyph.id = '\t'; tabGlyph.kerning = spaceGlyph.kerning; tabGlyph.fixedWidth = spaceGlyph.fixedWidth; fontData.setGlyph('\t', tabGlyph);
boolean backspace = character == BACKSPACE; boolean enter = character == ENTER_DESKTOP || character == ENTER_ANDROID; boolean add = enter ? writeEnters : (!onlyFontChars || style.font.getData().hasGlyph(character)); boolean remove = backspace || delete; if (add || remove) {
boolean backspace = character == BACKSPACE; boolean enter = character == ENTER_DESKTOP || character == ENTER_ANDROID; boolean add = enter ? writeEnters : (!onlyFontChars || style.font.getData().hasGlyph(character)); boolean remove = backspace || delete; if (add || remove) {
boolean backspace = character == BACKSPACE; boolean enter = character == ENTER_DESKTOP || character == ENTER_ANDROID; boolean add = enter ? writeEnters : (!onlyFontChars || style.font.getData().hasGlyph(character)); boolean remove = backspace || delete; if (add || remove) {
BitmapFont.Glyph g = unicodeFont.bitmapFont.getData().getGlyph((char)codePoint); if (g == null) isMissing = true;
BitmapFont.Glyph g = bmpFont.getData().getGlyph(glyph); tr = new TextureRegion(bmpFont.getRegion(g.page), g.srcX, g.srcY, g.width, g.height); glyphTextures.put(glyph, tr);
fontData.getGlyphs(truncateRun, truncate, 0, truncate.length(), null); float truncateWidth = 0; if (truncateRun.xAdvances.size > 0) {
private void upData() { Glyph spaceGlyph = data.getGlyph(' '); if (spaceGlyph == null) { spaceGlyph = new Glyph(); Glyph xadvanceGlyph = data.getGlyph('l'); if (xadvanceGlyph == null) xadvanceGlyph = data.getFirstGlyph(); spaceGlyph.xadvance = xadvanceGlyph.xadvance; spaceGlyph.id = (int) ' '; data.setGlyph(' ', spaceGlyph); "BitmapFont texture region array cannot contain null elements."); data.setGlyphRegion(glyph, region);
Array<TextureRegion> regions = skin.getRegions(regionName); if (regions != null) font = new BitmapFont(new BitmapFontData(fontFile, flip), regions, true); else { TextureRegion region = skin.optional(regionName, TextureRegion.class); if (scaledSize != -1) font.getData().setScale(scaledSize / font.getCapHeight()); return font; } catch (RuntimeException ex) {
if (c == '\r' || c == '\n') continue; if (onlyFontChars && !data.hasGlyph(c)) continue; if (filter != null && !filter.acceptChar(this, c))
temp.dispose(); style = new Label.LabelStyle(bmpFont, null); BitmapFont.Glyph g = bmpFont.getData().getGlyph(directionGlyph); dirMarker = new TextureRegion(bmpFont.getRegion(g.page), g.srcX, g.srcY, g.width, g.height); initialized = true;