diff options
author | Yegor Kozlov <yegor@apache.org> | 2012-01-25 07:53:07 +0000 |
---|---|---|
committer | Yegor Kozlov <yegor@apache.org> | 2012-01-25 07:53:07 +0000 |
commit | 97d0beab68c4b1aff70c784caf8219ab4bb7a433 (patch) | |
tree | 8cecc60f82e2350dd3fb54a0fc026ee1f33c226e /src/ooxml/testcases | |
parent | 1df1a286b9fe0e268988fdc4e7bd339944f1e576 (diff) | |
download | poi-97d0beab68c4b1aff70c784caf8219ab4bb7a433.tar.gz poi-97d0beab68c4b1aff70c784caf8219ab4bb7a433.zip |
support kerning in XSLF text runs
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1235668 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/testcases')
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java | 6 | ||||
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextRun.java | 66 |
2 files changed, 67 insertions, 5 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java index 50d4c812b5..19eee771f4 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java @@ -27,11 +27,7 @@ import java.awt.image.BufferedImage; import java.util.List;
/**
- * Created by IntelliJ IDEA.
- * User: yegor
- * Date: Nov 10, 2011
- * Time: 1:43:25 PM
- * To change this template use File | Settings | File Templates.
+ * @author Yegor Kozlov
*/
public class TestXSLFTextParagraph extends TestCase {
private static POILogger _logger = POILogFactory.getLogger(XSLFTextParagraph.class);
diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextRun.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextRun.java new file mode 100644 index 0000000000..3ee2616b0b --- /dev/null +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextRun.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.
+ * ====================================================================
+ */
+package org.apache.poi.xslf.usermodel;
+
+import junit.framework.TestCase;
+import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
+import org.apache.poi.xslf.XSLFTestDataSamples;
+
+import java.awt.*;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.util.List;
+
+/**
+ * @author Yegor Kozlov
+ */
+public class TestXSLFTextRun extends TestCase {
+
+ public void testRunProperties(){
+ XMLSlideShow ppt = new XMLSlideShow();
+ XSLFSlide slide = ppt.createSlide();
+ XSLFTextShape sh = slide.createAutoShape();
+
+ XSLFTextRun r = sh.addNewTextParagraph().addNewTextRun();
+ assertEquals("en-US", r.getRpR().getLang());
+
+ assertEquals(0., r.getCharacterSpacing());
+ r.setCharacterSpacing(3);
+ assertEquals(3., r.getCharacterSpacing());
+ r.setCharacterSpacing(-3);
+ assertEquals(-3., r.getCharacterSpacing());
+ r.setCharacterSpacing(0);
+ assertEquals(0., r.getCharacterSpacing());
+ assertFalse(r.getRpR().isSetSpc());
+
+ assertEquals(Color.black, r.getFontColor());
+ r.setFontColor(Color.red);
+ assertEquals(Color.red, r.getFontColor());
+
+ assertEquals("Calibri", r.getFontFamily());
+ r.setFontFamily("Arial");
+ assertEquals("Arial", r.getFontFamily());
+
+ assertEquals(18.0, r.getFontSize());
+ r.setFontSize(13.0);
+ assertEquals(13.0, r.getFontSize());
+
+ }
+}
|