Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

148
LINES

< > BotCompany Repo | #1031249 // FontMetricsWrapper

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3086L/18K).

1  
import java.awt.font.FontRenderContext;
2  
import java.awt.font.LineMetrics;
3  
import java.awt.geom.Rectangle2D;
4  
5  
sclass FontMetricsWrapper extends FontMetrics {
6  
  FontMetrics target;
7  
8  
  *(FontMetrics target) {
9  
      super(target.getFont());
10  
      this.target = target;
11  
  }
12  
13  
  @Override
14  
  public Font getFont() {
15  
      return target.getFont();
16  
  }
17  
18  
  @Override
19  
  public FontRenderContext getFontRenderContext() {
20  
      return target.getFontRenderContext();
21  
  }
22  
23  
  @Override
24  
  public int getLeading() {
25  
      return target.getLeading();
26  
  }
27  
28  
  @Override
29  
  public int getAscent() {
30  
      return target.getAscent();
31  
  }
32  
33  
  @Override
34  
  public int getDescent() {
35  
      return target.getDescent();
36  
  }
37  
38  
  @Override
39  
  public int getHeight() {
40  
      return target.getHeight();
41  
  }
42  
43  
  @Override
44  
  public int getMaxAscent() {
45  
      return target.getMaxAscent();
46  
  }
47  
48  
  @Override
49  
  public int getMaxDescent() {
50  
      return target.getMaxDescent();
51  
  }
52  
53  
  @Override
54  
  @Deprecated
55  
  public int getMaxDecent() {
56  
      return target.getMaxDecent();
57  
  }
58  
59  
  @Override
60  
  public int getMaxAdvance() {
61  
      return target.getMaxAdvance();
62  
  }
63  
64  
  @Override
65  
  public int charWidth(int codePoint) {
66  
      return target.charWidth(codePoint);
67  
  }
68  
69  
  @Override
70  
  public int charWidth(char ch) {
71  
      return target.charWidth(ch);
72  
  }
73  
74  
  @Override
75  
  public int stringWidth(String str) {
76  
      return target.stringWidth(str);
77  
  }
78  
79  
  @Override
80  
  public int charsWidth(char[] data, int off, int len) {
81  
      return target.charsWidth(data, off, len);
82  
  }
83  
84  
  @Override
85  
  public int bytesWidth(byte[] data, int off, int len) {
86  
      return target.bytesWidth(data, off, len);
87  
  }
88  
89  
  @Override
90  
  public int[] getWidths() {
91  
      return target.getWidths();
92  
  }
93  
94  
  @Override
95  
  public boolean hasUniformLineMetrics() {
96  
      return target.hasUniformLineMetrics();
97  
  }
98  
99  
  @Override
100  
  public LineMetrics getLineMetrics(String str, Graphics context) {
101  
      return target.getLineMetrics(str, context);
102  
  }
103  
104  
  @Override
105  
  public LineMetrics getLineMetrics(String str, int beginIndex, int limit, Graphics context) {
106  
      return target.getLineMetrics(str, beginIndex, limit, context);
107  
  }
108  
109  
  @Override
110  
  public LineMetrics getLineMetrics(char[] chars, int beginIndex, int limit, Graphics context) {
111  
      return target.getLineMetrics(chars, beginIndex, limit, context);
112  
  }
113  
114  
  @Override
115  
  public LineMetrics getLineMetrics(java.text.CharacterIterator ci, int beginIndex, int limit, Graphics context) {
116  
      return target.getLineMetrics(ci, beginIndex, limit, context);
117  
  }
118  
119  
  @Override
120  
  public Rectangle2D getStringBounds(String str, Graphics context) {
121  
      return target.getStringBounds(str, context);
122  
  }
123  
124  
  @Override
125  
  public Rectangle2D getStringBounds(String str, int beginIndex, int limit, Graphics context) {
126  
      return target.getStringBounds(str, beginIndex, limit, context);
127  
  }
128  
129  
  @Override
130  
  public Rectangle2D getStringBounds(char[] chars, int beginIndex, int limit, Graphics context) {
131  
      return target.getStringBounds(chars, beginIndex, limit, context);
132  
  }
133  
134  
  @Override
135  
  public Rectangle2D getStringBounds(java.text.CharacterIterator ci, int beginIndex, int limit, Graphics context) {
136  
      return target.getStringBounds(ci, beginIndex, limit, context);
137  
  }
138  
139  
  @Override
140  
  public Rectangle2D getMaxCharBounds(Graphics context) {
141  
      return target.getMaxCharBounds(context);
142  
  }
143  
144  
  @Override
145  
  public String toString() {
146  
      return target.toString();
147  
  }
148  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031249
Snippet name: FontMetricsWrapper
Eternal ID of this version: #1031249/6
Text MD5: a271cfdb16d2f2362e93888439c244b0
Transpilation MD5: 812ebdb5c2796ddc9922c3874bf08f65
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-25 19:08:43
Source code size: 3585 bytes / 148 lines
Pitched / IR pitched: No / No
Views / Downloads: 240 / 408
Version history: 5 change(s)
Referenced in: [show references]