我在Java graphcis2d工作,我目前使用該繪製文本轉換成一個BufferedImage與外形圖文字在Java中
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的反轉順序,不會使字母彼此流動。
有人可以請我解釋一下如何渲染一種顏色的阿拉伯文字,並與另一種顏色的輪廓?
下面有文本的樣品,我將使用: الرحمن
我看到在邊境黑點。 – Sorter
@Sorter - 很抱歉聽到。沒有任何關於你正在做什麼或者你看到什麼的細節,我無法猜測爲什麼。就像我說的那樣,這種方法「不完美」。 –