/*
 * Copyright 2000-2011 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * @author max
 */
package com.intellij.ui;

import java.awt.*;
import java.text.AttributedCharacterIterator;

public class EngravedTextGraphics extends Graphics2DDelegate {
  private final static Color SHADOW_COLOR = new Color(250, 250, 250, 140);
  public EngravedTextGraphics(Graphics2D g2d) {
    super(g2d);
  }

  @Override
  public Graphics create() {
    return new EngravedTextGraphics((Graphics2D)myDelegate.create());
  }

  @Override
  public void drawChars(char[] data, int offset, int length, int x, int y) {
    final Color color = getColor();
    setColor(SHADOW_COLOR);
    super.drawChars(data, offset, length, x, y + 1);

    setColor(color);
    super.drawChars(data, offset, length, x, y);
  }

  @Override
  public void drawString(String str, int x, int y) {
    final Color color = getColor();

    setColor(SHADOW_COLOR);
    super.drawString(str, x, y + 1);

    setColor(color);
    super.drawString(str, x, y);
  }

  @Override
  public void drawString(AttributedCharacterIterator iterator, float x, float y) {
    final Color color = getColor();

    setColor(SHADOW_COLOR);
    super.drawString(iterator, x, y + 1);

    setColor(color);
    super.drawString(iterator, x, y);
  }

  @Override
  public void drawString(AttributedCharacterIterator iterator, int x, int y) {
    final Color color = getColor();

    setColor(SHADOW_COLOR);
    super.drawString(iterator, x, y + 1);

    setColor(color);
    super.drawString(iterator, x, y);
  }

  @Override
  public void drawString(String s, float x, float y) {
    final Color color = getColor();

    setColor(SHADOW_COLOR);
    super.drawString(s, x, y + 1);

    setColor(color);
    super.drawString(s, x, y);
  }
}

@@ -643,16 +643,62 @@
 ij.ui;%0A%0A
+import com.intellij.openapi.util.SystemInfo;%0A%0A
 import j
@@ -893,16 +893,86 @@
 , 140);%0A
+  private final static boolean ALLOW_ENGRAVEMENT = SystemInfo.isMac;%0A%0A
   public
@@ -1229,32 +1229,63 @@
 int x, int y) %7B%0A
+    if (ALLOW_ENGRAVEMENT) %7B%0A  
     final Color 
@@ -1304,24 +1304,26 @@
 olor();%0A    
+  
 setColor(SHA
@@ -1330,32 +1330,34 @@
 DOW_COLOR);%0A    
+ 
+ 
 super.drawChars(
@@ -1386,32 +1386,34 @@
 x, y + 1);%0A%0A    
+  
 setColor(color);
@@ -1405,32 +1405,39 @@
 etColor(color);%0A
+    %7D%0A%0A
     super.drawCh
@@ -1531,32 +1531,63 @@
 int x, int y) %7B%0A
+    if (ALLOW_ENGRAVEMENT) %7B%0A  
     final Color 
@@ -1603,32 +1603,34 @@
 etColor();%0A%0A    
+  
 setColor(SHADOW_
@@ -1629,32 +1629,34 @@
 (SHADOW_COLOR);%0A
+  
     super.drawSt
@@ -1669,32 +1669,34 @@
 tr, x, y + 1);%0A%0A
+  
     setColor(col
@@ -1692,32 +1692,38 @@
 etColor(color);%0A
+    %7D%0A
     super.drawSt
@@ -1831,32 +1831,63 @@
 t x, float y) %7B%0A
+    if (ALLOW_ENGRAVEMENT) %7B%0A  
     final Color 
@@ -1903,32 +1903,34 @@
 etColor();%0A%0A    
+  
 setColor(SHADOW_
@@ -1929,32 +1929,34 @@
 (SHADOW_COLOR);%0A
+  
     super.drawSt
@@ -1978,32 +1978,34 @@
 x, y + 1);%0A%0A    
+  
 setColor(color);
@@ -1997,32 +1997,38 @@
 etColor(color);%0A
+    %7D%0A
     super.drawSt
@@ -2141,24 +2141,55 @@
 x, int y) %7B%0A
+    if (ALLOW_ENGRAVEMENT) %7B%0A  
     final Co
@@ -2209,32 +2209,34 @@
 etColor();%0A%0A    
+ 
+ 
 setColor(SHADOW_
@@ -2235,32 +2235,34 @@
 (SHADOW_COLOR);%0A
+  
     super.drawSt
@@ -2284,32 +2284,34 @@
 x, y + 1);%0A%0A    
+  
 setColor(color);
@@ -2303,32 +2303,38 @@
 etColor(color);%0A
+    %7D%0A
     super.drawSt
@@ -2423,24 +2423,55 @@
  float y) %7B%0A
+    if (ALLOW_ENGRAVEMENT) %7B%0A  
     final Co
@@ -2491,32 +2491,34 @@
 etColor();%0A%0A    
+  
 setColor(SHADOW_
@@ -2525,24 +2525,26 @@
 COLOR);%0A    
+ 
+ 
 super.drawSt
@@ -2559,24 +2559,26 @@
 x, y + 1);%0A%0A
+  
     setColor
@@ -2582,24 +2582,30 @@
 lor(color);%0A
+    %7D%0A
     super.dr

Disable engravement on windows and linux for now since it doesn't look great without proper particular antialiasing.