1 31 package org.pdfbox.ttf; 32 33 import java.io.IOException ; 34 35 41 public class NameRecord 42 { 43 46 public static final int PLATFORM_APPLE_UNICODE = 0; 47 50 public static final int PLATFORM_MACINTOSH = 1; 51 54 public static final int PLATFORM_ISO = 2; 55 58 public static final int PLATFORM_WINDOWS = 3; 59 60 63 public static final int PLATFORM_ENCODING_WINDOWS_UNDEFINED = 0; 64 67 public static final int PLATFORM_ENCODING_WINDOWS_UNICODE = 1; 68 69 72 public static final int NAME_COPYRIGHT = 0; 73 76 public static final int NAME_FONT_FAMILY_NAME = 1; 77 80 public static final int NAME_FONT_SUB_FAMILY_NAME = 2; 81 84 public static final int NAME_UNIQUE_FONT_ID = 3; 85 88 public static final int NAME_FULL_FONT_NAME = 4; 89 92 public static final int NAME_VERSION = 5; 93 96 public static final int NAME_POSTSCRIPT_NAME = 6; 97 100 public static final int NAME_TRADEMARK = 7; 101 102 103 104 private int platformId; 105 private int platformEncodingId; 106 private int languageId; 107 private int nameId; 108 private int stringLength; 109 private int stringOffset; 110 private String string; 111 112 115 public int getStringLength() 116 { 117 return stringLength; 118 } 119 122 public void setStringLength(int stringLengthValue) 123 { 124 this.stringLength = stringLengthValue; 125 } 126 129 public int getStringOffset() 130 { 131 return stringOffset; 132 } 133 136 public void setStringOffset(int stringOffsetValue) 137 { 138 this.stringOffset = stringOffsetValue; 139 } 140 141 144 public int getLanguageId() 145 { 146 return languageId; 147 } 148 151 public void setLanguageId(int languageIdValue) 152 { 153 this.languageId = languageIdValue; 154 } 155 158 public int getNameId() 159 { 160 return nameId; 161 } 162 165 public void setNameId(int nameIdValue) 166 { 167 this.nameId = nameIdValue; 168 } 169 172 public int getPlatformEncodingId() 173 { 174 return platformEncodingId; 175 } 176 179 public void setPlatformEncodingId(int platformEncodingIdValue) 180 { 181 this.platformEncodingId = platformEncodingIdValue; 182 } 183 186 public int getPlatformId() 187 { 188 return platformId; 189 } 190 193 public void setPlatformId(int platformIdValue) 194 { 195 this.platformId = platformIdValue; 196 } 197 198 205 public void initData( TrueTypeFont ttf, TTFDataStream data ) throws IOException 206 { 207 platformId = data.readUnsignedShort(); 208 platformEncodingId = data.readUnsignedShort(); 209 languageId = data.readUnsignedShort(); 210 nameId = data.readUnsignedShort(); 211 stringLength = data.readUnsignedShort(); 212 stringOffset = data.readUnsignedShort(); 213 } 214 215 220 public String toString() 221 { 222 return 223 "platform=" + platformId + 224 " pEncoding=" + platformEncodingId + 225 " language=" + languageId + 226 " name=" + nameId; 227 } 228 231 public String getString() 232 { 233 return string; 234 } 235 238 public void setString(String stringValue) 239 { 240 this.string = stringValue; 241 } 242 } 243 | Popular Tags |