#Problem with Fonts
1 messages · Page 1 of 1 (latest)
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
I got this little code here:
import javax.swing.*;
import java.awt.*;
public class test {
public static void main(String[] args) {
JFrame jf = new JFrame("test");
Container cp = jf.getContentPane();
MyCanvas tl = new MyCanvas();
cp.add(tl);
jf.setSize(1000, 200);
jf.setVisible(true);
}
}
class MyCanvas extends JComponent {
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
Font font = new Font("Serif", Font.PLAIN, 96);
g2.setFont(font);
g2.drawString("ᴳᶠ᭄やℜᎾや⅂么YɆℜッ", 40, 120);
}
}
It should display me ᴳᶠ᭄やℜᎾや⅂么YɆℜッ
but it displays:
I think, that my font doesnt support the characters, but the user input (the text) is not made by me so I need anything that works for - all.
Changed the category to JavaFX|Swing.
<@&987246487241105418> please have a look, thanks.
Use different font
Maybe roboto or noto sans
ok
Closed the thread due to inactivity.
If your question was not resolved yet, feel free to just post a message to reopen it, or create a new thread. But try to improve the quality of your question to make it easier to help you 👍