Skip to content

Commit 330aeb0

Browse files
author
Federico Fissore
committed
Revert "improves font rendering"
This reverts commit c2d9a1b.
1 parent 67997a6 commit 330aeb0

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

app/src/processing/app/EditorHeader.java

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,16 @@ public void paintComponent(Graphics screen) {
153153

154154
Graphics g = offscreen.getGraphics();
155155
if (font == null) {
156-
font = Theme.getDefaultFont(); // Get optimal font.
157-
if(font == null) font = Theme.getFont("header.text.font");
156+
font = Theme.getFont("header.text.font");
158157
}
159-
160158
g.setFont(font); // need to set this each time through
161159
metrics = g.getFontMetrics();
162160
fontAscent = metrics.getAscent();
163161
//}
164162

165-
Graphics2D g2 = (Graphics2D) g;
163+
//Graphics2D g2 = (Graphics2D) g;
164+
//g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
165+
// RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
166166

167167
// set the background for the offscreen
168168
g.setColor(backgroundColor);
@@ -182,8 +182,9 @@ public void paintComponent(Graphics screen) {
182182
code.getPrettyName() : code.getFileName();
183183

184184
// if modified, add the li'l glyph next to the name
185-
String text = " " + codeName + " ";
185+
String text = " " + codeName + (code.isModified() ? " \u00A7" : " ");
186186

187+
Graphics2D g2 = (Graphics2D) g;
187188
int textWidth = (int)
188189
font.getStringBounds(text, g2.getFontRenderContext()).getWidth();
189190

@@ -206,16 +207,7 @@ public void paintComponent(Graphics screen) {
206207
g.setColor(textColor[state]);
207208
int baseline = (sizeH + fontAscent) / 2;
208209
//g.drawString(sketch.code[i].name, textLeft, baseline);
209-
210-
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
211-
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
212-
213210
g.drawString(text, textLeft, baseline);
214-
215-
if(code.isModified()){
216-
g.setColor(Color.RED);
217-
g.drawString("*", textLeft - 3, baseline);
218-
}
219211

220212
g.drawImage(pieces[state][RIGHT], x, 0, null);
221213
x += PIECE_WIDTH - 1; // overlap by 1 pixel

0 commit comments

Comments
 (0)