Package org.jnode.awt.font.truetype

Examples of org.jnode.awt.font.truetype.TTFFontData


    public String getTag() {
        return "loca";
    }

    protected void readTable(TTFInput ttf) throws IOException {
        final TTFFontData font = getFont();
        final short format = font.getHeaderTable().indexToLocFormat;
        final int numGlyphs = font.getMaxPTable().numGlyphs + 1;
        offset = new long[numGlyphs];
        for (int i = 0; i < numGlyphs; i++) {
            offset[i] = (format == HeadTable.ITLF_LONG ? ttf.readULong() : ttf.readUShort() * 2);
        }
    }
View Full Code Here


    public String getTag() {
        return "hmtx";
    }

    protected void readTable(TTFInput ttf) throws IOException {
        final TTFFontData font = getFont();
        final int numberOfHMetrics = font.getHorizontalHeaderTable().getNumberOfHMetrics();
        final int numGlyphs = font.getMaxPTable().numGlyphs;

        advanceWidth = new int[numberOfHMetrics];
        leftSideBearing = new short[numberOfHMetrics];
        for (int i = 0; i < numberOfHMetrics; i++) {
            advanceWidth[i] = ttf.readUFWord();
View Full Code Here

    public String getTag() {
        return "glyf";
    }

    protected final void readTable(TTFInput ttf) throws IOException {
        final TTFFontData font = getFont();
        glyphs = new Glyph[font.getMaxPTable().numGlyphs];
        offsets = font.getLocationsTable().offset;

        if (READ_GLYPHS) {
            for (int i = 0; i < glyphs.length; i++) {
                if ((i > 0) && (offsets[i - 1] == offsets[i])) {
                    glyphs[i] = glyphs[i - 1];
View Full Code Here

public class GlyphTest {

    public static void main(String[] args) throws IOException {
        // Font f = new Font("Verdana", Font.PLAIN, 64);

        TTFFontData fdata = loadFont("luxisr.ttf");

        JFrame frm;

        frm = new JFrame("GlyphTest - SumAreaTable");
        frm.getContentPane().setBackground(Color.LIGHT_GRAY);
View Full Code Here

TOP

Related Classes of org.jnode.awt.font.truetype.TTFFontData

Copyright © 2018 www.massapicom. 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.