Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/357.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java程序中的克罗地亚字母_Java_Fonts_Playframework_Itext - Fatal编程技术网

Java程序中的克罗地亚字母

Java程序中的克罗地亚字母,java,fonts,playframework,itext,Java,Fonts,Playframework,Itext,在我的程序中,我需要你对克罗地亚字母的帮助。在网站(play framework)上,您可以输入名称。将保存名称并创建一个PDF文件(使用iText),其中显示用户键入的字符串。我想用lucida bright字体。问题是名字中有一些非德语字母没有显示出来。我还尝试将其转换为unicode(/u----),但它也不起作用。我试着在iText文档中这样使用utf-8: String name = new String(e.getName().getBytes("UTF-8")); // e is

在我的程序中,我需要你对克罗地亚字母的帮助。在网站(play framework)上,您可以输入名称。将保存名称并创建一个PDF文件(使用iText),其中显示用户键入的字符串。我想用lucida bright字体。问题是名字中有一些非德语字母没有显示出来。我还尝试将其转换为unicode(/u----),但它也不起作用。我试着在iText文档中这样使用utf-8:

String name = new String(e.getName().getBytes("UTF-8"));
// e is the object where the name and some other infos are saved
在html中,用户可以在其中键入名称

<meta name="language" content="cr">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

但它并不完全有效


在《卢西达》中,布莱特(字体)只正确地显示了š和š,在《泰晤士报》中是新罗马的Ž、Ž、š和ž。如何解决此问题?

如果要在iText的PDF生成中使用字体,则必须添加该字体


有关更多信息,请参见我使用
BaseFont bf=BaseFont.createFont(“conf/fonts/Lucida_Bright.ttf”,BaseFont.CP1252,BaseFont.EMBEDDED)完成的操作
canvas.setFontAndSize(bf,7f)这是因为我使用的是canvas.showTextAligned(Element.ALIGN_LEFT,“ĆĐèŽčđš”,x,y,0)Font font = FontFactory.getFont("Times-Roman");
document.add(new Paragraph("Times-Roman", font));