Java Code Examples for java.awt.font.TextLayout#getCaretShapes()
The following examples show how to use
java.awt.font.TextLayout#getCaretShapes() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NegativeGlyphIDException.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) { Font font = new Font("Monospaced", Font.PLAIN, 12); String text = "\u0601"; FontRenderContext frc = new FontRenderContext(null, false, false); TextLayout layout = new TextLayout(text, font, frc); BufferedImage bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB); Graphics2D g2d = bi.createGraphics(); layout.draw(g2d, 50.0f, 50.0f); layout.getCaretShapes(0); }
Example 2
Source File: NegativeGlyphIDException.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) { Font font = new Font("Monospaced", Font.PLAIN, 12); String text = "\u0601"; FontRenderContext frc = new FontRenderContext(null, false, false); TextLayout layout = new TextLayout(text, font, frc); BufferedImage bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB); Graphics2D g2d = bi.createGraphics(); layout.draw(g2d, 50.0f, 50.0f); layout.getCaretShapes(0); }
Example 3
Source File: NegativeGlyphIDException.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) { Font font = new Font("Monospaced", Font.PLAIN, 12); String text = "\u0601"; FontRenderContext frc = new FontRenderContext(null, false, false); TextLayout layout = new TextLayout(text, font, frc); BufferedImage bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB); Graphics2D g2d = bi.createGraphics(); layout.draw(g2d, 50.0f, 50.0f); layout.getCaretShapes(0); }
Example 4
Source File: NegativeGlyphIDException.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) { Font font = new Font("Monospaced", Font.PLAIN, 12); String text = "\u0601"; FontRenderContext frc = new FontRenderContext(null, false, false); TextLayout layout = new TextLayout(text, font, frc); BufferedImage bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB); Graphics2D g2d = bi.createGraphics(); layout.draw(g2d, 50.0f, 50.0f); layout.getCaretShapes(0); }
Example 5
Source File: TextBounds.java From ramus with GNU General Public License v3.0 | 5 votes |
private int drawSels(Graphics2D g, int[][] found, int selIndex, int i, TextLayout textLayout, float left, float fromY) { Shape[] start = null; while (selIndex < found.length) { if (in) { if (start == null) start = textLayout.getCaretShapes(0); Shape[] shapes; boolean b = false; if (found[selIndex][0] == i) { shapes = textLayout.getCaretShapes(found[selIndex][1]); selIndex++; in = false; } else { shapes = textLayout.getCaretShapes(texts.get(i).length()); b = true; } Rectangle2D s = start[0].getBounds2D(); Rectangle2D e = shapes[0].getBounds2D(); Rectangle2D r = new Rectangle2D.Double(s.getMinX() + left, s.getMinY() + fromY, e.getMaxX() - s.getMinX(), e.getMaxY() - s.getMinY()); g.draw(r); if (b) break; } else { if (found[selIndex][0] == i) { start = textLayout.getCaretShapes(found[selIndex][1]); selIndex++; in = true; } else break; } } return selIndex; }
Example 6
Source File: MissingCodePointLayoutTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) { Font font = new Font("Tahoma", Font.PLAIN, 12); String text = "\ude00"; FontRenderContext frc = new FontRenderContext(null, false, false); TextLayout layout = new TextLayout(text, font, frc); layout.getCaretShapes(0); }
Example 7
Source File: NegativeGlyphIDException.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) { Font font = new Font("Monospaced", Font.PLAIN, 12); String text = "\u0601"; FontRenderContext frc = new FontRenderContext(null, false, false); TextLayout layout = new TextLayout(text, font, frc); BufferedImage bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB); Graphics2D g2d = bi.createGraphics(); layout.draw(g2d, 50.0f, 50.0f); layout.getCaretShapes(0); }
Example 8
Source File: MissingCodePointLayoutTest.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
public static void main(String[] args) { Font font = new Font("Tahoma", Font.PLAIN, 12); String text = "\ude00"; FontRenderContext frc = new FontRenderContext(null, false, false); TextLayout layout = new TextLayout(text, font, frc); layout.getCaretShapes(0); }