public void addAllGlyphsToTexture(PGraphicsOpenGL pg, PFont font) { // loop over current glyphs. for (int i = 0; i < font.getGlyphCount(); i++) { addToTexture(pg, i, font.getGlyph(i)); } }
protected void textCharImpl(char ch, float x, float y) { PFont.Glyph glyph = textFont.getGlyph(ch); if (glyph != null) { if (textMode == MODEL) { float high = glyph.height / (float) textFont.size; float bwidth = glyph.width / (float) textFont.size; float lextent = glyph.leftExtent / (float) textFont.size; float textent = glyph.topExtent / (float) textFont.size; float x1 = x + lextent * textSize; float y1 = y - textent * textSize; float x2 = x1 + bwidth * textSize; float y2 = y1 + high * textSize; textCharModelImpl(glyph.image, x1, y1, x2, y2, glyph.width, glyph.height); } } }
public void addAllGlyphsToTexture(PGraphicsOpenGL pg, PFont font) { // loop over current glyphs. for (int i = 0; i < font.getGlyphCount(); i++) { addToTexture(pg, i, font.getGlyph(i)); } }
protected void textCharImpl(char ch, float x, float y) { //, float z) { PFont.Glyph glyph = textFont.getGlyph(ch); if (glyph != null) { if (textMode == MODEL) { float high = glyph.height / (float) textFont.getSize(); float bwidth = glyph.width / (float) textFont.getSize(); float lextent = glyph.leftExtent / (float) textFont.getSize(); float textent = glyph.topExtent / (float) textFont.getSize(); float x1 = x + lextent * textSize; float y1 = y - textent * textSize; float x2 = x1 + bwidth * textSize; float y2 = y1 + high * textSize; textCharModelImpl(glyph.image, x1, y1, x2, y2, glyph.width, glyph.height); } } else if (ch != ' ' && ch != 127) { showWarning("No glyph found for the " + ch + " (\\u" + PApplet.hex(ch, 4) + ") character"); } }
@Override protected void textCharImpl(char ch, float x, float y) { //, float z) { PFont.Glyph glyph = textFont.getGlyph(ch); if (glyph != null) { if (textMode == MODEL) { float high = glyph.height / (float) textFont.getSize(); float bwidth = glyph.width / (float) textFont.getSize(); float lextent = glyph.leftExtent / (float) textFont.getSize(); float textent = glyph.topExtent / (float) textFont.getSize(); float x1 = x + lextent * textSize; float y1 = y - textent * textSize; float x2 = x1 + bwidth * textSize; float y2 = y1 + high * textSize; PImage glyphImage = (fillColor == 0xFFFFFFFF) ? glyph.image : getTintedGlyphImage(glyph, fillColor); textCharModelImpl(glyphImage, x1, y1, x2, y2, glyph.width, glyph.height); } } else if (ch != ' ' && ch != 127) { showWarning("No glyph found for the " + ch + " (\\u" + PApplet.hex(ch, 4) + ") character"); } }
@Override protected void textCharImpl(char ch, float x, float y) { PFont.Glyph glyph = textFont.getGlyph(ch); if (glyph != null) { if (textMode == MODEL) { FontTexture.TextureInfo tinfo = textTex.getTexInfo(glyph); if (tinfo == null) { // Adding new glyph to the font texture. tinfo = textTex.addToTexture(this, glyph); } float high = glyph.height / (float) textFont.getSize(); float bwidth = glyph.width / (float) textFont.getSize(); float lextent = glyph.leftExtent / (float) textFont.getSize(); float textent = glyph.topExtent / (float) textFont.getSize(); float x1 = x + lextent * textSize; float y1 = y - textent * textSize; float x2 = x1 + bwidth * textSize; float y2 = y1 + high * textSize; textCharModelImpl(tinfo, x1, y1, x2, y2); } else if (textMode == SHAPE) { textCharShapeImpl(ch, x, y); } } }
@Override protected void textCharImpl(char ch, float x, float y) { PFont.Glyph glyph = textFont.getGlyph(ch); if (glyph != null) { if (textMode == MODEL) { FontTexture.TextureInfo tinfo = textTex.getTexInfo(glyph); if (tinfo == null) { // Adding new glyph to the font texture. tinfo = textTex.addToTexture(this, glyph); } float high = glyph.height / (float) textFont.getSize(); float bwidth = glyph.width / (float) textFont.getSize(); float lextent = glyph.leftExtent / (float) textFont.getSize(); float textent = glyph.topExtent / (float) textFont.getSize(); float x1 = x + lextent * textSize; float y1 = y - textent * textSize; float x2 = x1 + bwidth * textSize; float y2 = y1 + high * textSize; textCharModelImpl(tinfo, x1, y1, x2, y2); } else if (textMode == SHAPE) { textCharShapeImpl(ch, x, y); } } }