1 31 package org.pdfbox.ttf; 32 33 import java.io.IOException ; 34 35 41 public class OS2WindowsMetricsTable extends TTFTable 42 { 43 44 47 public static final int WEIGHT_CLASS_THIN = 100; 48 51 public static final int WEIGHT_CLASS_ULTRA_LIGHT = 200; 52 55 public static final int WEIGHT_CLASS_LIGHT = 300; 56 59 public static final int WEIGHT_CLASS_NORMAL = 400; 60 63 public static final int WEIGHT_CLASS_MEDIUM = 500; 64 67 public static final int WEIGHT_CLASS_SEMI_BOLD = 600; 68 71 public static final int WEIGHT_CLASS_BOLD = 700; 72 75 public static final int WEIGHT_CLASS_EXTRA_BOLD = 800; 76 79 public static final int WEIGHT_CLASS_BLACK = 900; 80 81 84 public static final int WIDTH_CLASS_ULTRA_CONDENSED = 1; 85 88 public static final int WIDTH_CLASS_EXTRA_CONDENSED = 2; 89 92 public static final int WIDTH_CLASS_CONDENSED = 3; 93 96 public static final int WIDTH_CLASS_SEMI_CONDENSED = 4; 97 100 public static final int WIDTH_CLASS_MEDIUM = 5; 101 104 public static final int WIDTH_CLASS_SEMI_EXPANDED = 6; 105 108 public static final int WIDTH_CLASS_EXPANDED = 7; 109 112 public static final int WIDTH_CLASS_EXTRA_EXPANDED = 8; 113 116 public static final int WIDTH_CLASS_ULTRA_EXPANDED = 9; 117 118 121 public static final int FAMILY_CLASS_NO_CLASSIFICATION = 0; 122 125 public static final int FAMILY_CLASS_OLDSTYLE_SERIFS = 1; 126 129 public static final int FAMILY_CLASS_TRANSITIONAL_SERIFS = 2; 130 133 public static final int FAMILY_CLASS_MODERN_SERIFS = 3; 134 137 public static final int FAMILY_CLASS_CLAREDON_SERIFS = 4; 138 141 public static final int FAMILY_CLASS_SLAB_SERIFS = 5; 142 145 public static final int FAMILY_CLASS_FREEFORM_SERIFS = 7; 146 149 public static final int FAMILY_CLASS_SANS_SERIF = 8; 150 153 public static final int FAMILY_CLASS_ORNAMENTALS = 9; 154 157 public static final int FAMILY_CLASS_SCRIPTS = 10; 158 161 public static final int FAMILY_CLASS_SYMBOLIC = 12; 162 163 166 public String getAchVendId() 167 { 168 return achVendId; 169 } 170 173 public void setAchVendId(String achVendIdValue) 174 { 175 this.achVendId = achVendIdValue; 176 } 177 180 public short getAverageCharWidth() 181 { 182 return averageCharWidth; 183 } 184 187 public void setAverageCharWidth(short averageCharWidthValue) 188 { 189 this.averageCharWidth = averageCharWidthValue; 190 } 191 194 public long getCodePageRange1() 195 { 196 return codePageRange1; 197 } 198 201 public void setCodePageRange1(long codePageRange1Value) 202 { 203 this.codePageRange1 = codePageRange1Value; 204 } 205 208 public long getCodePageRange2() 209 { 210 return codePageRange2; 211 } 212 215 public void setCodePageRange2(long codePageRange2Value) 216 { 217 this.codePageRange2 = codePageRange2Value; 218 } 219 222 public short getFamilyClass() 223 { 224 return familyClass; 225 } 226 229 public void setFamilyClass(short familyClassValue) 230 { 231 this.familyClass = familyClassValue; 232 } 233 236 public int getFirstCharIndex() 237 { 238 return firstCharIndex; 239 } 240 243 public void setFirstCharIndex(int firstCharIndexValue) 244 { 245 this.firstCharIndex = firstCharIndexValue; 246 } 247 250 public int getFsSelection() 251 { 252 return fsSelection; 253 } 254 257 public void setFsSelection(int fsSelectionValue) 258 { 259 this.fsSelection = fsSelectionValue; 260 } 261 264 public short getFsType() 265 { 266 return fsType; 267 } 268 271 public void setFsType(short fsTypeValue) 272 { 273 this.fsType = fsTypeValue; 274 } 275 278 public int getLastCharIndex() 279 { 280 return lastCharIndex; 281 } 282 285 public void setLastCharIndex(int lastCharIndexValue) 286 { 287 this.lastCharIndex = lastCharIndexValue; 288 } 289 292 public byte[] getPanose() 293 { 294 return panose; 295 } 296 299 public void setPanose(byte[] panoseValue) 300 { 301 this.panose = panoseValue; 302 } 303 306 public short getStrikeoutPosition() 307 { 308 return strikeoutPosition; 309 } 310 313 public void setStrikeoutPosition(short strikeoutPositionValue) 314 { 315 this.strikeoutPosition = strikeoutPositionValue; 316 } 317 320 public short getStrikeoutSize() 321 { 322 return strikeoutSize; 323 } 324 327 public void setStrikeoutSize(short strikeoutSizeValue) 328 { 329 this.strikeoutSize = strikeoutSizeValue; 330 } 331 334 public short getSubscriptXOffset() 335 { 336 return subscriptXOffset; 337 } 338 341 public void setSubscriptXOffset(short subscriptXOffsetValue) 342 { 343 this.subscriptXOffset = subscriptXOffsetValue; 344 } 345 348 public short getSubscriptXSize() 349 { 350 return subscriptXSize; 351 } 352 355 public void setSubscriptXSize(short subscriptXSizeValue) 356 { 357 this.subscriptXSize = subscriptXSizeValue; 358 } 359 362 public short getSubscriptYOffset() 363 { 364 return subscriptYOffset; 365 } 366 369 public void setSubscriptYOffset(short subscriptYOffsetValue) 370 { 371 this.subscriptYOffset = subscriptYOffsetValue; 372 } 373 376 public short getSubscriptYSize() 377 { 378 return subscriptYSize; 379 } 380 383 public void setSubscriptYSize(short subscriptYSizeValue) 384 { 385 this.subscriptYSize = subscriptYSizeValue; 386 } 387 390 public short getSuperscriptXOffset() 391 { 392 return superscriptXOffset; 393 } 394 397 public void setSuperscriptXOffset(short superscriptXOffsetValue) 398 { 399 this.superscriptXOffset = superscriptXOffsetValue; 400 } 401 404 public short getSuperscriptXSize() 405 { 406 return superscriptXSize; 407 } 408 411 public void setSuperscriptXSize(short superscriptXSizeValue) 412 { 413 this.superscriptXSize = superscriptXSizeValue; 414 } 415 418 public short getSuperscriptYOffset() 419 { 420 return superscriptYOffset; 421 } 422 425 public void setSuperscriptYOffset(short superscriptYOffsetValue) 426 { 427 this.superscriptYOffset = superscriptYOffsetValue; 428 } 429 432 public short getSuperscriptYSize() 433 { 434 return superscriptYSize; 435 } 436 439 public void setSuperscriptYSize(short superscriptYSizeValue) 440 { 441 this.superscriptYSize = superscriptYSizeValue; 442 } 443 446 public int getTypeLineGap() 447 { 448 return typeLineGap; 449 } 450 453 public void setTypeLineGap(int typeLineGapValue) 454 { 455 this.typeLineGap = typeLineGapValue; 456 } 457 460 public int getTypoAscender() 461 { 462 return typoAscender; 463 } 464 467 public void setTypoAscender(int typoAscenderValue) 468 { 469 this.typoAscender = typoAscenderValue; 470 } 471 474 public int getTypoDescender() 475 { 476 return typoDescender; 477 } 478 481 public void setTypoDescender(int typoDescenderValue) 482 { 483 this.typoDescender = typoDescenderValue; 484 } 485 488 public long getUnicodeRange1() 489 { 490 return unicodeRange1; 491 } 492 495 public void setUnicodeRange1(long unicodeRange1Value) 496 { 497 this.unicodeRange1 = unicodeRange1Value; 498 } 499 502 public long getUnicodeRange2() 503 { 504 return unicodeRange2; 505 } 506 509 public void setUnicodeRange2(long unicodeRange2Value) 510 { 511 this.unicodeRange2 = unicodeRange2Value; 512 } 513 516 public long getUnicodeRange3() 517 { 518 return unicodeRange3; 519 } 520 523 public void setUnicodeRange3(long unicodeRange3Value) 524 { 525 this.unicodeRange3 = unicodeRange3Value; 526 } 527 530 public long getUnicodeRange4() 531 { 532 return unicodeRange4; 533 } 534 537 public void setUnicodeRange4(long unicodeRange4Value) 538 { 539 this.unicodeRange4 = unicodeRange4Value; 540 } 541 544 public int getVersion() 545 { 546 return version; 547 } 548 551 public void setVersion(int versionValue) 552 { 553 this.version = versionValue; 554 } 555 558 public int getWeightClass() 559 { 560 return weightClass; 561 } 562 565 public void setWeightClass(int weightClassValue) 566 { 567 this.weightClass = weightClassValue; 568 } 569 572 public int getWidthClass() 573 { 574 return widthClass; 575 } 576 579 public void setWidthClass(int widthClassValue) 580 { 581 this.widthClass = widthClassValue; 582 } 583 586 public int getWinAscent() 587 { 588 return winAscent; 589 } 590 593 public void setWinAscent(int winAscentValue) 594 { 595 this.winAscent = winAscentValue; 596 } 597 600 public int getWinDescent() 601 { 602 return winDescent; 603 } 604 607 public void setWinDescent(int winDescentValue) 608 { 609 this.winDescent = winDescentValue; 610 } 611 private int version; 612 private short averageCharWidth; 613 private int weightClass; 614 private int widthClass; 615 private short fsType; 616 private short subscriptXSize; 617 private short subscriptYSize; 618 private short subscriptXOffset; 619 private short subscriptYOffset; 620 private short superscriptXSize; 621 private short superscriptYSize; 622 private short superscriptXOffset; 623 private short superscriptYOffset; 624 private short strikeoutSize; 625 private short strikeoutPosition; 626 private short familyClass; 627 private byte[] panose = new byte[10]; 628 private long unicodeRange1; 629 private long unicodeRange2; 630 private long unicodeRange3; 631 private long unicodeRange4; 632 private String achVendId; 633 private int fsSelection; 634 private int firstCharIndex; 635 private int lastCharIndex; 636 private int typoAscender; 637 private int typoDescender; 638 private int typeLineGap; 639 private int winAscent; 640 private int winDescent; 641 private long codePageRange1 = -1; 642 private long codePageRange2 = -1; 643 644 647 public static final String TAG = "OS/2"; 648 649 656 public void initData( TrueTypeFont ttf, TTFDataStream data ) throws IOException 657 { 658 version = data.readUnsignedShort(); 659 averageCharWidth = data.readSignedShort(); 660 weightClass = data.readUnsignedShort(); 661 widthClass = data.readUnsignedShort(); 662 fsType = data.readSignedShort(); 663 subscriptXSize = data.readSignedShort(); 664 subscriptYSize = data.readSignedShort(); 665 subscriptXOffset = data.readSignedShort(); 666 subscriptYOffset = data.readSignedShort(); 667 superscriptXSize = data.readSignedShort(); 668 superscriptYSize = data.readSignedShort(); 669 superscriptXOffset = data.readSignedShort(); 670 superscriptYOffset = data.readSignedShort(); 671 strikeoutSize = data.readSignedShort(); 672 strikeoutPosition = data.readSignedShort(); 673 familyClass = data.readSignedShort(); 674 panose = data.read( 10 ); 675 unicodeRange1 = data.readUnsignedInt(); 676 unicodeRange2 = data.readUnsignedInt(); 677 unicodeRange3 = data.readUnsignedInt(); 678 unicodeRange4 = data.readUnsignedInt(); 679 achVendId = data.readString( 4 ); 680 fsSelection = data.readUnsignedShort(); 681 firstCharIndex = data.readUnsignedShort(); 682 lastCharIndex = data.readUnsignedShort(); 683 typoAscender = data.readSignedShort(); 684 typoDescender = data.readSignedShort(); 685 typeLineGap = data.readSignedShort(); 686 winAscent = data.readUnsignedShort(); 687 winDescent = data.readUnsignedShort(); 688 if( version >= 1 ) 689 { 690 codePageRange1 = data.readUnsignedInt(); 691 codePageRange2 = data.readUnsignedInt(); 692 } 693 } 694 } 695 | Popular Tags |