@Override
	protected FTGlyph makeGlyph(Shape ftGlyph, float advance) {

		if (ftGlyph != null) {
			// prevents overwriting previous characters if the last character
			// was very small
			glyphHeight = Math.max(glyphHeight, ftGlyph.getBounds().height);
			glyphWidth = ftGlyph.getBounds().width;

			// TODO maybe workaround.
			if (glyphHeight == 0 || glyphWidth == 0)
				return new FTTextureGlyph(ftGlyph, 0, 0, 0, 0, 0);

			if (textureIDList.isEmpty()) {
				textureIDList.add(createTexture());
				xOffset = padding;
				yOffset = padding;
			}

			if (xOffset > (textureWidth - padding - glyphWidth)) {
				xOffset = padding;
				yOffset += glyphHeight;

				if (yOffset > (textureHeight - padding - glyphHeight)) {
					textureIDList.add(createTexture());
					yOffset = padding;
				}
			}

			Object textureID = textureIDList.get(textureIDList.size() - 1);
			FTTextureGlyph tempGlyph = new FTTextureGlyph(ftGlyph,
					((IntBuffer) textureID).get(0), xOffset, yOffset,
					textureWidth, textureHeight);
			FTBBox box = tempGlyph.getBBox();
			assert box.upperX - box.lowerX <= glyphWidth : "Character width is out of bounds."
					+ (box.upperX - box.lowerX) + " max:" + glyphWidth;
			assert box.upperY - box.lowerY <= glyphHeight : "Character height is out of bounds."
					+ (box.upperY - box.lowerY) + " max:" + glyphWidth;
			xOffset += glyphWidth + padding;

			--remGlyphs;
			return tempGlyph;
		}

		return null;
	}