mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-18 07:52:14 +01:00
Revert "improves font rendering"
This reverts commit c2d9a1b020f82fa82ef0df04765adc40e87d145f.
This commit is contained in:
parent
67997a6605
commit
330aeb0ba1
@ -153,16 +153,16 @@ public class EditorHeader extends JComponent {
|
||||
|
||||
Graphics g = offscreen.getGraphics();
|
||||
if (font == null) {
|
||||
font = Theme.getDefaultFont(); // Get optimal font.
|
||||
if(font == null) font = Theme.getFont("header.text.font");
|
||||
font = Theme.getFont("header.text.font");
|
||||
}
|
||||
|
||||
g.setFont(font); // need to set this each time through
|
||||
metrics = g.getFontMetrics();
|
||||
fontAscent = metrics.getAscent();
|
||||
//}
|
||||
|
||||
Graphics2D g2 = (Graphics2D) g;
|
||||
//Graphics2D g2 = (Graphics2D) g;
|
||||
//g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
|
||||
// RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
|
||||
|
||||
// set the background for the offscreen
|
||||
g.setColor(backgroundColor);
|
||||
@ -182,8 +182,9 @@ public class EditorHeader extends JComponent {
|
||||
code.getPrettyName() : code.getFileName();
|
||||
|
||||
// if modified, add the li'l glyph next to the name
|
||||
String text = " " + codeName + " ";
|
||||
String text = " " + codeName + (code.isModified() ? " \u00A7" : " ");
|
||||
|
||||
Graphics2D g2 = (Graphics2D) g;
|
||||
int textWidth = (int)
|
||||
font.getStringBounds(text, g2.getFontRenderContext()).getWidth();
|
||||
|
||||
@ -206,17 +207,8 @@ public class EditorHeader extends JComponent {
|
||||
g.setColor(textColor[state]);
|
||||
int baseline = (sizeH + fontAscent) / 2;
|
||||
//g.drawString(sketch.code[i].name, textLeft, baseline);
|
||||
|
||||
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
|
||||
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
|
||||
|
||||
g.drawString(text, textLeft, baseline);
|
||||
|
||||
if(code.isModified()){
|
||||
g.setColor(Color.RED);
|
||||
g.drawString("*", textLeft - 3, baseline);
|
||||
}
|
||||
|
||||
g.drawImage(pieces[state][RIGHT], x, 0, null);
|
||||
x += PIECE_WIDTH - 1; // overlap by 1 pixel
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user