Examples of GlyphSlot


Examples of com.badlogic.gdx.graphics.g2d.freetype.FreeType.GlyphSlot

  private boolean checkForBitmapFont () {
    if (((face.getFaceFlags() & FreeType.FT_FACE_FLAG_FIXED_SIZES) == FreeType.FT_FACE_FLAG_FIXED_SIZES)
      && ((face.getFaceFlags() & FreeType.FT_FACE_FLAG_HORIZONTAL) == FreeType.FT_FACE_FLAG_HORIZONTAL)) {
      if (FreeType.loadChar(face, 32, FreeType.FT_LOAD_DEFAULT)) {
        GlyphSlot slot = face.getGlyph();
        if (slot.getFormat() == 1651078259) {
          bitmapped = true;
        }
      }
    }
    return bitmapped;
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.freetype.FreeType.GlyphSlot

    // Try to load character
    if (!FreeType.loadChar(face, c, FreeType.FT_LOAD_DEFAULT)) {
      throw new GdxRuntimeException("Unable to load character!");
    }

    GlyphSlot slot = face.getGlyph();

    // Try to render to bitmap
    Bitmap bitmap;
    if (bitmapped) {
      bitmap = slot.getBitmap();
    } else if (!FreeType.renderGlyph(slot, FreeType.FT_RENDER_MODE_LIGHT)) {
      bitmap = null;
    } else {
      bitmap = slot.getBitmap();
    }

    GlyphMetrics metrics = slot.getMetrics();

    Glyph glyph = new Glyph();
    if (bitmap != null) {
      glyph.width = bitmap.getWidth();
      glyph.height = bitmap.getRows();
    } else {
      glyph.width = 0;
      glyph.height = 0;
    }
    glyph.xoffset = slot.getBitmapLeft();
    glyph.yoffset = flip ? -slot.getBitmapTop() + baseline : -(glyph.height - slot.getBitmapTop()) - baseline;
    glyph.xadvance = FreeType.toInt(metrics.getHoriAdvance());
    glyph.srcX = 0;
    glyph.srcY = 0;
    glyph.id = c;
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.freetype.FreeType.GlyphSlot

      }
      if (!FreeType.renderGlyph(face.getGlyph(), FreeType.FT_RENDER_MODE_NORMAL)) {
        Gdx.app.log("FreeTypeFontGenerator", "Couldn't render char '" + c + "'");
        continue;
      }
      GlyphSlot slot = face.getGlyph();
      GlyphMetrics metrics = slot.getMetrics();
      Bitmap bitmap = slot.getBitmap();
      Pixmap pixmap = bitmap.getPixmap(Format.RGBA8888);
      Glyph glyph = new Glyph();
      glyph.id = (int)c;
      glyph.width = pixmap.getWidth();
      glyph.height = pixmap.getHeight();
      glyph.xoffset = slot.getBitmapLeft();
      glyph.yoffset = parameter.flip ? -slot.getBitmapTop() + (int)baseLine : -(glyph.height - slot.getBitmapTop())
        - (int)baseLine;
      glyph.xadvance = FreeType.toInt(metrics.getHoriAdvance());

      if (bitmapped) {
        pixmap.setColor(Color.CLEAR);
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.freetype.FreeType.GlyphSlot

    if(  ((face.getFaceFlags()&FreeType.FT_FACE_FLAG_FIXED_SIZES) == FreeType.FT_FACE_FLAG_FIXED_SIZES)
    && ((face.getFaceFlags()&FreeType.FT_FACE_FLAG_HORIZONTAL) == FreeType.FT_FACE_FLAG_HORIZONTAL) )
    {
      if(FreeType.loadChar(face, 32, FreeType.FT_LOAD_DEFAULT))
      {
        GlyphSlot slot = face.getGlyph();
        if(slot.getFormat()==1651078259)
        {
          bitmapped = true;
        }
      }
    }
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.freetype.FreeType.GlyphSlot

    // Try to load character
    if (!FreeType.loadChar(face, c, FreeType.FT_LOAD_DEFAULT)) {
      throw new GdxRuntimeException("Unable to load character!");
    }

    GlyphSlot slot = face.getGlyph();
   
    // Try to render to bitmap
    Bitmap bitmap;
    if(bitmapped) {
      bitmap = slot.getBitmap();
    } else if (!FreeType.renderGlyph(slot, FreeType.FT_RENDER_MODE_LIGHT)) {
      bitmap = null;
    } else {
      bitmap = slot.getBitmap();
    }

    GlyphMetrics metrics = slot.getMetrics();

    Glyph glyph = new Glyph();
    if (bitmap != null) {
      glyph.width = bitmap.getWidth();
      glyph.height = bitmap.getRows();
    } else {
      glyph.width = 0;
      glyph.height = 0;
    }
    glyph.xoffset = slot.getBitmapLeft();
    glyph.yoffset = flip ? -slot.getBitmapTop() + baseline : -(glyph.height - slot.getBitmapTop()) - baseline;
    glyph.xadvance = FreeType.toInt(metrics.getHoriAdvance());
    glyph.srcX = 0;
    glyph.srcY = 0;
    glyph.id = c;
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.freetype.FreeType.GlyphSlot

      }
      if (!FreeType.renderGlyph(face.getGlyph(), FreeType.FT_RENDER_MODE_NORMAL)) {
        Gdx.app.log("FreeTypeFontGenerator", "Couldn't render char '" + c + "'");
        continue;
      }
      GlyphSlot slot = face.getGlyph();
      GlyphMetrics metrics = slot.getMetrics();
      Bitmap bitmap = slot.getBitmap();
      Pixmap pixmap = bitmap.getPixmap(Format.RGBA8888);
      Glyph glyph = new Glyph();
      glyph.id = (int)c;
      glyph.width = pixmap.getWidth();
      glyph.height = pixmap.getHeight();
      glyph.xoffset = slot.getBitmapLeft();
      glyph.yoffset = flip ? -slot.getBitmapTop() + (int)baseLine : -(glyph.height - slot.getBitmapTop()) - (int)baseLine;
      glyph.xadvance = FreeType.toInt(metrics.getHoriAdvance());

      if(bitmapped)
      {
        pixmap.setColor(Color.CLEAR);
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.freetype.FreeType.GlyphSlot

  private boolean checkForBitmapFont () {
    if (((face.getFaceFlags() & FreeType.FT_FACE_FLAG_FIXED_SIZES) == FreeType.FT_FACE_FLAG_FIXED_SIZES)
      && ((face.getFaceFlags() & FreeType.FT_FACE_FLAG_HORIZONTAL) == FreeType.FT_FACE_FLAG_HORIZONTAL)) {
      if (FreeType.loadChar(face, 32, FreeType.FT_LOAD_DEFAULT)) {
        GlyphSlot slot = face.getGlyph();
        if (slot.getFormat() == 1651078259) {
          bitmapped = true;
        }
      }
    }
    return bitmapped;
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.freetype.FreeType.GlyphSlot

    // Try to load character
    if (!FreeType.loadChar(face, c, FreeType.FT_LOAD_DEFAULT)) {
      throw new GdxRuntimeException("Unable to load character!");
    }

    GlyphSlot slot = face.getGlyph();

    // Try to render to bitmap
    Bitmap bitmap;
    if (bitmapped) {
      bitmap = slot.getBitmap();
    } else if (!FreeType.renderGlyph(slot, FreeType.FT_RENDER_MODE_LIGHT)) {
      bitmap = null;
    } else {
      bitmap = slot.getBitmap();
    }

    GlyphMetrics metrics = slot.getMetrics();

    Glyph glyph = new Glyph();
    if (bitmap != null) {
      glyph.width = bitmap.getWidth();
      glyph.height = bitmap.getRows();
    } else {
      glyph.width = 0;
      glyph.height = 0;
    }
    glyph.xoffset = slot.getBitmapLeft();
    glyph.yoffset = flip ? -slot.getBitmapTop() + baseline : -(glyph.height - slot.getBitmapTop()) - baseline;
    glyph.xadvance = FreeType.toInt(metrics.getHoriAdvance());
    glyph.srcX = 0;
    glyph.srcY = 0;
    glyph.id = c;
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.freetype.FreeType.GlyphSlot

      }
      if (!FreeType.renderGlyph(face.getGlyph(), FreeType.FT_RENDER_MODE_NORMAL)) {
        Gdx.app.log("FreeTypeFontGenerator", "Couldn't render char '" + c + "'");
        continue;
      }
      GlyphSlot slot = face.getGlyph();
      GlyphMetrics metrics = slot.getMetrics();
      Bitmap bitmap = slot.getBitmap();
      Pixmap pixmap = bitmap.getPixmap(Format.RGBA8888);
      Glyph glyph = new Glyph();
      glyph.id = (int)c;
      glyph.width = pixmap.getWidth();
      glyph.height = pixmap.getHeight();
      glyph.xoffset = slot.getBitmapLeft();
      glyph.yoffset = parameter.flip ? -slot.getBitmapTop() + (int)baseLine : -(glyph.height - slot.getBitmapTop())
        - (int)baseLine;
      glyph.xadvance = FreeType.toInt(metrics.getHoriAdvance());

      if (bitmapped) {
        pixmap.setColor(Color.CLEAR);
View Full Code Here

Examples of com.badlogic.gdx.graphics.g2d.freetype.FreeType.GlyphSlot

  private boolean checkForBitmapFont () {
    if (((face.getFaceFlags() & FreeType.FT_FACE_FLAG_FIXED_SIZES) == FreeType.FT_FACE_FLAG_FIXED_SIZES)
      && ((face.getFaceFlags() & FreeType.FT_FACE_FLAG_HORIZONTAL) == FreeType.FT_FACE_FLAG_HORIZONTAL)) {
      if (FreeType.loadChar(face, 32, FreeType.FT_LOAD_DEFAULT)) {
        GlyphSlot slot = face.getGlyph();
        if (slot.getFormat() == 1651078259) {
          bitmapped = true;
        }
      }
    }
    return bitmapped;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.