coreldraw在对英文进行排版的时候,为啥会出现无法对齐?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了coreldraw在对英文进行排版的时候,为啥会出现无法对齐?相关的知识,希望对你有一定的参考价值。

对英文进行排版的时候,我是将英文复制进去的,边上总是无法对齐,点了全部对齐,然后微调,效果还是不好,很多单词之间距离大,有的距离又小,如果强制对齐更是不可能,如果最后一排只有一个单词,就会占满最后一行。
问题是整段的英文,不是最后一行,比如说:输入了一段英文,第一行最后一个单词是一个很长的单词,第一行的末尾就会空下一段距离,那个单词跑到下一行去了,第二行的单词如果比较均匀的话,第二行就会对齐了,像这样总是出现某一行的末尾会有一段小小的距离看起来非常难看(这就是把文字剪切到记事本里,再复制进去之后的结果).出现这种情况之后,点全部对齐,英文之间的确会2边都对齐了,但是在英文中会出现某些单词之间的距离很大,而有些单词之间的距离又很小.
我的目的是把英文放在一个规定大小的文本框里,然后文本要两边标准对齐,英文中每个单词之间的距离要很正常. 请帮我解决一下.谢谢啦

参考技术A 你最后一排不好和上面的段落分开啊?

1.尽量每行单词字数差不多 调整每行的字距 达到要求
2.拆分单词 用连字符“-”
3.强迫对齐,最后一行单独一段
参考技术B 把内容全部剪切贴到记事本里面 然后再全选 复制到C9里面 就OK了 希望能帮到你

为啥Servlet ServerContainer FactoryBean在测试的时候会出问题?

【中文标题】为啥Servlet ServerContainer FactoryBean在测试的时候会出问题?【英文标题】:Why is ServletServerContainerFactoryBean casuing problems when testing?为什么Servlet ServerContainer FactoryBean在测试的时候会出问题? 【发布时间】:2015-07-10 18:25:23 【问题描述】:

我正在使用 Spring Boot 做一个 Web 应用程序。此应用程序还配置为使用 WebSocket 并处理(非常基本的)传入消息。

该应用程序似乎运行良好。问题是当我做一些测试时。 相关部分如下:

//WebManagerApplication.java
@Configuration
@ComponentScan
@EnableAutoConfiguration
public class WebManagerApplication 
    public static void main(String[] args) 
        SpringApplication.run(WebManagerApplication.class, args);
    

//

//WebSocketConfig.java
@Configuration
@EnableWebSocket
public class WebSocketConfig implements WebSocketConfigurer

    @Override
    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) 
        registry.addHandler(chatWebSocketHandler(), "/chat");
    

    @Bean
    public ServletServerContainerFactoryBean createWebSocketContainer() 
        ServletServerContainerFactoryBean container = new ServletServerContainerFactoryBean();
        container.setMaxTextMessageBufferSize(8192);
        container.setMaxBinaryMessageBufferSize(250_000);
        return container;
    

    @Bean
    public WebSocketHandler chatWebSocketHandler() 
        Class<ADWebSocketHandler> handlerType = ADWebSocketHandler.class;
        return new PerConnectionWebSocketHandler(handlerType);
    

//

//FooTest.java
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = WebManagerApplication.class)
@WebAppConfiguration
public class FooTest 

    @Autowired
    private WebApplicationContext wac;

    private MockMvc mockMvc;
    @Before
public void setup() 
    this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();

//... blah
//Here's the error
2015-04-30 13:40:58.567 ERROR 9488 --- [           main] 

o.s.boot.SpringApplication               : Application startup failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'createWebSocketContainer' defined in class path resource [com/alldata/webmanager/WebSocketConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: A ServletContext is required to access the javax.websocket.server.ServerContainer instance
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:743)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
    at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:98)
    at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:68)
    at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:86)
    at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72)
    at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:170)
    at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:110)
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:200)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:252)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:254)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:217)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.lang.IllegalStateException: A ServletContext is required to access the javax.websocket.server.ServerContainer instance
    at org.springframework.util.Assert.state(Assert.java:385)
    at org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean.afterPropertiesSet(ServletServerContainerFactoryBean.java:99)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1625)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1562)
    ... 39 common frames omitted

2015-04-30 13:40:58.567 ERROR 9488 --- [           main] o.s.test.context.TestContextManager      : Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@57536d79] to prepare test instance [com.alldata.webmanager.controller.FooReferenceTest@3cc053]

java.lang.IllegalStateException: Failed to load ApplicationContext
    at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:94)
    at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72)
    at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:170)
    at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:110)
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:200)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:252)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:254)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:217)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'createWebSocketContainer' defined in class path resource [com/alldata/webmanager/WebSocketConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: A ServletContext is required to access the javax.websocket.server.ServerContainer instance
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:743)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
    at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:98)
    at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:68)
    at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:86)
    ... 25 common frames omitted
Caused by: java.lang.IllegalStateException: A ServletContext is required to access the javax.websocket.server.ServerContainer instance
    at org.springframework.util.Assert.state(Assert.java:385)
    at org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean.afterPropertiesSet(ServletServerContainerFactoryBean.java:99)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1625)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1562)
    ... 39 common frames omitted

如您所见,问题出在 createWebSocketContainer bean 上。如果我删除它,测试可以运行。但我需要那个 bean 来配置 maxTextBuferSize 和 maxBinaryMessageSize。

【问题讨论】:

请参考docs.spring.io/spring/docs/current/spring-framework-reference/… @M1990 我看到了同样的问题,我使用的是嵌入式 tomcat,我确实有 ServletServerContainerFactoryBean,这个问题只能在测试期间看到。你知道为什么会这样吗? 我正在使用没有 stomp 的 websocket,即纯 websocket。 【参考方案1】:

如果有人仍然有这个问题,对我有用的解决方案是:

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)

【讨论】:

【参考方案2】:

解决方案是通过在测试类中添加@org.springframework.boot.test.IntegrationTest("server.port:0") 注解,将测试作为集成测试运行。

问题在于 Spring 的单元测试工具使用 org.springframework.boot.test.SpringBootMockServletContext 作为 servlet 上下文,并且它没有将“javax.websocket.server.ServerContainer”属性设置为 javax 的实例。 websocket.server.ServerContainer(SpringBootMockServletContext,简而言之,不支持WebSockets)。

我已在https://jira.spring.io/browse/SPR-14367 报告此问题

【讨论】:

感谢这对我使用 Spring Boot 确实有帮助,但提供的解决方案不起作用。查看问题的答案是在测试类中添加:@WebAppConfiguration 并解决了它。 如果这不起作用,另一种解决方案是在测试时不使用这个工厂(当然并不总是准确的选择)。如果您使用专用配置文件进行测试,只需添加@Profile("!test"),或@ConditionalOnMissingClass(value = "org.springframework.boot.test.context.SpringBootTestContextBootstrapper")

以上是关于coreldraw在对英文进行排版的时候,为啥会出现无法对齐?的主要内容,如果未能解决你的问题,请参考以下文章

coreldraw 打字或是修改文字时运行超慢,是啥原因啊?

为啥coreldraw打字时会突然变大。

在CORELDRAW中怎么输入带拼音,声调的汉字然后排版

coreldraw 主要用来啥图

coreldraw软件简介

coredraw是个怎样的工具?