Revision 1479

tmp/org.txm.partition.rcp/src/org/txm/partition/rcp/handlers/ComputePartitionDimensionsBarChart.java (revision 1479)
27 27
//
28 28
package org.txm.partition.rcp.handlers;
29 29

  
30
import java.awt.Font;
31
import java.io.File;
32

  
33 30
import org.eclipse.core.commands.ExecutionEvent;
34 31
import org.eclipse.core.commands.ExecutionException;
35
import org.eclipse.swt.widgets.Display;
36 32
import org.txm.chartsengine.rcp.editors.ChartEditor;
37 33
import org.txm.partition.core.functions.PartitionDimensions;
38
import org.txm.rcp.Application;
39 34
import org.txm.rcp.handlers.BaseAbstractHandler;
40 35
import org.txm.searchengine.cqp.corpus.Partition;
41
import org.txm.utils.logger.Log;
42 36

  
43 37

  
44 38
/**
......
81 75

  
82 76
		ChartEditor.openEditor(partitionDimensions);
83 77

  
78
		
79
	        
84 80
		// FIXME: tests to Load Java embedded fonts from JRE to SWT		
85
		Display.getDefault().syncExec(new Runnable() {
86
		    public void run() {
87

  
88
				File javaFontsPath = new File(System.getProperty("java.home")
89
						+ System.getProperty("file.separator") + "lib"
90
						+ System.getProperty("file.separator") + "fonts"
91
						+ System.getProperty("file.separator"));
92

  
93
				String[] fontFiles = javaFontsPath.list(); 
94
				
95
				for (int i = 0; i < fontFiles.length; i++) {
96
					
97
					if(fontFiles[i].endsWith(".ttf"))	{ //$NON-NLS-1$
98
						
99
						File fontFile = new File(javaFontsPath, fontFiles[i]);
100
						
101
						Log.finest("Loading Java font to SWT Device from file " + fontFile + "...");
102
					
103
						// Load the font in SWT
104
						
105
						Display.getCurrent().loadFont(fontFile.getAbsolutePath());
106
					}
107
					
108
				}
109
		    }
110
		});
81
//		Display.getDefault().syncExec(new Runnable() {
82
//		    public void run() {
83
//
84
//				File javaFontsPath = new File(System.getProperty("java.home")
85
//						+ System.getProperty("file.separator") + "lib"
86
//						+ System.getProperty("file.separator") + "fonts"
87
//						+ System.getProperty("file.separator"));
88
//
89
//				String[] fontFiles = javaFontsPath.list(); 
90
//				
91
//				for (int i = 0; i < fontFiles.length; i++) {
92
//					
93
//					if(fontFiles[i].endsWith(".ttf"))	{ //$NON-NLS-1$
94
//						
95
//						File fontFile = new File(javaFontsPath, fontFiles[i]);
96
//						
97
//						Log.finest("Loading Java font to SWT Device from file " + fontFile + "...");
98
//					
99
//						// Load the font in SWT
100
//						
101
//						Display.getCurrent().loadFont(fontFile.getAbsolutePath());
102
//					}
103
//					
104
//				}
105
//		    }
106
//		});
111 107
		
112 108
		return null;
113 109
	}

Also available in: Unified diff