aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/afp/goca/GraphicsSetCharacterSet.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2008-12-09 15:00:35 +0000
committerJeremias Maerki <jeremias@apache.org>2008-12-09 15:00:35 +0000
commita6ddced309701a1ca8d79a9e7bec3288afba2cc8 (patch)
treec3d2bcfe7277246d9a2acc3675721a99f4de5727 /src/java/org/apache/fop/afp/goca/GraphicsSetCharacterSet.java
parent9d339f0968314f0cfcc4a720628fed1845292ce1 (diff)
parentf9d4720b99f5e0fb423b097d7207dfab446d911c (diff)
downloadxmlgraphics-fop-a6ddced309701a1ca8d79a9e7bec3288afba2cc8.tar.gz
xmlgraphics-fop-a6ddced309701a1ca8d79a9e7bec3288afba2cc8.zip
Merge from Trunk revisions 719662 - 724689.
Conflict for ImageHandler interface resolved by renaming Trunk's ImageHandler to ImageHandlerBase and extending the other ImageHandler from that. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@724729 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/afp/goca/GraphicsSetCharacterSet.java')
-rw-r--r--src/java/org/apache/fop/afp/goca/GraphicsSetCharacterSet.java66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/afp/goca/GraphicsSetCharacterSet.java b/src/java/org/apache/fop/afp/goca/GraphicsSetCharacterSet.java
new file mode 100644
index 000000000..b3d1158fe
--- /dev/null
+++ b/src/java/org/apache/fop/afp/goca/GraphicsSetCharacterSet.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id: $ */
+
+package org.apache.fop.afp.goca;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.apache.fop.afp.util.BinaryUtils;
+
+/**
+ * Sets the current character set (font) to be used for following graphics strings
+ */
+public class GraphicsSetCharacterSet extends AbstractGraphicsDrawingOrder {
+
+ /** font character set reference */
+ private final int fontReference;
+
+ /**
+ * @param fontReference character set font reference
+ */
+ public GraphicsSetCharacterSet(int fontReference) {
+ this.fontReference = fontReference;
+ }
+
+ /** {@inheritDoc} */
+ public void writeToStream(OutputStream os) throws IOException {
+ byte[] data = new byte[] {
+ getOrderCode(), // GSCS order code
+ BinaryUtils.convert(fontReference)[0]
+ };
+ os.write(data);
+ }
+
+ /** {@inheritDoc} */
+ public int getDataLength() {
+ return 2;
+ }
+
+ /** {@inheritDoc} */
+ public String toString() {
+ return "GraphicsSetCharacterSet(" + fontReference + ")";
+ }
+
+ /** {@inheritDoc} */
+ byte getOrderCode() {
+ return 0x38;
+ }
+
+} \ No newline at end of file