XFontMetrics.java 836 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* Copyright (C) 2000 Free Software Foundation
  2. This file is part of libgcj.
  3. This software is copyrighted work licensed under the terms of the
  4. Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
  5. details. */
  6. package gnu.awt.xlib;
  7. import java.awt.FontMetrics;
  8. public class XFontMetrics extends FontMetrics
  9. {
  10. gnu.gcj.xlib.Font xfont;
  11. public XFontMetrics(gnu.gcj.xlib.Font xfont, java.awt.Font awtFont)
  12. {
  13. super(awtFont);
  14. this.xfont = xfont;
  15. }
  16. public int getAscent()
  17. {
  18. return xfont.getAscent();
  19. }
  20. public int getDescent()
  21. {
  22. return xfont.getDescent();
  23. }
  24. public int getMaxAscent()
  25. {
  26. return xfont.getMaxAscent();
  27. }
  28. public int getMaxDescent()
  29. {
  30. return xfont.getMaxDescent();
  31. }
  32. public int stringWidth(String str)
  33. {
  34. return xfont.getStringWidth(str);
  35. }
  36. }