Skip to content

Commit

Permalink
Use system fonts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender committed Nov 14, 2023
1 parent 81fbd00 commit 3c42d9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.function.Function;

import org.eclipse.chemclipse.logging.core.Logger;
import org.eclipse.chemclipse.swt.ui.support.Fonts;
import org.eclipse.chemclipse.ux.extension.ui.Activator;
import org.eclipse.chemclipse.ux.extension.ui.definitions.TileDefinition;
import org.eclipse.core.runtime.IStatus;
Expand All @@ -26,7 +27,6 @@
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
Expand Down Expand Up @@ -263,9 +263,7 @@ private void updateStyle(int style) {
fontSize = 18;
}
//
Font font = new Font(getDisplay(), "Arial", fontSize, SWT.BOLD); //$NON-NLS-1$
textSection.setFont(font);
font.dispose();
textSection.setFont(Fonts.getCachedFont(getDisplay(), "Arial", fontSize, SWT.BOLD)); //$NON-NLS-1$
}

public void updateFromDefinition() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public void paintBounds() {
Color old_fg = gc.getForeground();
Font old_font = gc.getFont();
try {
Font font = new Font(gc.getDevice(), PreferenceConstants.DEF_CHROMATOGRAM_PEAK_LABEL_FONT_NAME, 8, PreferenceConstants.DEF_CHROMATOGRAM_PEAK_LABEL_FONT_STYLE);
Font font = Resources.getFont(PreferenceConstants.DEF_CHROMATOGRAM_PEAK_LABEL_FONT_NAME, 8, PreferenceConstants.DEF_CHROMATOGRAM_PEAK_LABEL_FONT_STYLE);
gc.setFont(font);
gc.setLineStyle(SWT.LINE_DASH);
gc.drawPolygon(transformedPoints);
Expand Down

0 comments on commit 3c42d9f

Please sign in to comment.