[FOray-commit] SF.net SVN: foray:[10773] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2009-04-25 15:36:01
|
Revision: 10773
http://foray.svn.sourceforge.net/foray/?rev=10773&view=rev
Author: victormote
Date: 2009-04-25 15:36:00 +0000 (Sat, 25 Apr 2009)
Log Message:
-----------
Wrap a PsServer inside the FontServer so that the font system has access to the PS features.
Modified Paths:
--------------
trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java
trunk/foray/foray-font/src/java/org/foray/font/FontServer4a.java
trunk/foray/foray-font/src/javatest/org/foray/font/TestFontServer4a.java
Modified: trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java
===================================================================
--- trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java 2009-04-25 15:23:18 UTC (rev 10772)
+++ trunk/foray/foray-app/src/java/org/foray/app/FOraySpecific.java 2009-04-25 15:36:00 UTC (rev 10773)
@@ -38,6 +38,7 @@
import org.foray.fotree.FoTreeServer4a;
import org.foray.graphic.GraphicServer4a;
import org.foray.pioneer.PioneerFactory;
+import org.foray.ps.PsServer4a;
import org.foray.speech.SpeechServer4a;
import org.axsl.area.AreaTreeFactory;
@@ -47,6 +48,7 @@
import org.axsl.graphic.GraphicServer;
import org.axsl.hyphen.HyphenationServer;
import org.axsl.layout.LayoutFactory;
+import org.axsl.ps.PsServer;
import org.axsl.speech.SpeechServer;
import org.axsl.text.TextServer;
@@ -134,7 +136,8 @@
public static FontServer makeFontServer(final Log logger,
final SessionConfig configuration) throws FOrayException {
final EntityResolver entityResolver = makeEntityResolver(configuration);
- final FontServer4a forayFontServer = new FontServer4a(logger);
+ final PsServer psServer = FOraySpecific.makePsServer();
+ final FontServer4a forayFontServer = new FontServer4a(logger, psServer);
forayFontServer.setBaseFontURL(
configuration.optionFontBaseDirectory());
forayFontServer.setBaseURL(configuration.optionBaseDirectory());
@@ -258,6 +261,14 @@
}
/**
+ * Make a standard PsServer instance for use in FOray.
+ * @return The newly-created PsServer instance.
+ */
+ public static PsServer makePsServer() {
+ return new PsServer4a();
+ }
+
+ /**
* Create a standard entity resolver for use with FOray.
* @param configuration The session configuration.
* @return The newly-created entity resolver, or null if no XML catalog
Modified: trunk/foray/foray-font/src/java/org/foray/font/FontServer4a.java
===================================================================
--- trunk/foray/foray-font/src/java/org/foray/font/FontServer4a.java 2009-04-25 15:23:18 UTC (rev 10772)
+++ trunk/foray/foray-font/src/java/org/foray/font/FontServer4a.java 2009-04-25 15:36:00 UTC (rev 10773)
@@ -40,6 +40,7 @@
import org.axsl.font.FontServer;
import org.axsl.font.output.FontOutput;
import org.axsl.ps.Encoding;
+import org.axsl.ps.PsServer;
import org.apache.commons.logging.Log;
@@ -155,6 +156,9 @@
private Map<String, FontSelectorFactory> registeredFontSelectorFactories
= new HashMap<String, FontSelectorFactory>();
+ /** The PostScript server. */
+ private PsServer psServer;
+
/**
* Constructor.
* @param logger The Logger to be used for system-level messages. Please
@@ -163,9 +167,11 @@
* system-level messages can be logged to the FontServer logger, and
* messages that are more client-related can be logged to the FontConsumer
* logger.
+ * @param psServer The PostScript server.
*/
- public FontServer4a(final Log logger) {
+ public FontServer4a(final Log logger, final PsServer psServer) {
this.logger = logger;
+ this.psServer = psServer;
try {
registerStandardOutputFactories();
} catch (final FontException e) {
@@ -1260,4 +1266,12 @@
return this.fontFamilies.values();
}
+ /**
+ * Returns the PostScript server.
+ * @return The PostScript server.
+ */
+ public PsServer getPsServer() {
+ return this.psServer;
+ }
+
}
Modified: trunk/foray/foray-font/src/javatest/org/foray/font/TestFontServer4a.java
===================================================================
--- trunk/foray/foray-font/src/javatest/org/foray/font/TestFontServer4a.java 2009-04-25 15:23:18 UTC (rev 10772)
+++ trunk/foray/foray-font/src/javatest/org/foray/font/TestFontServer4a.java 2009-04-25 15:36:00 UTC (rev 10773)
@@ -31,8 +31,10 @@
import org.foray.common.Environment;
import org.foray.common.Logging;
import org.foray.common.url.URLFactory;
+import org.foray.ps.PsServer4a;
import org.axsl.font.FontException;
+import org.axsl.ps.PsServer;
import org.apache.commons.logging.Log;
@@ -58,7 +60,8 @@
public static FontServer4a getServer() throws FontException {
if (TestFontServer4a.fontServer == null) {
final Log logger = Logging.makeDefaultLogger();
- final FontServer4a fontServer = new FontServer4a(logger);
+ final PsServer psServer = new PsServer4a();
+ final FontServer4a fontServer = new FontServer4a(logger, psServer);
fontServer.setup(null, null);
TestFontServer4a.fontServer = fontServer;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|