Tag: arabic

在JTextField中键入阿拉伯数字

我试图在JTextField键入阿拉伯数字,我使用DocumentListener ,如下所示: txtName.getDocument().addDocumentListener(this); … public void insertUpdate(DocumentEvent e){setLabel();} public void removeUpdate(DocumentEvent e){setLabel();} public void changedUpdate(DocumentEvent e){} public void setLabel() { String s = txtName.getText(); s = s.replace(‘0′,’\u0660’); s = s.replace(‘1′,’\u0661’); s = s.replace(‘2′,’\u0662’); s = s.replace(‘3′,’\u0663’); s = s.replace(‘4′,’\u0664’); s = s.replace(‘5′,’\u0665’); s = s.replace(‘6′,’\u0666’); s = s.replace(‘7′,’\u0667’); s = s.replace(‘8′,’\u0668’); s = s.replace(‘9′,’\u0669’); s […]

在JOptionPane中将文本右对齐

是否可以在JOptionPane中将文本对齐? (我不想使用JDialog)因为我想用阿拉伯语写一些句子

扫描阿拉伯语字符netbeans 8

我有这个简单的代码打印阿拉伯语句子和扫描阿拉伯字符。 什么是疯狂的是它在cmd中打印正确,但从不扫描字符,它扫描阿拉伯字符的forms 我尝试了一切: Scanner(System.in,”UTF-8″) , Scanner(System.in,”UTF8″); 请帮忙 public static void main(String[] args) { Scanner in2 = new Scanner(System.in,”UTF-8″); System.out.printf(” ادخل جملة السؤال \n”); String s = in2.nextLine(); System.out.printf(“”+s+””); // TODO code application logic here } Scanner in2 = new Scanner(System.in,”UTF-8″); System.out.printf(” ادخل جملة السؤال \n”); String s = in2.nextLine(); System.out.printf(“”+s+””); 输出: ادخلجملةالسؤالهذاتلميذ 建立成功(总时间:11秒)

Itext阿拉伯字体作为问号

我是iText图书馆的新手。 我有一个要求,我需要提供PDF格式的输出。 pdf中包含阿拉伯字符。 我创建了一个测试servlet,如下所示。 public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType (“application/pdf;charset=UTF-8”); Document document = new Document(); try{ PdfWriter.getInstance(document, response.getOutputStream()); // Code 2 document.open(); Font f1; BaseFont bf = BaseFont.createFont(“C:\\WINDOWS\\Fonts\\ARIALUNI.ttf”, BaseFont.CP1252, true); f1 = new Font(bf, 10); PdfPTable table = new PdfPTable(2); table.addCell(“hellooooo1”); table.addCell(“world2”); table.addCell(“1113”); table.addCell(“422”); // String a = “يبسبيبيبيسسسيبيببيسبيسيببي”; […]

设置阿拉伯语编号系统区域设置不显示阿拉伯数字

我读了这篇文章: JDK 8和JRE 8支持的语言环境 ,它声明: 编号系统可以由具有编号系统ID的语言标签指定╔═════════════════════╦══════════════════════╦══════════════════╗ ║ Numbering System ID ║ Numbering System ║ Digit Zero Value ║ ╠═════════════════════╬══════════════════════╬══════════════════╣ ║ arab ║ Arabic-Indic Digits ║ \u0660 ║ ╚═════════════════════╩══════════════════════╩══════════════════╝ 现在,为了certificate这一点,我写了以下代码: import java.text.DecimalFormatSymbols; import java.text.NumberFormat; import java.util.Locale; public class Main { public static void main(String[] args) { Locale locale = new Locale(“ar”, “sa”, “arab”); DecimalFormatSymbols dfs = […]

在java中绘制文本与大纲

我正在使用Java中的graphcis2d,目前正在使用它将文本绘制到bufferedImage中 Font font1 = new Font(“Arial”, Font.PLAIN, 120); g2d.setFont(font1); FontMetrics fm1 = g2d.getFontMetrics(font1); g2d.drawString(s[1], width/2-fm1.stringWidth(s[1])/2, height/4-70); 我想用不同的颜色轮廓绘制这个文本。 GlyphVector gv = font1.createGlyphVector(g2d.getFontRenderContext(), s[1]); Shape shape = gv.getOutline(); g2d.setStroke(new BasicStroke(4.0f)); g2d.translate(width/2-fm1.stringWidth(s[1])/2, height/4-70); g2d.draw(shape); 使用这种方法的问题是,我正在使用阿拉伯字符并使用GlyphVector反转顺序,并且不会使字母彼此流动。 有人可以向我解释如何用一种颜色呈现阿拉伯文本并用另一种颜色绘制轮廓吗? 下面是我将要使用的文本示例:الرحمن

如何在使用iText创建的PDF中显示阿拉伯语

我需要您的帮助来显示阿拉伯语内容,并在我尝试创建的PDF示例中从右到左开始编写。 以下是示例代码: public static void main(String[] args) throws IOException { try { BaseFont ArialBase = BaseFont.createFont(“C:\\Users\\dell\\Desktop\\arialbd.ttf”, BaseFont.IDENTITY_H, true); Font ArialFont = new Font(ArialBase, 20); Document document = new Document(PageSize.LETTER); PdfWriter.getInstance(document, new FileOutputStream(“C:\\Users\\dell\\Desktop\\HelloWorld.pdf”)); document.setMargins(72f, 72f, 72f, 0f); document.open(); document.add(new Paragraph(“الموقع الإلكتروني,”,ArialFont)); document.close(); System.out.println(“PDF Completed”); } catch (DocumentException e) { e.printStackTrace(); } catch (FileNotFoundException e) { e.printStackTrace(); […]