/[classpath]/classpath/java/awt/Font.java
ViewVC logotype

Diff of /classpath/java/awt/Font.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.25 by mkoch, Tue Mar 8 08:15:34 2005 UTC revision 1.26 by trebligd, Wed Jun 29 07:27:42 2005 UTC
# Line 44  import gnu.java.awt.peer.ClasspathFontPe Line 44  import gnu.java.awt.peer.ClasspathFontPe
44  import java.awt.font.FontRenderContext;  import java.awt.font.FontRenderContext;
45  import java.awt.font.GlyphVector;  import java.awt.font.GlyphVector;
46  import java.awt.font.LineMetrics;  import java.awt.font.LineMetrics;
47    import java.awt.font.TextLayout;
48  import java.awt.geom.AffineTransform;  import java.awt.geom.AffineTransform;
49  import java.awt.geom.Rectangle2D;  import java.awt.geom.Rectangle2D;
50  import java.awt.peer.FontPeer;  import java.awt.peer.FontPeer;
# Line 377  private static final long serialVersionU Line 378  private static final long serialVersionU
378    *    *
379    * @return The logical name of the font.    * @return The logical name of the font.
380    *    *
381    * @see getFamily()    * @see #getFamily()
382    * @see getFontName()    * @see #getFontName()
383    */    */
384    public String getName ()    public String getName ()
385  {  {
# Line 453  private static final long serialVersionU Line 454  private static final long serialVersionU
454    *    *
455    * @since 1.2    * @since 1.2
456    *    *
457    * @see getName()    * @see #getName()
458    * @see getFontName()    * @see #getFontName()
459    * @see GraphicsEnvironment.getAvailableFontFamilyNames()    * @see GraphicsEnvironment#getAvailableFontFamilyNames()
460    */    */
461    public String getFamily ()    public String getFamily ()
462  {  {
# Line 464  private static final long serialVersionU Line 465  private static final long serialVersionU
465    
466  /**  /**
467    * Returns integer code representing the sum of style flags of this font, a    * Returns integer code representing the sum of style flags of this font, a
468    * combination of either {@link PLAIN}, {@link BOLD}, or {@link ITALIC}.    * combination of either {@link #PLAIN}, {@link #BOLD}, or {@link #ITALIC}.
469    *    *
470    * @return code representing the style of this font.    * @return code representing the style of this font.
471    *    *
472    * @see isPlain()    * @see #isPlain()
473    * @see isBold()    * @see #isBold()
474    * @see isItalic()    * @see #isItalic()
475    */    */
476    public int getStyle ()    public int getStyle ()
477  {  {
# Line 555  private static final long serialVersionU Line 556  private static final long serialVersionU
556  }  }
557    
558  /**  /**
559    * Creates a new font with point size 1 and {@link PLAIN} style,    * Creates a new font with point size 1 and {@link #PLAIN} style,
560    * reading font data from the provided input stream. The resulting font    * reading font data from the provided input stream. The resulting font
561    * can have further fonts derived from it using its    * can have further fonts derived from it using its
562    * <code>deriveFont</code> method.    * <code>deriveFont</code> method.
563    *    *
564    * @param fontFormat Integer code indicating the format the font data is    * @param fontFormat Integer code indicating the format the font data is
565    * in.Currently this can only be {@link TRUETYPE_FONT}.    * in.Currently this can only be {@link #TRUETYPE_FONT}.
566    * @param is {@link InputStream} from which font data will be read. This    * @param is {@link InputStream} from which font data will be read. This
567    * stream is not closed after font data is extracted.    * stream is not closed after font data is extracted.
568    *    *
# Line 594  private static final long serialVersionU Line 595  private static final long serialVersionU
595    * @return A new {@link GlyphVector} containing glyphs mapped from str,    * @return A new {@link GlyphVector} containing glyphs mapped from str,
596    * through the font's cmap table.    * through the font's cmap table.
597    *    *
598    * @see layoutGlyphVector()    * @see #layoutGlyphVector(FontRenderContext, char[], int, int, int)
599    */    */
600    public GlyphVector createGlyphVector (FontRenderContext ctx, String str)    public GlyphVector createGlyphVector (FontRenderContext ctx, String str)
601  {  {
# Line 614  private static final long serialVersionU Line 615  private static final long serialVersionU
615    * @return A new {@link GlyphVector} containing glyphs mapped from str,    * @return A new {@link GlyphVector} containing glyphs mapped from str,
616    * through the font's cmap table.    * through the font's cmap table.
617    *    *
618    * @see layoutGlyphVector()    * @see #layoutGlyphVector(FontRenderContext, char[], int, int, int)
619    */    */
620    public GlyphVector createGlyphVector (FontRenderContext ctx, CharacterIterator i)    public GlyphVector createGlyphVector (FontRenderContext ctx, CharacterIterator i)
621  {  {
# Line 634  private static final long serialVersionU Line 635  private static final long serialVersionU
635    * @return A new {@link GlyphVector} containing glyphs mapped from str,    * @return A new {@link GlyphVector} containing glyphs mapped from str,
636    * through the font's cmap table.    * through the font's cmap table.
637    *    *
638    * @see layoutGlyphVector()    * @see #layoutGlyphVector(FontRenderContext, char[], int, int, int)
639    */    */
640    public GlyphVector createGlyphVector (FontRenderContext ctx, char[] chars)    public GlyphVector createGlyphVector (FontRenderContext ctx, char[] chars)
641  {  {
# Line 652  private static final long serialVersionU Line 653  private static final long serialVersionU
653    * @return A new {@link GlyphVector} containing glyphs mapped from str,    * @return A new {@link GlyphVector} containing glyphs mapped from str,
654    * through the font's cmap table.    * through the font's cmap table.
655    *    *
656    * @see layoutGlyphVector()    * @see #layoutGlyphVector(FontRenderContext, char[], int, int, int)
657    *    *
658    * @specnote This method is documented to perform character-to-glyph    * @specnote This method is documented to perform character-to-glyph
659    * conversions, in the Sun documentation, but its second parameter name is    * conversions, in the Sun documentation, but its second parameter name is
# Line 776  private static final long serialVersionU Line 777  private static final long serialVersionU
777    *    *
778    * @return A map of chracter attributes which this font currently has set.    * @return A map of chracter attributes which this font currently has set.
779    *    *
780    * @see getAvailableAttributes()    * @see #getAvailableAttributes()
781    * @see java.text.AttributedCharacterIterator.Attribute    * @see java.text.AttributedCharacterIterator.Attribute
782    * @see java.awt.font.TextAttribute    * @see java.awt.font.TextAttribute
783    */    */
# Line 790  private static final long serialVersionU Line 791  private static final long serialVersionU
791    *    *
792    * @return An array of chracter attribute keys which this font understands.    * @return An array of chracter attribute keys which this font understands.
793    *    *
794    * @see getAttributes()    * @see #getAttributes()
795    * @see java.text.AttributedCharacterIterator.Attribute    * @see java.text.AttributedCharacterIterator.Attribute
796    * @see java.awt.font.TextAttribute    * @see java.awt.font.TextAttribute
797    */    */
# Line 800  private static final long serialVersionU Line 801  private static final long serialVersionU
801  }  }
802    
803  /**  /**
804    * Returns a baseline code (one of {@link ROMAN_BASELINE}, {@link    * Returns a baseline code (one of {@link #ROMAN_BASELINE}, {@link
805    * CENTER_BASELINE} or {@link HANGING_BASELINE}) indicating which baseline    * #CENTER_BASELINE} or {@link #HANGING_BASELINE}) indicating which baseline
806    * this font will measure baseline offsets for, when presenting glyph    * this font will measure baseline offsets for, when presenting glyph
807    * metrics for a given character.    * metrics for a given character.
808    *    *
# Line 818  private static final long serialVersionU Line 819  private static final long serialVersionU
819    *    *
820    * @since 1.2    * @since 1.2
821    *    *
822    * @see LineMetrics.getBaselineOffsets()    * @see LineMetrics#getBaselineOffsets()
823    */    */
824    public byte getBaselineFor (char c)    public byte getBaselineFor (char c)
825  {  {
# Line 838  private static final long serialVersionU Line 839  private static final long serialVersionU
839    *    *
840    * @since 1.2    * @since 1.2
841    *    *
842    * @see getName()    * @see #getName()
843    * @see getFontName()    * @see #getFontName()
844    * @see GraphicsEnvironment.getAvailableFontFamilyNames()    * @see GraphicsEnvironment#getAvailableFontFamilyNames()
845    * @see Locale    * @see Locale
846    */    */
847    public String getFamily (Locale lc)    public String getFamily (Locale lc)
# Line 857  private static final long serialVersionU Line 858  private static final long serialVersionU
858    *    *
859    * @since 1.2    * @since 1.2
860    *    *
861    * @see TextAttribure      * @see java.awt.font.TextAttribute  
862    */    */
863    public static Font getFont (Map attributes)    public static Font getFont (Map attributes)
864  {  {
# Line 874  private static final long serialVersionU Line 875  private static final long serialVersionU
875    *    *
876    * @since 1.2    * @since 1.2
877    *    *
878    * @see getName()    * @see #getName()
879    * @see getFamily()    * @see #getFamily()
880    */    */
881    public String getFontName ()    public String getFontName ()
882  {  {
# Line 894  private static final long serialVersionU Line 895  private static final long serialVersionU
895    *    *
896    * @since 1.2    * @since 1.2
897    *    *
898    * @see getName()    * @see #getName()
899    * @see getFamily()    * @see #getFamily()
900    */    */
901    public String getFontName (Locale lc)    public String getFontName (Locale lc)
902  {  {
# Line 904  private static final long serialVersionU Line 905  private static final long serialVersionU
905    
906  /**  /**
907    * Returns the italic angle of this font, a measurement of its slant when    * Returns the italic angle of this font, a measurement of its slant when
908    * style is {@link ITALIC}. The precise meaning is the inverse slope of a    * style is {@link #ITALIC}. The precise meaning is the inverse slope of a
909    * caret line which "best measures" the font's italic posture.    * caret line which "best measures" the font's italic posture.
910    *    *
911    * @return The italic angle.    * @return The italic angle.
912    *    *
913    * @see TextAttribute.POSTURE    * @see java.awt.font.TextAttribute#POSTURE
914    */    */
915    public float getItalicAngle ()    public float getItalicAngle ()
916  {  {
# Line 1028  private static final long serialVersionU Line 1029  private static final long serialVersionU
1029    *    *
1030    * @since 1.2    * @since 1.2
1031    *    *
1032    * @see getName()    * @see #getName()
1033    * @see getFamily()    * @see #getFamily()
1034    * @see getFontName()    * @see #getFontName()
1035    */    */
1036    public String getPSName ()    public String getPSName ()
1037  {  {
# Line 1042  private static final long serialVersionU Line 1043  private static final long serialVersionU
1043    * font in the specified {@link FontRenderContext}. This box will include the    * font in the specified {@link FontRenderContext}. This box will include the
1044    * glyph origin, ascent, advance, height, and leading, but may not include all    * glyph origin, ascent, advance, height, and leading, but may not include all
1045    * diacritics or accents. To get the complete visual bounding box of all the    * diacritics or accents. To get the complete visual bounding box of all the
1046    * glyphs in a run of text, use the {@link TextLayout#getBounds} method of    * glyphs in a run of text, use the {@link TextLayout#getBounds} method of
1047    * {@link TextLayout}.    * {@link TextLayout}.
1048    *    *
1049    * @param str The string to measure.    * @param str The string to measure.
# Line 1050  private static final long serialVersionU Line 1051  private static final long serialVersionU
1051    *    *
1052    * @return A bounding box covering the logical bounds of the specified text.    * @return A bounding box covering the logical bounds of the specified text.
1053    *    *
1054    * @see createGlyphVector()    * @see #createGlyphVector(FontRenderContext, String)
1055    */    */
1056    public Rectangle2D getStringBounds (String str, FontRenderContext frc)    public Rectangle2D getStringBounds (String str, FontRenderContext frc)
1057  {  {
# Line 1077  private static final long serialVersionU Line 1078  private static final long serialVersionU
1078    *    *
1079    * @since 1.2    * @since 1.2
1080    *    *
1081    * @see createGlyphVector()    * @see #createGlyphVector(FontRenderContext, String)
1082    */    */
1083    public Rectangle2D getStringBounds (String str, int begin,    public Rectangle2D getStringBounds (String str, int begin,
1084                                        int limit, FontRenderContext frc)                                        int limit, FontRenderContext frc)
# Line 1105  private static final long serialVersionU Line 1106  private static final long serialVersionU
1106    *    *
1107    * @since 1.2    * @since 1.2
1108    *    *
1109    * @see createGlyphVector()    * @see #createGlyphVector(FontRenderContext, CharacterIterator)
1110    */    */
1111    public Rectangle2D getStringBounds (CharacterIterator ci, int begin,    public Rectangle2D getStringBounds (CharacterIterator ci, int begin,
1112                                        int limit, FontRenderContext frc)                                        int limit, FontRenderContext frc)
# Line 1133  private static final long serialVersionU Line 1134  private static final long serialVersionU
1134    *    *
1135    * @since 1.2    * @since 1.2
1136    *    *
1137    * @see createGlyphVector()    * @see #createGlyphVector(FontRenderContext, char[])
1138    */    */
1139    public Rectangle2D getStringBounds (char[] chars, int begin,    public Rectangle2D getStringBounds (char[] chars, int begin,
1140                                        int limit, FontRenderContext frc)                                        int limit, FontRenderContext frc)
# Line 1163  private static final long serialVersionU Line 1164  private static final long serialVersionU
1164    * @return Whether this font has uniform line metrics.    * @return Whether this font has uniform line metrics.
1165    *    *
1166    * @see LineMetrics    * @see LineMetrics
1167    * @see getLineMetrics()    * @see #getLineMetrics(String, FontRenderContext)
1168    */    */
1169    public boolean hasUniformLineMetrics ()    public boolean hasUniformLineMetrics ()
1170  {  {
# Line 1189  private static final long serialVersionU Line 1190  private static final long serialVersionU
1190    *    *
1191    * Bidirectional (bidi) layout is not performed in this method; text    * Bidirectional (bidi) layout is not performed in this method; text
1192    * should have its bidi direction specified with one of the flags {@link    * should have its bidi direction specified with one of the flags {@link
1193    * LAYOUT_LEFT_TO_RIGHT} or {@link LAYOUT_RIGHT_TO_LEFT}.    * #LAYOUT_LEFT_TO_RIGHT} or {@link #LAYOUT_RIGHT_TO_LEFT}.
1194    *    *
1195    * Some types of layout (notably Arabic glyph shaping) may examine context    * Some types of layout (notably Arabic glyph shaping) may examine context
1196    * characters beyond the bounds of the indicated range, in order to select    * characters beyond the bounds of the indicated range, in order to select
1197    * an appropriate shape. The flags {@link LAYOUT_NO_START_CONTEXT} and    * an appropriate shape. The flags {@link #LAYOUT_NO_START_CONTEXT} and
1198    * {@link LAYOUT_NO_LIMIT_CONTEXT} can be provided to prevent these extra    * {@link #LAYOUT_NO_LIMIT_CONTEXT} can be provided to prevent these extra
1199    * context areas from being examined, for instance if they contain invalid    * context areas from being examined, for instance if they contain invalid
1200    * characters.    * characters.
1201    *    *

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26