HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › HTML/CSS rendering issues › Issue with font family on chinese characters › Re: Re: Issue with font family on chinese characters
thanks for your support
we have changed it to call this function before showing the content
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class CJKFinder {
public static void main(String[] args) {
String str = ” 育暮 1 Great Work M R 12 13 14 育暮趣所及定平関島指形由幹設世戸 122 育暮趣所$及定平関 島指形由幹設世戸 hello. aiguë διαίρεσις”;
System.out.println(applyCJKStyle(str));
}
public static String applyCJKStyle(String text){
Pattern pattern = Pattern.compile(“([u4E00-u9FFF]{1,})”);
Matcher matcher = pattern.matcher(text);
StringBuffer output = new StringBuffer();
while (matcher.find()){
matcher.appendReplacement(output, “$1“);
}
matcher.appendTail(output);
return output.toString();
}
}