Fixed bug 521373: MarginPainter no longer needs to be initialized after font change
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/MarginPainter.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/MarginPainter.java
index 2da2866..a9da8dd 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/MarginPainter.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/MarginPainter.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -100,8 +100,8 @@
 	}
 
 	/**
-	 * Initializes this painter, by flushing and recomputing all caches and causing
-	 * the widget to be redrawn. Must be called explicitly when font of text widget changes.
+	 * Initializes this painter, by flushing and recomputing all caches and causing the widget to be
+	 * redrawn.
 	 */
 	public void initialize() {
 		computeWidgetX();
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java
index ca16934..84ee242 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -434,7 +434,6 @@
 
 		support.setCursorLinePainterPreferenceKeys(CURRENT_LINE, CURRENT_LINE_COLOR);
 		support.setMarginPainterPreferenceKeys(PRINT_MARGIN, PRINT_MARGIN_COLOR, PRINT_MARGIN_COLUMN);
-		support.setSymbolicFontName(getFontPropertyPreferenceKey());
 	}
 
 	/*
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/SourceViewerDecorationSupport.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/SourceViewerDecorationSupport.java
index aff66c1..b16c246 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/SourceViewerDecorationSupport.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/SourceViewerDecorationSupport.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -23,7 +23,6 @@
 
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.jface.util.IPropertyChangeListener;
 import org.eclipse.jface.util.PropertyChangeEvent;
 
@@ -187,18 +186,6 @@
 	private static ITextStyleStrategy fgProblemUnderlineStrategy= new AnnotationPainter.UnderlineStrategy(SWT.UNDERLINE_ERROR);
 
 
-	/*
-	 * @see IPropertyChangeListener
-	 */
-	private class FontPropertyChangeListener implements IPropertyChangeListener {
-		@Override
-		public void propertyChange(PropertyChangeEvent event) {
-			if (fMarginPainter != null && fSymbolicFontName != null && fSymbolicFontName.equals(event.getProperty()))
-				fMarginPainter.initialize();
-		}
-	}
-
-
 	/** The viewer */
 	private ISourceViewer fSourceViewer;
 	/** The viewer's overview ruler */
@@ -243,10 +230,6 @@
 	private IPropertyChangeListener fPropertyChangeListener;
 	/** The preference store */
 	private IPreferenceStore fPreferenceStore;
-	/** The symbolic font name */
-	private String fSymbolicFontName;
-	/** The font change listener */
-	private FontPropertyChangeListener fFontPropertyChangeListener;
 
 
 	/**
@@ -388,11 +371,6 @@
 		updateTextDecorations();
 		updateOverviewDecorations();
 
-		if (fFontPropertyChangeListener != null) {
-			JFaceResources.getFontRegistry().removeListener(fFontPropertyChangeListener);
-			fFontPropertyChangeListener= null;
-		}
-
 		fOverviewRuler= null;
 
 		// Painters got disposed in updateTextDecorations() or by the PaintManager
@@ -497,10 +475,12 @@
 	/**
 	 * Sets the symbolic font name that is used for computing the margin width.
 	 *
-	 * @param symbolicFontName the symbolic font name
+	 * @param symbolicFontName
+	 *            the symbolic font name
+	 * @deprecated As of 4.8, this is no longer used
 	 */
+	@Deprecated
 	public void setSymbolicFontName(String symbolicFontName) {
-		fSymbolicFontName= symbolicFontName;
 	}
 
 	/**
@@ -801,9 +781,6 @@
 					fMarginPainter.setMarginRulerColumn(fPreferenceStore.getInt(fMarginPainterColumnKey));
 				ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer;
 				extension.addPainter(fMarginPainter);
-
-				fFontPropertyChangeListener= new FontPropertyChangeListener();
-				JFaceResources.getFontRegistry().addListener(fFontPropertyChangeListener);
 			}
 		}
 	}
@@ -814,9 +791,6 @@
 	private void hideMargin() {
 		if (fMarginPainter != null) {
 			if (fSourceViewer instanceof ITextViewerExtension2) {
-				JFaceResources.getFontRegistry().removeListener(fFontPropertyChangeListener);
-				fFontPropertyChangeListener= null;
-
 				ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer;
 				extension.removePainter(fMarginPainter);
 				fMarginPainter.deactivate(true);