39 |
package java.awt; |
package java.awt; |
40 |
|
|
41 |
import java.awt.font.FontRenderContext; |
import java.awt.font.FontRenderContext; |
42 |
|
import java.awt.font.GlyphVector; |
43 |
import java.awt.font.LineMetrics; |
import java.awt.font.LineMetrics; |
44 |
|
import java.awt.font.TextAttribute; |
45 |
|
import java.awt.geom.AffineTransform; |
46 |
|
import java.awt.geom.Rectangle2D; |
47 |
import java.awt.peer.FontPeer; |
import java.awt.peer.FontPeer; |
48 |
|
import java.io.InputStream; |
49 |
|
import java.io.IOException; |
50 |
import java.io.Serializable; |
import java.io.Serializable; |
51 |
|
import java.util.Locale; |
52 |
|
import java.util.Map; |
53 |
import java.util.StringTokenizer; |
import java.util.StringTokenizer; |
54 |
|
import java.text.CharacterIterator; |
55 |
|
import java.text.AttributedCharacterIterator; |
56 |
|
|
57 |
/** |
/** |
58 |
* This class represents a windowing system font. |
* This class represents a windowing system font. |
82 |
*/ |
*/ |
83 |
public static final int ITALIC = 2; |
public static final int ITALIC = 2; |
84 |
|
|
85 |
|
/** |
86 |
|
* Constant indicating the baseline mode characteristic of Roman. |
87 |
|
*/ |
88 |
public static final int ROMAN_BASELINE = 0; |
public static final int ROMAN_BASELINE = 0; |
89 |
|
|
90 |
|
/** |
91 |
|
* Constant indicating the baseline mode characteristic of Chinese. |
92 |
|
*/ |
93 |
public static final int CENTER_BASELINE = 1; |
public static final int CENTER_BASELINE = 1; |
94 |
public static final int HANGING_BASELINE = 2; |
|
95 |
|
/** |
96 |
|
* Constant indicating the baseline mode characteristic of Devanigri. |
97 |
|
*/ |
98 |
|
public static final int HANGING_BASELINE = 2; |
99 |
|
|
100 |
|
|
101 |
/** |
/** |
315 |
this.pointSize = size; |
this.pointSize = size; |
316 |
} |
} |
317 |
|
|
318 |
|
public |
319 |
|
Font(Map attributes) |
320 |
|
{ |
321 |
|
throw new UnsupportedOperationException(); |
322 |
|
} |
323 |
|
|
324 |
/*************************************************************************/ |
/*************************************************************************/ |
325 |
|
|
326 |
/* |
/* |
328 |
*/ |
*/ |
329 |
|
|
330 |
/** |
/** |
331 |
* Returns the name of the font. |
* Returns the logical name of the font. A logical name describes a very |
332 |
|
* general typographic style (such as Sans Serif). It is less specific |
333 |
|
* than both a font family name (such as Helvetica) and a font face name |
334 |
|
* (such as Helvetica Bold). |
335 |
* |
* |
336 |
* @return The name of the font. |
* @return The logical name of the font. |
337 |
|
* |
338 |
|
* @see getFamily() |
339 |
|
* @see getFontName() |
340 |
*/ |
*/ |
341 |
public String |
public String |
342 |
getName() |
getName() |
418 |
/*************************************************************************/ |
/*************************************************************************/ |
419 |
|
|
420 |
/** |
/** |
421 |
* Returns the system specific font family name. |
* Returns the family name of this font. A family name describes a |
422 |
|
* typographic style (such as Helvetica or Palatino). It is more specific |
423 |
|
* than a logical font name (such as Sans Serif) but less specific than a |
424 |
|
* font face name (such as Helvetica Bold). |
425 |
|
* |
426 |
|
* @return A string containing the font family name. |
427 |
|
* |
428 |
|
* @since 1.2 |
429 |
* |
* |
430 |
* @return The system specific font family name. |
* @see getName() |
431 |
|
* @see getFontName() |
432 |
|
* @see GraphicsEnvironment.getAvailableFontFamilyNames() |
433 |
*/ |
*/ |
434 |
public String |
public String |
435 |
getFamily() |
getFamily() |
438 |
return(name); |
return(name); |
439 |
} |
} |
440 |
|
|
441 |
|
/** |
442 |
|
* Returns integer code representing the sum of style flags of this font, a |
443 |
|
* combination of either {@link PLAIN}, {@link BOLD}, or {@link ITALIC}. |
444 |
|
* |
445 |
|
* @return code representing the style of this font. |
446 |
|
* |
447 |
|
* @see isPlain() |
448 |
|
* @see isBold() |
449 |
|
* @see isItalic() |
450 |
|
*/ |
451 |
public int |
public int |
452 |
getStyle() |
getStyle() |
453 |
{ |
{ |
454 |
return style; |
return style; |
455 |
} |
} |
456 |
|
|
457 |
|
/** |
458 |
|
* Checks if specified character maps to a glyph in this font. |
459 |
|
* |
460 |
|
* @param c The character to check. |
461 |
|
* |
462 |
|
* @return Whether the character has a corresponding glyph in this font. |
463 |
|
* |
464 |
|
* @since 1.2 |
465 |
|
*/ |
466 |
|
public boolean |
467 |
|
canDisplay(char c) |
468 |
|
{ |
469 |
|
throw new UnsupportedOperationException (); |
470 |
|
} |
471 |
|
|
472 |
|
/** |
473 |
|
* Checks how much of a given string can be mapped to glyphs in |
474 |
|
* this font. |
475 |
|
* |
476 |
|
* @param s The string to check. |
477 |
|
* |
478 |
|
* @return The index of the first character in <code>s</code> which cannot |
479 |
|
* be converted to a glyph by this font, or <code>-1</code> if all |
480 |
|
* characters can be mapped to glyphs. |
481 |
|
* |
482 |
|
* @since 1.2 |
483 |
|
*/ |
484 |
|
public int |
485 |
|
canDisplayUpTo(String s) |
486 |
|
{ |
487 |
|
throw new UnsupportedOperationException (); |
488 |
|
} |
489 |
|
|
490 |
|
/** |
491 |
|
* Checks how much of a given sequence of text can be mapped to glyphs in |
492 |
|
* this font. |
493 |
|
* |
494 |
|
* @param text Array containing the text to check. |
495 |
|
* @param start Position of first character to check in <code>text</code>. |
496 |
|
* @param limit Position of last character to check in <code>text</code>. |
497 |
|
* |
498 |
|
* @return The index of the first character in the indicated range which |
499 |
|
* cannot be converted to a glyph by this font, or <code>-1</code> if all |
500 |
|
* characters can be mapped to glyphs. |
501 |
|
* |
502 |
|
* @since 1.2 |
503 |
|
* |
504 |
|
* @throws IndexOutOfBoundsException if the range [start, limit] is |
505 |
|
* invalid in <code>text</code>. |
506 |
|
*/ |
507 |
|
public int |
508 |
|
canDisplayUpTo(char[] text, int start, int limit) |
509 |
|
{ |
510 |
|
throw new UnsupportedOperationException (); |
511 |
|
} |
512 |
|
|
513 |
|
/** |
514 |
|
* Checks how much of a given sequence of text can be mapped to glyphs in |
515 |
|
* this font. |
516 |
|
* |
517 |
|
* @param i Iterator over the text to check. |
518 |
|
* @param start Position of first character to check in <code>i</code>. |
519 |
|
* @param limit Position of last character to check in <code>i</code>. |
520 |
|
* |
521 |
|
* @return The index of the first character in the indicated range which |
522 |
|
* cannot be converted to a glyph by this font, or <code>-1</code> if all |
523 |
|
* characters can be mapped to glyphs. |
524 |
|
* |
525 |
|
* @since 1.2 |
526 |
|
* |
527 |
|
* @throws IndexOutOfBoundsException if the range [start, limit] is |
528 |
|
* invalid in <code>i</code>. |
529 |
|
*/ |
530 |
|
public int |
531 |
|
canDisplayUpTo(CharacterIterator i, int start, int limit) |
532 |
|
{ |
533 |
|
throw new UnsupportedOperationException (); |
534 |
|
} |
535 |
|
|
536 |
|
/** |
537 |
|
* Creates a new font with point size 1 and {@link PLAIN} style, |
538 |
|
* reading font data from the provided input stream. The resulting font |
539 |
|
* can have further fonts derived from it using its |
540 |
|
* <code>deriveFont</code> method. |
541 |
|
* |
542 |
|
* @param fontFormat Integer code indicating the format the font data is |
543 |
|
* in.Currently this can only be {@link TRUETYPE_FONT}. |
544 |
|
* @param is {@link InputStream} from which font data will be read. This |
545 |
|
* stream is not closed after font data is extracted. |
546 |
|
* |
547 |
|
* @return A new {@link Font} of the format indicated. |
548 |
|
* |
549 |
|
* @throws IllegalArgumentException if <code>fontType</code> is not |
550 |
|
* recognized. |
551 |
|
* @throws FontFormatException if data in InputStream is not of format |
552 |
|
* indicated. |
553 |
|
* @throws IOException if insufficient data is present on InputStream. |
554 |
|
* |
555 |
|
* @since 1.3 |
556 |
|
*/ |
557 |
|
public static Font |
558 |
|
createFont(int fontFormat, InputStream is) |
559 |
|
throws FontFormatException, IOException |
560 |
|
{ |
561 |
|
throw new UnsupportedOperationException (); |
562 |
|
} |
563 |
|
|
564 |
|
/** |
565 |
|
* Maps characters to glyphs in a one-to-one relationship, returning a new |
566 |
|
* {@link GlyphVector} with a mapped glyph for each input character. This |
567 |
|
* sort of mapping is often sufficient for some scripts such as Roman, but |
568 |
|
* is inappropriate for scripts with special shaping or contextual layout |
569 |
|
* requirements such as Arabic, Indic, Hebrew or Thai. |
570 |
|
* |
571 |
|
* @param ctx The rendering context used for precise glyph placement. |
572 |
|
* @param str The string to convert to Glyphs. |
573 |
|
* |
574 |
|
* @return A new {@link GlyphVector} containing glyphs mapped from str, |
575 |
|
* through the font's cmap table. |
576 |
|
* |
577 |
|
* @see layoutGlyphVector() |
578 |
|
*/ |
579 |
|
public GlyphVector |
580 |
|
createGlyphVector(FontRenderContext ctx, String str) |
581 |
|
{ |
582 |
|
throw new UnsupportedOperationException (); |
583 |
|
} |
584 |
|
|
585 |
|
/** |
586 |
|
* Maps characters to glyphs in a one-to-one relationship, returning a new |
587 |
|
* {@link GlyphVector} with a mapped glyph for each input character. This |
588 |
|
* sort of mapping is often sufficient for some scripts such as Roman, but |
589 |
|
* is inappropriate for scripts with special shaping or contextual layout |
590 |
|
* requirements such as Arabic, Indic, Hebrew or Thai. |
591 |
|
* |
592 |
|
* @param ctx The rendering context used for precise glyph placement. |
593 |
|
* @param i Iterator over the text to convert to glyphs. |
594 |
|
* |
595 |
|
* @return A new {@link GlyphVector} containing glyphs mapped from str, |
596 |
|
* through the font's cmap table. |
597 |
|
* |
598 |
|
* @see layoutGlyphVector() |
599 |
|
*/ |
600 |
|
public GlyphVector |
601 |
|
createGlyphVector(FontRenderContext ctx, CharacterIterator i) |
602 |
|
{ |
603 |
|
throw new UnsupportedOperationException (); |
604 |
|
} |
605 |
|
|
606 |
|
/** |
607 |
|
* Maps characters to glyphs in a one-to-one relationship, returning a new |
608 |
|
* {@link GlyphVector} with a mapped glyph for each input character. This |
609 |
|
* sort of mapping is often sufficient for some scripts such as Roman, but |
610 |
|
* is inappropriate for scripts with special shaping or contextual layout |
611 |
|
* requirements such as Arabic, Indic, Hebrew or Thai. |
612 |
|
* |
613 |
|
* @param ctx The rendering context used for precise glyph placement. |
614 |
|
* @param chars Array of characters to convert to glyphs. |
615 |
|
* |
616 |
|
* @return A new {@link GlyphVector} containing glyphs mapped from str, |
617 |
|
* through the font's cmap table. |
618 |
|
* |
619 |
|
* @see layoutGlyphVector() |
620 |
|
*/ |
621 |
|
public GlyphVector |
622 |
|
createGlyphVector(FontRenderContext ctx, char[] chars) |
623 |
|
{ |
624 |
|
throw new UnsupportedOperationException (); |
625 |
|
} |
626 |
|
|
627 |
|
/** |
628 |
|
* Extracts a sequence of glyphs from a font, returning a new {@link |
629 |
|
* GlyphVector} with a mapped glyph for each input glyph code. |
630 |
|
* |
631 |
|
* @param ctx The rendering context used for precise glyph placement. |
632 |
|
* @param chars Array of characters to convert to glyphs. |
633 |
|
* |
634 |
|
* @return A new {@link GlyphVector} containing glyphs mapped from str, |
635 |
|
* through the font's cmap table. |
636 |
|
* |
637 |
|
* @see layoutGlyphVector() |
638 |
|
* |
639 |
|
* @specnote This method is documented to perform character-to-glyph |
640 |
|
* conversions, in the Sun documentation, but its second parameter name is |
641 |
|
* "glyphCodes" and it is not clear to me why it would exist if its |
642 |
|
* purpose was to transport character codes inside integers. I assume it |
643 |
|
* is mis-documented in the Sun documentation. |
644 |
|
*/ |
645 |
|
public GlyphVector |
646 |
|
createGlyphVector(FontRenderContext ctx, int[] glyphCodes) |
647 |
|
{ |
648 |
|
throw new UnsupportedOperationException (); |
649 |
|
} |
650 |
|
|
651 |
|
/** |
652 |
|
* Produces a new {@link Font} based on the current font, adjusted to a |
653 |
|
* new size. |
654 |
|
* |
655 |
|
* @param size The size of the newly created font. |
656 |
|
* |
657 |
|
* @return A clone of the current font, with the specified size. |
658 |
|
* |
659 |
|
* @since 1.2 |
660 |
|
*/ |
661 |
|
public Font |
662 |
|
deriveFont(float size) |
663 |
|
{ |
664 |
|
throw new UnsupportedOperationException (); |
665 |
|
} |
666 |
|
|
667 |
|
/** |
668 |
|
* Produces a new {@link Font} based on the current font, adjusted to a |
669 |
|
* new style. |
670 |
|
* |
671 |
|
* @param style The style of the newly created font. |
672 |
|
* |
673 |
|
* @return A clone of the current font, with the specified style. |
674 |
|
* |
675 |
|
* @since 1.2 |
676 |
|
*/ |
677 |
|
public Font |
678 |
|
deriveFont(int style) |
679 |
|
{ |
680 |
|
throw new UnsupportedOperationException (); |
681 |
|
} |
682 |
|
|
683 |
|
/** |
684 |
|
* Produces a new {@link Font} based on the current font, adjusted to a |
685 |
|
* new style and subjected to a new affine transformation. |
686 |
|
* |
687 |
|
* @param style The style of the newly created font. |
688 |
|
* @param a The transformation to apply. |
689 |
|
* |
690 |
|
* @return A clone of the current font, with the specified style and |
691 |
|
* transform. |
692 |
|
* |
693 |
|
* @throws IllegalArgumentException If transformation is |
694 |
|
* <code>null</code>. |
695 |
|
* |
696 |
|
* @since 1.2 |
697 |
|
*/ |
698 |
|
public Font |
699 |
|
deriveFont(int style, AffineTransform a) |
700 |
|
{ |
701 |
|
throw new UnsupportedOperationException (); |
702 |
|
} |
703 |
|
|
704 |
|
/** |
705 |
|
* Produces a new {@link Font} based on the current font, adjusted to a |
706 |
|
* new set of attributes. |
707 |
|
* |
708 |
|
* @param attributes Attributes of the newly created font. |
709 |
|
* |
710 |
|
* @return A clone of the current font, with the specified attributes. |
711 |
|
* |
712 |
|
* @since 1.2 |
713 |
|
*/ |
714 |
|
public Font |
715 |
|
deriveFont(Map attributes) |
716 |
|
{ |
717 |
|
throw new UnsupportedOperationException (); |
718 |
|
} |
719 |
|
|
720 |
|
/** |
721 |
|
* Returns a map of chracter attributes which this font currently has set. |
722 |
|
* |
723 |
|
* @return A map of chracter attributes which this font currently has set. |
724 |
|
* |
725 |
|
* @see getAvailableAttributes() |
726 |
|
* @see java.text.AttributedCharacterIterator.Attribute |
727 |
|
* @see java.awt.font.TextAttribute |
728 |
|
*/ |
729 |
|
public Map |
730 |
|
getAttributes() |
731 |
|
{ |
732 |
|
throw new UnsupportedOperationException (); |
733 |
|
} |
734 |
|
|
735 |
|
/** |
736 |
|
* Returns an array of chracter attribute keys which this font understands. |
737 |
|
* |
738 |
|
* @return An array of chracter attribute keys which this font understands. |
739 |
|
* |
740 |
|
* @see getAttributes() |
741 |
|
* @see java.text.AttributedCharacterIterator.Attribute |
742 |
|
* @see java.awt.font.TextAttribute |
743 |
|
*/ |
744 |
|
public AttributedCharacterIterator.Attribute[] |
745 |
|
getAvailableAttributes() |
746 |
|
{ |
747 |
|
throw new UnsupportedOperationException (); |
748 |
|
} |
749 |
|
|
750 |
|
/** |
751 |
|
* Returns a baseline code (one of {@link ROMAN_BASELINE}, {@link |
752 |
|
* CENTER_BASELINE} or {@link HANGING_BASELINE}) indicating which baseline |
753 |
|
* this font will measure baseline offsets for, when presenting glyph |
754 |
|
* metrics for a given character. |
755 |
|
* |
756 |
|
* Baseline offsets describe the position of a glyph relative to an |
757 |
|
* invisible line drawn under, through the center of, or over a line of |
758 |
|
* rendered text, respectively. Different scripts use different baseline |
759 |
|
* modes, so clients should not assume all baseline offsets in a glyph |
760 |
|
* vector are from a common baseline. |
761 |
|
* |
762 |
|
* @param c The character code to select a baseline mode for. |
763 |
|
* |
764 |
|
* @return The baseline mode which would be used in a glyph associated |
765 |
|
* with the provided character. |
766 |
|
* |
767 |
|
* @since 1.2 |
768 |
|
* |
769 |
|
* @see LineMetrics.getBaselineOffsets() |
770 |
|
*/ |
771 |
|
public byte |
772 |
|
getBaselineFor(char c) |
773 |
|
{ |
774 |
|
throw new UnsupportedOperationException (); |
775 |
|
} |
776 |
|
|
777 |
|
/** |
778 |
|
* Returns the family name of this font. A family name describes a |
779 |
|
* typographic style (such as Helvetica or Palatino). It is more specific |
780 |
|
* than a logical font name (such as Sans Serif) but less specific than a |
781 |
|
* font face name (such as Helvetica Bold). |
782 |
|
* |
783 |
|
* @param lc The locale in which to describe the name of the font family. |
784 |
|
* |
785 |
|
* @return A string containing the font family name, localized for the |
786 |
|
* provided locale. |
787 |
|
* |
788 |
|
* @since 1.2 |
789 |
|
* |
790 |
|
* @see getName() |
791 |
|
* @see getFontName() |
792 |
|
* @see GraphicsEnvironment.getAvailableFontFamilyNames() |
793 |
|
* @see Locale |
794 |
|
*/ |
795 |
|
public String |
796 |
|
getFamily(Locale lc) |
797 |
|
{ |
798 |
|
throw new UnsupportedOperationException (); |
799 |
|
} |
800 |
|
|
801 |
|
/** |
802 |
|
* Returns a font appropriate for the given attribute set. |
803 |
|
* |
804 |
|
* @param attributes The attributes required for the new font. |
805 |
|
* |
806 |
|
* @return A new Font with the given attributes. |
807 |
|
* |
808 |
|
* @since 1.2 |
809 |
|
* |
810 |
|
* @see TextAttribure |
811 |
|
*/ |
812 |
|
public static Font |
813 |
|
getFont(Map attributes) |
814 |
|
{ |
815 |
|
throw new UnsupportedOperationException (); |
816 |
|
} |
817 |
|
|
818 |
|
/** |
819 |
|
* Returns the font face name of the font. A font face name describes a |
820 |
|
* specific variant of a font family (such as Helvetica Bold). It is more |
821 |
|
* specific than both a font family name (such as Helvetica) and a logical |
822 |
|
* font name (such as Sans Serif). |
823 |
|
* |
824 |
|
* @return The font face name of the font. |
825 |
|
* |
826 |
|
* @since 1.2 |
827 |
|
* |
828 |
|
* @see getName() |
829 |
|
* @see getFamily() |
830 |
|
*/ |
831 |
|
public String |
832 |
|
getFontName() |
833 |
|
{ |
834 |
|
throw new UnsupportedOperationException (); |
835 |
|
} |
836 |
|
|
837 |
|
/** |
838 |
|
* Returns the font face name of the font. A font face name describes a |
839 |
|
* specific variant of a font family (such as Helvetica Bold). It is more |
840 |
|
* specific than both a font family name (such as Helvetica) and a logical |
841 |
|
* font name (such as Sans Serif). |
842 |
|
* |
843 |
|
* @param lc The locale in which to describe the name of the font face. |
844 |
|
* |
845 |
|
* @return A string containing the font face name, localized for the |
846 |
|
* provided locale. |
847 |
|
* |
848 |
|
* @since 1.2 |
849 |
|
* |
850 |
|
* @see getName() |
851 |
|
* @see getFamily() |
852 |
|
*/ |
853 |
|
public String |
854 |
|
getFontName(Locale lc) |
855 |
|
{ |
856 |
|
throw new UnsupportedOperationException (); |
857 |
|
} |
858 |
|
|
859 |
|
/** |
860 |
|
* Returns the italic angle of this font, a measurement of its slant when |
861 |
|
* style is {@link ITALIC}. The precise meaning is the inverse slope of a |
862 |
|
* caret line which "best measures" the font's italic posture. |
863 |
|
* |
864 |
|
* @return The italic angle. |
865 |
|
* |
866 |
|
* @see TextAttribute.POSTURE |
867 |
|
*/ |
868 |
|
public float |
869 |
|
getItalicAngle() |
870 |
|
{ |
871 |
|
throw new UnsupportedOperationException (); |
872 |
|
} |
873 |
|
|
874 |
|
/** |
875 |
|
* Returns a {@link LineMetrics} object constructed with the specified |
876 |
|
* text and {@link FontRenderContext}. |
877 |
|
* |
878 |
|
* @param text The string to calculate metrics from. |
879 |
|
* @param begin Index of first character in <code>text</code> to measure. |
880 |
|
* @param limit Index of last character in <code>text</code> to measure. |
881 |
|
* @param rc Context for calculating precise glyph placement and hints. |
882 |
|
* |
883 |
|
* @return A new {@link LineMetrics} object. |
884 |
|
* |
885 |
|
* @throws IndexOutOfBoundsException if the range [begin, limit] is |
886 |
|
* invalid in <code>text</code>. |
887 |
|
*/ |
888 |
|
public LineMetrics |
889 |
|
getLineMetrics(String text, int begin, int limit, FontRenderContext rc) |
890 |
|
{ |
891 |
|
throw new UnsupportedOperationException (); |
892 |
|
} |
893 |
|
|
894 |
|
/** |
895 |
|
* Returns a {@link LineMetrics} object constructed with the specified |
896 |
|
* text and {@link FontRenderContext}. |
897 |
|
* |
898 |
|
* @param chars The string to calculate metrics from. |
899 |
|
* @param begin Index of first character in <code>text</code> to measure. |
900 |
|
* @param limit Index of last character in <code>text</code> to measure. |
901 |
|
* @param rc Context for calculating precise glyph placement and hints. |
902 |
|
* |
903 |
|
* @return A new {@link LineMetrics} object. |
904 |
|
* |
905 |
|
* @throws IndexOutOfBoundsException if the range [begin, limit] is |
906 |
|
* invalid in <code>chars</code>. |
907 |
|
*/ |
908 |
|
public LineMetrics |
909 |
|
getLineMetrics(char[] chars, int begin, int limit, FontRenderContext rc) |
910 |
|
{ |
911 |
|
throw new UnsupportedOperationException (); |
912 |
|
} |
913 |
|
|
914 |
|
/** |
915 |
|
* Returns a {@link LineMetrics} object constructed with the specified |
916 |
|
* text and {@link FontRenderContext}. |
917 |
|
* |
918 |
|
* @param ci The string to calculate metrics from. |
919 |
|
* @param begin Index of first character in <code>text</code> to measure. |
920 |
|
* @param limit Index of last character in <code>text</code> to measure. |
921 |
|
* @param rc Context for calculating precise glyph placement and hints. |
922 |
|
* |
923 |
|
* @return A new {@link LineMetrics} object. |
924 |
|
* |
925 |
|
* @throws IndexOutOfBoundsException if the range [begin, limit] is |
926 |
|
* invalid in <code>ci</code>. |
927 |
|
*/ |
928 |
|
public LineMetrics |
929 |
|
getLineMetrics(CharacterIterator ci, int begin, int limit, FontRenderContext rc) |
930 |
|
{ |
931 |
|
throw new UnsupportedOperationException (); |
932 |
|
} |
933 |
|
|
934 |
|
/** |
935 |
|
* Returns the maximal bounding box of all the bounding boxes in this |
936 |
|
* font, when the font's bounding boxes are evaluated in a given {@link |
937 |
|
* FontRenderContext} |
938 |
|
* |
939 |
|
* @param rc Context in which to evaluate bounding boxes. |
940 |
|
* |
941 |
|
* @return The maximal bounding box. |
942 |
|
*/ |
943 |
|
public Rectangle2D |
944 |
|
getMaxCharBounds(FontRenderContext rc) |
945 |
|
{ |
946 |
|
throw new UnsupportedOperationException (); |
947 |
|
} |
948 |
|
|
949 |
|
/** |
950 |
|
* Returns the glyph code this font uses to represent missing glyphs. This |
951 |
|
* code will be present in glyph vectors when the font was unable to |
952 |
|
* locate a glyph to represent a particular character code. |
953 |
|
* |
954 |
|
* @return The missing glyph code. |
955 |
|
* |
956 |
|
* @since 1.2 |
957 |
|
*/ |
958 |
|
public int |
959 |
|
getMissingGlyphCode() |
960 |
|
{ |
961 |
|
throw new UnsupportedOperationException (); |
962 |
|
} |
963 |
|
|
964 |
|
/** |
965 |
|
* Returns the overall number of glyphs in this font. This number is one |
966 |
|
* more than the greatest glyph code used in any glyph vectors this font |
967 |
|
* produces. In other words, glyph codes are taken from the range |
968 |
|
* <code>[ 0, getNumGlyphs() - 1 ]</code>. |
969 |
|
* |
970 |
|
* @return The number of glyphs in this font. |
971 |
|
* |
972 |
|
* @since 1.2 |
973 |
|
*/ |
974 |
|
public int |
975 |
|
getNumGlyphs() |
976 |
|
{ |
977 |
|
throw new UnsupportedOperationException (); |
978 |
|
} |
979 |
|
|
980 |
|
/** |
981 |
|
* Returns the PostScript Name of this font. |
982 |
|
* |
983 |
|
* @return The PostScript Name of this font. |
984 |
|
* |
985 |
|
* @since 1.2 |
986 |
|
* |
987 |
|
* @see getName() |
988 |
|
* @see getFamily() |
989 |
|
* @see getFontName() |
990 |
|
*/ |
991 |
|
public String |
992 |
|
getPSName() |
993 |
|
{ |
994 |
|
throw new UnsupportedOperationException (); |
995 |
|
} |
996 |
|
|
997 |
|
/** |
998 |
|
* Returns the logical bounds of the specified string when rendered with this |
999 |
|
* font in the specified {@link FontRenderContext}. This box will include the |
1000 |
|
* glyph origin, ascent, advance, height, and leading, but may not include all |
1001 |
|
* diacritics or accents. To get the complete visual bounding box of all the |
1002 |
|
* glyphs in a run of text, use the {@link TextLayout#getBounds} method of |
1003 |
|
* {@link TextLayout}. |
1004 |
|
* |
1005 |
|
* @param str The string to measure. |
1006 |
|
* @param frc The context in which to make the precise glyph measurements. |
1007 |
|
* |
1008 |
|
* @return A bounding box covering the logical bounds of the specified text. |
1009 |
|
* |
1010 |
|
* @see createGlyphVector() |
1011 |
|
*/ |
1012 |
|
public Rectangle2D |
1013 |
|
getStringBounds(String str, FontRenderContext frc) |
1014 |
|
{ |
1015 |
|
throw new UnsupportedOperationException (); |
1016 |
|
} |
1017 |
|
|
1018 |
|
/** |
1019 |
|
* Returns the logical bounds of the specified string when rendered with this |
1020 |
|
* font in the specified {@link FontRenderContext}. This box will include the |
1021 |
|
* glyph origin, ascent, advance, height, and leading, but may not include all |
1022 |
|
* diacritics or accents. To get the complete visual bounding box of all the |
1023 |
|
* glyphs in a run of text, use the {@link TextLayout#getBounds} method of |
1024 |
|
* {@link TextLayout}. |
1025 |
|
* |
1026 |
|
* @param str The string to measure. |
1027 |
|
* @param begin Index of the first character in <code>str</code> to measure. |
1028 |
|
* @param limit Index of the last character in <code>str</code> to measure. |
1029 |
|
* @param frc The context in which to make the precise glyph measurements. |
1030 |
|
* |
1031 |
|
* @return A bounding box covering the logical bounds of the specified text. |
1032 |
|
* |
1033 |
|
* @throws IndexOutOfBoundsException if the range [begin, limit] is |
1034 |
|
* invalid in <code>str</code>. |
1035 |
|
* |
1036 |
|
* @since 1.2 |
1037 |
|
* |
1038 |
|
* @see createGlyphVector() |
1039 |
|
*/ |
1040 |
|
public Rectangle2D |
1041 |
|
getStringBounds(String str, int begin, int limit, FontRenderContext frc) |
1042 |
|
{ |
1043 |
|
throw new UnsupportedOperationException (); |
1044 |
|
} |
1045 |
|
|
1046 |
|
/** |
1047 |
|
* Returns the logical bounds of the specified string when rendered with this |
1048 |
|
* font in the specified {@link FontRenderContext}. This box will include the |
1049 |
|
* glyph origin, ascent, advance, height, and leading, but may not include all |
1050 |
|
* diacritics or accents. To get the complete visual bounding box of all the |
1051 |
|
* glyphs in a run of text, use the {@link TextLayout#getBounds} method of |
1052 |
|
* {@link TextLayout}. |
1053 |
|
* |
1054 |
|
* @param ci The text to measure. |
1055 |
|
* @param begin Index of the first character in <code>ci</code> to measure. |
1056 |
|
* @param limit Index of the last character in <code>ci</code> to measure. |
1057 |
|
* @param frc The context in which to make the precise glyph measurements. |
1058 |
|
* |
1059 |
|
* @return A bounding box covering the logical bounds of the specified text. |
1060 |
|
* |
1061 |
|
* @throws IndexOutOfBoundsException if the range [begin, limit] is |
1062 |
|
* invalid in <code>ci</code>. |
1063 |
|
* |
1064 |
|
* @since 1.2 |
1065 |
|
* |
1066 |
|
* @see createGlyphVector() |
1067 |
|
*/ |
1068 |
|
public Rectangle2D |
1069 |
|
getStringBounds(CharacterIterator ci, int begin, int limit, FontRenderContext frc) |
1070 |
|
{ |
1071 |
|
throw new UnsupportedOperationException (); |
1072 |
|
} |
1073 |
|
|
1074 |
|
/** |
1075 |
|
* Returns the logical bounds of the specified string when rendered with this |
1076 |
|
* font in the specified {@link FontRenderContext}. This box will include the |
1077 |
|
* glyph origin, ascent, advance, height, and leading, but may not include all |
1078 |
|
* diacritics or accents. To get the complete visual bounding box of all the |
1079 |
|
* glyphs in a run of text, use the {@link TextLayout#getBounds} method of |
1080 |
|
* {@link TextLayout}. |
1081 |
|
* |
1082 |
|
* @param chars The text to measure. |
1083 |
|
* @param begin Index of the first character in <code>ci</code> to measure. |
1084 |
|
* @param limit Index of the last character in <code>ci</code> to measure. |
1085 |
|
* @param frc The context in which to make the precise glyph measurements. |
1086 |
|
* |
1087 |
|
* @return A bounding box covering the logical bounds of the specified text. |
1088 |
|
* |
1089 |
|
* @throws IndexOutOfBoundsException if the range [begin, limit] is |
1090 |
|
* invalid in <code>chars</code>. |
1091 |
|
* |
1092 |
|
* @since 1.2 |
1093 |
|
* |
1094 |
|
* @see createGlyphVector() |
1095 |
|
*/ |
1096 |
|
public Rectangle2D |
1097 |
|
getStringBounds(char[] chars, int begin, int limit, FontRenderContext frc) |
1098 |
|
{ |
1099 |
|
throw new UnsupportedOperationException (); |
1100 |
|
} |
1101 |
|
|
1102 |
|
/** |
1103 |
|
* Returns a copy of the affine transformation this font is currently |
1104 |
|
* subject to, if any. |
1105 |
|
* |
1106 |
|
* @return The current transformation. |
1107 |
|
*/ |
1108 |
|
public AffineTransform |
1109 |
|
getTransform() |
1110 |
|
{ |
1111 |
|
throw new UnsupportedOperationException (); |
1112 |
|
} |
1113 |
|
|
1114 |
|
/** |
1115 |
|
* Indicates whether this font's line metrics are uniform. A font may be |
1116 |
|
* composed of several "subfonts", each covering a different code range, |
1117 |
|
* and each with their own line metrics. A font with no subfonts, or |
1118 |
|
* subfonts with identical line metrics, is said to have "uniform" line |
1119 |
|
* metrics. |
1120 |
|
* |
1121 |
|
* @return Whether this font has uniform line metrics. |
1122 |
|
* |
1123 |
|
* @see LineMetrics |
1124 |
|
* @see getLineMetrics() |
1125 |
|
*/ |
1126 |
|
public boolean |
1127 |
|
hasUniformLineMetrics() |
1128 |
|
{ |
1129 |
|
throw new UnsupportedOperationException (); |
1130 |
|
} |
1131 |
|
|
1132 |
|
/** |
1133 |
|
* Indicates whether this font is subject to a non-identity affine |
1134 |
|
* transformation. |
1135 |
|
* |
1136 |
|
* @return <code>true</code> iff the font has a non-identity affine |
1137 |
|
* transformation applied to it. |
1138 |
|
*/ |
1139 |
|
public boolean |
1140 |
|
isTransformed() |
1141 |
|
{ |
1142 |
|
throw new UnsupportedOperationException (); |
1143 |
|
} |
1144 |
|
|
1145 |
|
/** |
1146 |
|
* Produces a glyph vector representing a full layout fo the specified |
1147 |
|
* text in this font. Full layouts may include complex shaping and |
1148 |
|
* reordering operations, for scripts such as Arabic or Hindi. |
1149 |
|
* |
1150 |
|
* Bidirectional (bidi) layout is not performed in this method; text |
1151 |
|
* should have its bidi direction specified with one of the flags {@link |
1152 |
|
* LAYOUT_LEFT_TO_RIGHT} or {@link LAYOUT_RIGHT_TO_LEFT}. |
1153 |
|
* |
1154 |
|
* Some types of layout (notably Arabic glyph shaping) may examine context |
1155 |
|
* characters beyond the bounds of the indicated range, in order to select |
1156 |
|
* an appropriate shape. The flags {@link LAYOUT_NO_START_CONTEXT} and |
1157 |
|
* {@link LAYOUT_NO_LIMIT_CONTEXT} can be provided to prevent these extra |
1158 |
|
* context areas from being examined, for instance if they contain invalid |
1159 |
|
* characters. |
1160 |
|
* |
1161 |
|
* @param frc Context in which to perform the layout. |
1162 |
|
* @param chars Text to perform layout on. |
1163 |
|
* @param start Index of first character to perform layout on. |
1164 |
|
* @param limit Index of last character to perform layout on. |
1165 |
|
* @param flags Combination of flags controlling layout. |
1166 |
|
* |
1167 |
|
* @return A new {@link GlyphVector} representing the specified text. |
1168 |
|
* |
1169 |
|
* @throws IndexOutOfBoundsException if the range [begin, limit] is |
1170 |
|
* invalid in <code>chars</code>. |
1171 |
|
*/ |
1172 |
|
public GlyphVector |
1173 |
|
layoutGlyphVector(FontRenderContext frc, char[] chars, int start, int limit, int flags) |
1174 |
|
{ |
1175 |
|
throw new UnsupportedOperationException (); |
1176 |
|
} |
1177 |
|
|
1178 |
|
|
1179 |
/*************************************************************************/ |
/*************************************************************************/ |
1180 |
|
|
1181 |
/** |
/** |