1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package com.isenshi.util.extlib;
17
18 import com.lowagie.text.SplitCharacter;
19 import com.lowagie.text.pdf.PdfChunk;
20
21 public class CJKSplitCharacter implements SplitCharacter {
22
23 public boolean isSplitCharacter(int start, int current, int end, char[] cc,
24 PdfChunk[] ck) {
25
26
27
28 char c;
29 if (ck == null)
30 c = cc[current];
31 else
32 c = ck[Math.min(current, ck.length - 1)]
33 .getUnicodeEquivalent(cc[current]);
34 if (c <= ' ' || c == '-') {
35 return true;
36 }
37 if (c < 0x2e80)
38 return false;
39
40
41
42 if(cc.length>current+1){
43 char c2 = cc[current+1];
44 if (c2 == 0x3001 || c2 == 0x3002) {
45 return false;
46 }
47 }
48
49
50 return ((c >= 0x2e80 && c < 0xd7a0) || (c >= 0xf900 && c < 0xfb00)
51 || (c >= 0xfe30 && c < 0xfe50) || (c >= 0xff61 && c < 0xffa0));
52
53 }
54 }