首页 > 编程知识 正文

graphpad怎么改字体,drawrectangle四个参数

时间:2023-05-04 13:03:56 阅读:24159 作者:4496

因为想在工作、摆动对象(JLabel的、等)、表情文字中显示,所以为了实现这一点,使用this library和以下类,只显示Graphics2D中没有drawString颜色的字体

Jabel.seticon(newemojiicon ) ) :poop: );

除表情符号外,还有所有支持这些颜色的字体: EmojiOne和Noto Color Emoji

什么是单色的表情符号点作业?

publicclassemojiiconimplementsicon {

私密字体;

privatefinalstaticintdefault _ size=32;

私有int width=default _ size;

private int height=DEFAULT_SIZE;

私有字符串e moji;

publicemojiicon (字符串控制)。

this.e moji=emojiparser.parsetounicode (icon string );

设置字体(Emojione-Android );

recalculateiconwidth(emoji;

}

公共语音集字体(字符串字体)。

try {

font=font.create font (font.truetype _ font,newfile('fonts/'strfont'.TTF ' ) ).derive font (48f );

}catch(fontformatexceptione ) )

e .打印堆栈跟踪(;

}catch(ioexceptione ) {

e .打印堆栈跟踪(;

}

}

私有语音呼叫连接width (字符串控制) {

fontrendercontextfrc=newfontrendercontext (null,true,true );

rectangle 2d bounds=font.getstring bounds (icon string,frc );

width=(int ) bounds.getWidth );

height=(int ) bounds.getHeight );

}

@Override

publicvoidpainticon (组件c、图形g、int x、int y ) {

Graphics2dG2D=(Graphics2d ) g;

g2d.set font (字体);

g2d.setrenderinghint (rendering hints.key _ text _ antialiasing,rendering hints.value _ text _ antialias _ on );

g2d.setrenderinghint (rendering hints.key _ antialiasing,rendering hints.value _ antialias _ on );

G2D.Drawstring(Emoji,0,height );

}

}

我一直在网上找假羊。 我们发现here不会成为standarised (至少. TTF字体),因为它的合法字体也有颜色。 有解决这个问题的方法吗? 我真的很喜欢用电子字体

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。