All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jglfont.impl.format.angelcode.line.KerningLine Maven / Gradle / Ivy

Go to download

Nifty GUI is a Java Library that supports the building of interactive user interfaces for games or similar applications. It utilizes OpenGL for rendering and it can be easily integrated into many rendering systems. The configuration of the GUI is stored in xml files with little supporting Java code. In short Nifty helps you to layout stuff, display it in a cool way and interact with it :)

The newest version!
package org.jglfont.impl.format.angelcode.line;

import org.jglfont.impl.format.JGLFontGlyphInfo;
import org.jglfont.impl.format.JGLAbstractFontData;
import org.jglfont.impl.format.angelcode.AngelCodeLine;
import org.jglfont.impl.format.angelcode.AngelCodeLineData;

/**
 * KerningLine
 * @author void
 */
public class KerningLine implements AngelCodeLine {

  @Override
  public boolean process(final AngelCodeLineData line, final JGLAbstractFontData font) {
    if (!line.hasValue("first") ||
        !line.hasValue("second") ||
        !line.hasValue("amount")) {
      return false;
    }
    int first = line.getInt("first");
    int second = line.getInt("second");
    int amount = line.getInt("amount");

    JGLFontGlyphInfo info = font.getGlyphs().get(first);
    if (info == null) {
      return false;
    }
    info.getKerning().put(second, amount);
    return true;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy