1*07d7dbdcSHerbert Dürr /************************************************************** 2*07d7dbdcSHerbert Dürr * 3*07d7dbdcSHerbert Dürr * Licensed to the Apache Software Foundation (ASF) under one 4*07d7dbdcSHerbert Dürr * or more contributor license agreements. See the NOTICE file 5*07d7dbdcSHerbert Dürr * distributed with this work for additional information 6*07d7dbdcSHerbert Dürr * regarding copyright ownership. The ASF licenses this file 7*07d7dbdcSHerbert Dürr * to you under the Apache License, Version 2.0 (the 8*07d7dbdcSHerbert Dürr * "License"); you may not use this file except in compliance 9*07d7dbdcSHerbert Dürr * with the License. You may obtain a copy of the License at 10*07d7dbdcSHerbert Dürr * 11*07d7dbdcSHerbert Dürr * http://www.apache.org/licenses/LICENSE-2.0 12*07d7dbdcSHerbert Dürr * 13*07d7dbdcSHerbert Dürr * Unless required by applicable law or agreed to in writing, 14*07d7dbdcSHerbert Dürr * software distributed under the License is distributed on an 15*07d7dbdcSHerbert Dürr * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*07d7dbdcSHerbert Dürr * KIND, either express or implied. See the License for the 17*07d7dbdcSHerbert Dürr * specific language governing permissions and limitations 18*07d7dbdcSHerbert Dürr * under the License. 19*07d7dbdcSHerbert Dürr * 20*07d7dbdcSHerbert Dürr *************************************************************/ 21*07d7dbdcSHerbert Dürr 22eba4d44aSLiu Zhe package fvt.uno.sw.puretext; 23eba4d44aSLiu Zhe 24eba4d44aSLiu Zhe import static org.junit.Assert.*; 25eba4d44aSLiu Zhe 26eba4d44aSLiu Zhe import org.junit.After; 27eba4d44aSLiu Zhe import org.junit.Before; 28eba4d44aSLiu Zhe import org.junit.Test; 29eba4d44aSLiu Zhe import org.openoffice.test.common.FileUtil; 30eba4d44aSLiu Zhe import org.openoffice.test.common.Testspace; 31eba4d44aSLiu Zhe import org.openoffice.test.uno.UnoApp; 32eba4d44aSLiu Zhe import com.sun.star.text.*; 33eba4d44aSLiu Zhe import com.sun.star.beans.*; 34eba4d44aSLiu Zhe import com.sun.star.frame.XStorable; 35eba4d44aSLiu Zhe import com.sun.star.uno.UnoRuntime; 36eba4d44aSLiu Zhe 37eba4d44aSLiu Zhe public class CharacterFontname { 38eba4d44aSLiu Zhe private static final UnoApp app = new UnoApp(); 39eba4d44aSLiu Zhe XText xText = null; 40eba4d44aSLiu Zhe 41eba4d44aSLiu Zhe @Before setUp()42eba4d44aSLiu Zhe public void setUp() throws Exception { 43eba4d44aSLiu Zhe app.start(); 44eba4d44aSLiu Zhe 45eba4d44aSLiu Zhe } 46eba4d44aSLiu Zhe 47eba4d44aSLiu Zhe @After tearDown()48eba4d44aSLiu Zhe public void tearDown() throws Exception { 49eba4d44aSLiu Zhe app.close(); 50eba4d44aSLiu Zhe } 51eba4d44aSLiu Zhe @Test testCharacterFontSetting()52eba4d44aSLiu Zhe public void testCharacterFontSetting() throws Exception { 53eba4d44aSLiu Zhe XTextDocument xTextDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, app.newDocument("swriter"));// new a text document 54eba4d44aSLiu Zhe xText = xTextDocument.getText(); 55eba4d44aSLiu Zhe xText.setString("We are Chinese,they are American. We are all living in one earth!" 56eba4d44aSLiu Zhe + "and we all love our home very much!!!We are Chinese,they are American. " + 57eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 58eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 59eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 60eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 61eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American." + 62eba4d44aSLiu Zhe " We are all living in one earth!We are Chinese,they are American. " + 63eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 64eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 65eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 66eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 67eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 68eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 69eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 70eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 71eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 72eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 73eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 74eba4d44aSLiu Zhe "We are all living in one earth!We are all living in one earth!We are Chinese,they are American. " + 75eba4d44aSLiu Zhe "We are all living in one earth!We are all living in one earth!We are Chinese,they are American. " + 76eba4d44aSLiu Zhe "We are all living in one earth!We are all living in one earth!We are Chinese,they are American. " + 77eba4d44aSLiu Zhe "We are all living in one earth!We are all living in one earth!We are Chinese,they are American. " + 78eba4d44aSLiu Zhe "We are all living in one earth!We are all living in one earth!We are Chinese,they are American. " + 79eba4d44aSLiu Zhe "We are all living in one earth!We are all living in one earth!We are Chinese,they are American. " + 80eba4d44aSLiu Zhe "We are all living in one earth!"); 81eba4d44aSLiu Zhe // create text cursor for selecting and formatting text 82eba4d44aSLiu Zhe XTextCursor xTextCursor = xText.createTextCursor(); 83eba4d44aSLiu Zhe XPropertySet xCursorProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextCursor); 84eba4d44aSLiu Zhe xTextCursor.gotoStart(false); 85eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 86eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "Times New Roman"); 87eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 88eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 89eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "Arial Black"); 90eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 91eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 92eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "Aharoni"); 93eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 94eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 95eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "Agency FB"); 96eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 97eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 98eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "Algerian"); 99eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 100eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 101eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "Andalus"); 102eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 103eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 104eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "Bodoni MT Black"); 105eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 106eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 107eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "BatangChe"); 108eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 109eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 110eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "Britannic Bold"); 111eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 112eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 113eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "Cooper Black"); 114eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 115eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 116eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "DaunPenh"); 117eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 118eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 119eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "Estrangelo Edessa"); 120eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 121eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 122eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "Wingdings"); 123eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 124eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 125eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "Rage Italic"); 126eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 127eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 128eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "Symbol"); 129eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 130eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 131eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "Tw Cen MT Condensed Extra Bold"); 132eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 133eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 134eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "Vivaldi"); 135eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 136eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 137eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "SimSun"); 138eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 139eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 140eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharFontName", "Lucida Bright"); 141eba4d44aSLiu Zhe //save to odt 142eba4d44aSLiu Zhe XStorable xStorable_odt = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDocument); 143eba4d44aSLiu Zhe PropertyValue[] aStoreProperties_odt = new PropertyValue[2]; 144eba4d44aSLiu Zhe aStoreProperties_odt[0] = new PropertyValue(); 145eba4d44aSLiu Zhe aStoreProperties_odt[1] = new PropertyValue(); 146eba4d44aSLiu Zhe aStoreProperties_odt[0].Name = "Override"; 147eba4d44aSLiu Zhe aStoreProperties_odt[0].Value = true; 148eba4d44aSLiu Zhe aStoreProperties_odt[1].Name = "FilterName"; 149eba4d44aSLiu Zhe aStoreProperties_odt[1].Value = "StarOffice XML (Writer)"; 150eba4d44aSLiu Zhe xStorable_odt.storeToURL(FileUtil.getUrl(Testspace.getPath("output/test.odt")), aStoreProperties_odt); 151eba4d44aSLiu Zhe //save to doc 152eba4d44aSLiu Zhe XStorable xStorable_doc = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDocument); 153eba4d44aSLiu Zhe PropertyValue[] aStoreProperties_doc = new PropertyValue[2]; 154eba4d44aSLiu Zhe aStoreProperties_doc[0] = new PropertyValue(); 155eba4d44aSLiu Zhe aStoreProperties_doc[1] = new PropertyValue(); 156eba4d44aSLiu Zhe aStoreProperties_doc[0].Name = "Override"; 157eba4d44aSLiu Zhe aStoreProperties_doc[0].Value = true; 158eba4d44aSLiu Zhe aStoreProperties_doc[1].Name = "FilterName"; 159eba4d44aSLiu Zhe aStoreProperties_doc[1].Value = "MS Word 97"; 160eba4d44aSLiu Zhe xStorable_doc.storeToURL(FileUtil.getUrl(Testspace.getPath("output/test.doc")), aStoreProperties_doc); 161eba4d44aSLiu Zhe app.closeDocument(xTextDocument); 162eba4d44aSLiu Zhe 163eba4d44aSLiu Zhe //reopen the document and assert font style 164eba4d44aSLiu Zhe XTextDocument assertDocument=(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, app.loadDocument(Testspace.getPath("output/test.odt"))); 165eba4d44aSLiu Zhe XTextCursor xTextCursor_assert = assertDocument.getText().createTextCursor(); 166eba4d44aSLiu Zhe XPropertySet xCursorProps_assert = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextCursor_assert); 167eba4d44aSLiu Zhe 168eba4d44aSLiu Zhe xTextCursor_assert.gotoStart(false); 169eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 170eba4d44aSLiu Zhe assertEquals("Times New Roman",xCursorProps_assert.getPropertyValue("CharFontName")); 171eba4d44aSLiu Zhe xTextCursor_assert.gotoRange(xTextCursor_assert, false); 172eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 173eba4d44aSLiu Zhe assertEquals("Arial Black",xCursorProps_assert.getPropertyValue("CharFontName")); 174eba4d44aSLiu Zhe xTextCursor_assert.gotoRange(xTextCursor_assert, false); 175eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 176eba4d44aSLiu Zhe assertEquals("Aharoni",xCursorProps_assert.getPropertyValue("CharFontName")); 177eba4d44aSLiu Zhe xTextCursor_assert.gotoRange(xTextCursor_assert, false); 178eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 179eba4d44aSLiu Zhe assertEquals("Agency FB",xCursorProps_assert.getPropertyValue("CharFontName")); 180eba4d44aSLiu Zhe xTextCursor_assert.gotoRange(xTextCursor_assert, false); 181eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 182eba4d44aSLiu Zhe assertEquals("Algerian",xCursorProps_assert.getPropertyValue("CharFontName")); 183eba4d44aSLiu Zhe xTextCursor_assert.gotoRange(xTextCursor_assert, false); 184eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 185eba4d44aSLiu Zhe assertEquals("Andalus",xCursorProps_assert.getPropertyValue("CharFontName")); 186eba4d44aSLiu Zhe xTextCursor_assert.gotoRange(xTextCursor_assert, false); 187eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 188eba4d44aSLiu Zhe assertEquals("Bodoni MT Black",xCursorProps_assert.getPropertyValue("CharFontName")); 189eba4d44aSLiu Zhe xTextCursor_assert.gotoRange(xTextCursor_assert, false); 190eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 191eba4d44aSLiu Zhe assertEquals("BatangChe",xCursorProps_assert.getPropertyValue("CharFontName")); 192eba4d44aSLiu Zhe xTextCursor_assert.gotoRange(xTextCursor_assert, false); 193eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 194eba4d44aSLiu Zhe assertEquals("Britannic Bold",xCursorProps_assert.getPropertyValue("CharFontName")); 195eba4d44aSLiu Zhe xTextCursor_assert.gotoRange(xTextCursor_assert, false); 196eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 197eba4d44aSLiu Zhe assertEquals("Cooper Black",xCursorProps_assert.getPropertyValue("CharFontName")); 198eba4d44aSLiu Zhe xTextCursor_assert.gotoRange(xTextCursor_assert, false); 199eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 200eba4d44aSLiu Zhe assertEquals("DaunPenh",xCursorProps_assert.getPropertyValue("CharFontName")); 201eba4d44aSLiu Zhe xTextCursor_assert.gotoRange(xTextCursor_assert, false); 202eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 203eba4d44aSLiu Zhe assertEquals("Estrangelo Edessa",xCursorProps_assert.getPropertyValue("CharFontName")); 204eba4d44aSLiu Zhe xTextCursor_assert.gotoRange(xTextCursor_assert, false); 205eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 206eba4d44aSLiu Zhe assertEquals("Wingdings",xCursorProps_assert.getPropertyValue("CharFontName")); 207eba4d44aSLiu Zhe xTextCursor_assert.gotoRange(xTextCursor_assert, false); 208eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 209eba4d44aSLiu Zhe assertEquals("Rage Italic",xCursorProps_assert.getPropertyValue("CharFontName")); 210eba4d44aSLiu Zhe xTextCursor_assert.gotoRange(xTextCursor_assert, false); 211eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 212eba4d44aSLiu Zhe assertEquals("Symbol",xCursorProps_assert.getPropertyValue("CharFontName")); 213eba4d44aSLiu Zhe xTextCursor_assert.gotoRange(xTextCursor_assert, false); 214eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 215eba4d44aSLiu Zhe assertEquals("Tw Cen MT Condensed Extra Bold",xCursorProps_assert.getPropertyValue("CharFontName")); 216eba4d44aSLiu Zhe xTextCursor_assert.gotoRange(xTextCursor_assert, false); 217eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 218eba4d44aSLiu Zhe assertEquals("Vivaldi",xCursorProps_assert.getPropertyValue("CharFontName")); 219eba4d44aSLiu Zhe xTextCursor_assert.gotoRange(xTextCursor_assert, false); 220eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 221eba4d44aSLiu Zhe assertEquals("SimSun",xCursorProps_assert.getPropertyValue("CharFontName")); 222eba4d44aSLiu Zhe xTextCursor_assert.gotoRange(xTextCursor_assert, false); 223eba4d44aSLiu Zhe xTextCursor_assert.goRight((short) 100, true); 224eba4d44aSLiu Zhe assertEquals("Lucida Bright",xCursorProps_assert.getPropertyValue("CharFontName")); 225eba4d44aSLiu Zhe 226eba4d44aSLiu Zhe //reopen the document and assert font style 227eba4d44aSLiu Zhe XTextDocument assertDocument_doc=(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, app.loadDocument(Testspace.getPath("output/test.odt"))); 228eba4d44aSLiu Zhe XTextCursor xTextCursor_assert_doc = assertDocument_doc.getText().createTextCursor(); 229eba4d44aSLiu Zhe XPropertySet xCursorProps_assert_doc = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextCursor_assert_doc); 230eba4d44aSLiu Zhe 231eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoStart(false); 232eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 233eba4d44aSLiu Zhe assertEquals("Times New Roman",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 234eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 235eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 236eba4d44aSLiu Zhe assertEquals("Arial Black",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 237eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 238eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 239eba4d44aSLiu Zhe assertEquals("Aharoni",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 240eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 241eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 242eba4d44aSLiu Zhe assertEquals("Agency FB",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 243eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 244eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 245eba4d44aSLiu Zhe assertEquals("Algerian",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 246eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 247eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 248eba4d44aSLiu Zhe assertEquals("Andalus",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 249eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 250eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 251eba4d44aSLiu Zhe assertEquals("Bodoni MT Black",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 252eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 253eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 254eba4d44aSLiu Zhe assertEquals("BatangChe",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 255eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 256eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 257eba4d44aSLiu Zhe assertEquals("Britannic Bold",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 258eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 259eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 260eba4d44aSLiu Zhe assertEquals("Cooper Black",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 261eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 262eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 263eba4d44aSLiu Zhe assertEquals("DaunPenh",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 264eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 265eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 266eba4d44aSLiu Zhe assertEquals("Estrangelo Edessa",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 267eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 268eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 269eba4d44aSLiu Zhe assertEquals("Wingdings",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 270eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 271eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 272eba4d44aSLiu Zhe assertEquals("Rage Italic",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 273eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 274eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 275eba4d44aSLiu Zhe assertEquals("Symbol",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 276eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 277eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 278eba4d44aSLiu Zhe assertEquals("Tw Cen MT Condensed Extra Bold",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 279eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 280eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 281eba4d44aSLiu Zhe assertEquals("Vivaldi",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 282eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 283eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 284eba4d44aSLiu Zhe assertEquals("SimSun",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 285eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 286eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 287eba4d44aSLiu Zhe assertEquals("Lucida Bright",xCursorProps_assert_doc.getPropertyValue("CharFontName")); 288eba4d44aSLiu Zhe } 289eba4d44aSLiu Zhe } 290