Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of Chinese garbled codes in activiti

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to solve the problem of garbled codes in activiti". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Garbled image resources may occur when using activiti, as shown in the figure:

The problem of garbled code is the first big problem that puzzles the Chinese people. There are all garbled codes.

How to modify garbled code:

(1) modify the source code directly:

Constructor of the org.activiti.engine.impl.bpmn.diagram.ProcessDiagramCanvas class

Protected String activityFontName = "Arial"; public ProcessDiagramCanvas (int width, int height) {this.canvasWidth = width; this.canvasHeight = height; if (Context.getProcessEngineConfiguration ()! = null) {this.activityFontName = Context.getProcessEngineConfiguration (). GetActivityFontName ();} this.processDiagram = new BufferedImage (width, height, BufferedImage.TYPE_INT_ARGB); this.g = processDiagram.createGraphics (); g.setRenderingHint (RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON) G.setPaint (Color.black); Font font = new Font (activityFontName, Font.BOLD, FONT_SIZE); g.setFont (font); this.fontMetrics = g.getFontMetrics ();}

Just change the font to Song style, this method is not recommended, this is too inflexible.

(2) add attributes to the configuration file activiti.cfg.xml (highly recommended):

In this way, some people say that it can only be on 5.12, but I have seen it on 5.11.

It mainly depends on whether the ProcessEngineConfiguration class has a set method:

Public void setActivityFontName (String activityFontName) {this.activityFontName = activityFontName;} "how to solve the problem of garbled codes in activiti" is introduced here. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report