AnsweredAssumed Answered

how can i generate diagram for asian font ??

Question asked by ozhuang on Dec 2, 2013
Latest reply on Dec 2, 2013 by ozhuang

this is my config:
   
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
      <property name="databaseType" value="h2" />
      <property name="dataSource" ref="dataSource" />
      <property name="transactionManager" ref="transactionManager" />
      <property name="databaseSchemaUpdate" value="true" />
      <property name="jobExecutorActivate" value="false" />
       
        <property name="activityFontName" value="asian font"/>
        <property name="labelFontName" value="asian font"/>
   </bean>
==============================

this is my code:

String filename="F:/Users/Administrator/workspace_workflow/activiti tu/src/main/resources/pms_template/ONE.bpmn";
      
       System.out.println(processEngineConfiguration.getActivityFontName());
       System.out.println(processEngineConfiguration.getLabelFontName());      
      
       byte[] bytes_s=Files.readAllBytes(new File(filename).toPath());
      
       BpmnXMLConverter bpmnXMLConverter = new BpmnXMLConverter();
       BpmnModel  bpmnModel=bpmnXMLConverter.convertToBpmnModel(new BytesStreamSource(bytes_s), false, false); // no need to validate schema, it was already validated on deploy
      
       InputStream is = ProcessDiagramGenerator.generateDiagram(
                   bpmnModel, "png", Collections.EMPTY_LIST);

      File file = new File("F:/Users/Administrator/workspace_workflow/activiti tu/src/main/resources/pms_template/ONE.png");
      OutputStream  outputStream = new FileOutputStream(file);

      int read = 0;
      byte[] bytes = new byte[1024];

      while ((read = is.read(bytes)) != -1) {
         outputStream.write(bytes, 0, read);
      }
      outputStream.close();   

===================
this is my  generated diagram,

http://static.oschina.net/uploads/space/2013/0328/172838_wDCI_200838.png

it is bad  font display and can't read…..

Outcomes