444 * The length of the metrics array must be >= 4. This method will
445 * store the following elements in that array before returning:
446 * metrics[0]: ascent
447 * metrics[1]: descent
448 * metrics[2]: leading
449 * metrics[3]: max advance
450 */
451 public void getFontMetrics(Font font, FontRenderContext frc,
452 float metrics[]) {
453 StrikeMetrics strikeMetrics = getStrike(font, frc).getFontMetrics();
454 metrics[0] = strikeMetrics.getAscent();
455 metrics[1] = strikeMetrics.getDescent();
456 metrics[2] = strikeMetrics.getLeading();
457 metrics[3] = strikeMetrics.getMaxAdvance();
458 }
459
460 /* Currently the layout code calls this. May be better for layout code
461 * to check the font class before attempting to run, rather than needing
462 * to promote this method up from TrueTypeFont
463 */
464 byte[] getTableBytes(int tag) {
465 return null;
466 }
467
468 /* for layout code */
469 protected long getUnitsPerEm() {
470 return 2048;
471 }
472
473 boolean supportsEncoding(String encoding) {
474 return false;
475 }
476
477 public boolean canDoStyle(int style) {
478 return (style == this.style);
479 }
480
481 /*
482 * All the important subclasses override this which is principally for
483 * the TrueType 'gasp' table.
484 */
485 public boolean useAAForPtSize(int ptsize) {
486 return true;
487 }
|
444 * The length of the metrics array must be >= 4. This method will
445 * store the following elements in that array before returning:
446 * metrics[0]: ascent
447 * metrics[1]: descent
448 * metrics[2]: leading
449 * metrics[3]: max advance
450 */
451 public void getFontMetrics(Font font, FontRenderContext frc,
452 float metrics[]) {
453 StrikeMetrics strikeMetrics = getStrike(font, frc).getFontMetrics();
454 metrics[0] = strikeMetrics.getAscent();
455 metrics[1] = strikeMetrics.getDescent();
456 metrics[2] = strikeMetrics.getLeading();
457 metrics[3] = strikeMetrics.getMaxAdvance();
458 }
459
460 /* Currently the layout code calls this. May be better for layout code
461 * to check the font class before attempting to run, rather than needing
462 * to promote this method up from TrueTypeFont
463 */
464 protected byte[] getTableBytes(int tag) {
465 return null;
466 }
467
468 /* implemented for fonts backed by an sfnt that has
469 * OpenType or AAT layout tables.
470 */
471 protected long getLayoutTableCache() {
472 return 0L;
473 }
474
475 /* for layout code */
476 protected long getUnitsPerEm() {
477 return 2048;
478 }
479
480 boolean supportsEncoding(String encoding) {
481 return false;
482 }
483
484 public boolean canDoStyle(int style) {
485 return (style == this.style);
486 }
487
488 /*
489 * All the important subclasses override this which is principally for
490 * the TrueType 'gasp' table.
491 */
492 public boolean useAAForPtSize(int ptsize) {
493 return true;
494 }
|