Package org.apache.fontbox.ttf

Examples of org.apache.fontbox.ttf.NamingTable


        TrueTypeFont ttf = null;
        try
        {
            TTFParser parser = new TTFParser();
            ttf = parser.parseTTF( ttfData );
            NamingTable naming = ttf.getNaming();
            List<NameRecord> records = naming.getNameRecords();
            for( int i=0; i<records.size(); i++ )
            {
                NameRecord nr = records.get( i );
                if( nr.getNameId() == NameRecord.NAME_POSTSCRIPT_NAME )
                {
View Full Code Here


    {
        TTFParser ttfParser = new TTFParser(false,true);
        TrueTypeFont ttfFont = ttfParser.parseTTF(ttfFilename);
        if (ttfFont != null)
        {
            NamingTable namingTable = ttfFont.getNaming();
            if (namingTable != null && namingTable.getPSName() != null)
            {
                String normalizedName = normalizeFontname(namingTable.getPSName());
                if (!ttfFontfiles.containsKey(normalizedName))
                {
                    LOG.debug("Added font mapping "+normalizedName + " -=> "+ttfFilename);
                    ttfFontfiles.put(normalizedName, ttfFilename);
                }
            }
            // take the font family name into account
            if (namingTable != null && namingTable.getFontFamily() != null)
            {
                String normalizedName = normalizeFontFamily(namingTable.getFontFamily(), namingTable.getPSName());
                if (!ttfFontfiles.containsKey(normalizedName))
                {
                    LOG.debug("Added font mapping "+normalizedName + " -=> "+ttfFilename);
                    ttfFontfiles.put(normalizedName, ttfFilename);
                }
View Full Code Here

        TrueTypeFont ttf = null;
        try
        {
            TTFParser parser = new TTFParser();
            ttf = parser.parseTTF( ttfData );
            NamingTable naming = ttf.getNaming();
            List records = naming.getNameRecords();
            for( int i=0; i<records.size(); i++ )
            {
                NameRecord nr = (NameRecord)records.get( i );
                if( nr.getNameId() == NameRecord.NAME_POSTSCRIPT_NAME )
                {
View Full Code Here

        TrueTypeFont ttf = null;
        try
        {
            TTFParser parser = new TTFParser();
            ttf = parser.parseTTF( file );
            NamingTable naming = ttf.getNaming();
            List records = naming.getNameRecords();
            for( int i=0; i<records.size(); i++ )
            {
                NameRecord nr = (NameRecord)records.get( i );
                if( nr.getNameId() == NameRecord.NAME_POSTSCRIPT_NAME )
                {
View Full Code Here

        TrueTypeFont ttf = null;
        try
        {
            TTFParser parser = new TTFParser();
            ttf = parser.parseTTF( ttfData );
            NamingTable naming = ttf.getNaming();
            List<NameRecord> records = naming.getNameRecords();
            for( int i=0; i<records.size(); i++ )
            {
                NameRecord nr = records.get( i );
                if( nr.getNameId() == NameRecord.NAME_POSTSCRIPT_NAME )
                {
View Full Code Here

        TrueTypeFont ttf = null;
        try
        {
            TTFParser parser = new TTFParser();
            ttf = parser.parseTTF( ttfData );
            NamingTable naming = ttf.getNaming();
            List records = naming.getNameRecords();
            for( int i=0; i<records.size(); i++ )
            {
                NameRecord nr = (NameRecord)records.get( i );
                if( nr.getNameId() == NameRecord.NAME_POSTSCRIPT_NAME )
                {
View Full Code Here

                font.getHeader().getModified());
        metadata.set(AdobeFontMetricParser.MET_DOC_VERSION,
                Float.toString(font.getHeader().getVersion()));
       
        // Pull out the naming info
        NamingTable fontNaming = font.getNaming();
        for (NameRecord nr : fontNaming.getNameRecords()) {
            if (nr.getNameId() == NameRecord.NAME_FONT_FAMILY_NAME) {
                metadata.set(AdobeFontMetricParser.MET_FONT_FAMILY_NAME, nr.getString());
            }
            if (nr.getNameId() == NameRecord.NAME_FONT_SUB_FAMILY_NAME) {
                metadata.set(AdobeFontMetricParser.MET_FONT_SUB_FAMILY_NAME, nr.getString());
View Full Code Here

TOP

Related Classes of org.apache.fontbox.ttf.NamingTable

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.