aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2018-05-18 03:24:05 -0400
committerCamille Letavernier2018-05-18 03:24:05 -0400
commit8bdf44351e3864d6a9a1d829b6e75dcebee317fa (patch)
tree91ac01bf5fd42880ca61a896b30f3b92cd04ea60
parentfef046ec9e86b230fa84b41f129645dcc92cf478 (diff)
downloadorg.eclipse.papyrus-8bdf44351e3864d6a9a1d829b6e75dcebee317fa.tar.gz
org.eclipse.papyrus-8bdf44351e3864d6a9a1d829b6e75dcebee317fa.tar.xz
org.eclipse.papyrus-8bdf44351e3864d6a9a1d829b6e75dcebee317fa.zip
Bug 533852 - [All Diagrams] Provide a default font for all platforms
https://bugs.eclipse.org/bugs/show_bug.cgi?id=533852 - Fix the font path format so that it works on all platforms Change-Id: I7781deae6c1bcae4b7e15e2a399995d43d9eb44c Signed-off-by: Camille Letavernier <cletavernier@eclipsesource.com>
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.ui.fonts/src/org/eclipse/papyrus/infra/ui/fonts/internal/addon/FontAddon.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.ui.fonts/src/org/eclipse/papyrus/infra/ui/fonts/internal/addon/FontAddon.java b/plugins/infra/ui/org.eclipse.papyrus.infra.ui.fonts/src/org/eclipse/papyrus/infra/ui/fonts/internal/addon/FontAddon.java
index 3dfb99b0297..8112ccdeb1f 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.ui.fonts/src/org/eclipse/papyrus/infra/ui/fonts/internal/addon/FontAddon.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.ui.fonts/src/org/eclipse/papyrus/infra/ui/fonts/internal/addon/FontAddon.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2018 EclipseSource 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
@@ -17,7 +17,9 @@ import java.net.URL;
import javax.annotation.PostConstruct;
import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.papyrus.infra.ui.fonts.Activator;
import org.eclipse.swt.widgets.Display;
@@ -59,9 +61,11 @@ public class FontAddon {
continue;
}
- if (!Display.getCurrent().loadFont(fontFileURL.getFile())) {
+ IPath path = new Path(fontFileURL.getFile());
+ String osPath = path.toOSString();
+ if (!Display.getCurrent().loadFont(osPath)) {
Activator.getDefault().getLog().log(new Status(IStatus.WARNING, Activator.PLUGIN_ID,
- "Failed to load font " + fontURL + " (Resolved URL: " + fontFileURL + ")")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "Failed to load font " + fontURL + " (Resolved URL: " + osPath + ")")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
continue;
}
}