sun.font.TextLabelFactory Java Examples
The following examples show how to use
sun.font.TextLabelFactory.
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: TextLine.java From jdk-1.7-annotated with Apache License 2.0 | 6 votes |
/** * Create a TextLine from the text. chars is just the text in the iterator. */ public static TextLine standardCreateTextLine(FontRenderContext frc, AttributedCharacterIterator text, char[] chars, float[] baselineOffsets) { StyledParagraph styledParagraph = new StyledParagraph(text, chars); Bidi bidi = new Bidi(text); if (bidi.isLeftToRight()) { bidi = null; } int layoutFlags = 0; // no extra info yet, bidi determines run and line direction TextLabelFactory factory = new TextLabelFactory(frc, chars, bidi, layoutFlags); boolean isDirectionLTR = true; if (bidi != null) { isDirectionLTR = bidi.baseIsLeftToRight(); } return createLineFromText(chars, styledParagraph, factory, isDirectionLTR, baselineOffsets); }
Example #2
Source File: TextLine.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the text. chars is just the text in the iterator. */ public static TextLine standardCreateTextLine(FontRenderContext frc, AttributedCharacterIterator text, char[] chars, float[] baselineOffsets) { StyledParagraph styledParagraph = new StyledParagraph(text, chars); Bidi bidi = new Bidi(text); if (bidi.isLeftToRight()) { bidi = null; } int layoutFlags = 0; // no extra info yet, bidi determines run and line direction TextLabelFactory factory = new TextLabelFactory(frc, chars, bidi, layoutFlags); boolean isDirectionLTR = true; if (bidi != null) { isDirectionLTR = bidi.baseIsLeftToRight(); } return createLineFromText(chars, styledParagraph, factory, isDirectionLTR, baselineOffsets); }
Example #3
Source File: TextLine.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the Font and character data over the * range. The range is relative to both the StyledParagraph and the * character array. */ public static TextLine createLineFromText(char[] chars, StyledParagraph styledParagraph, TextLabelFactory factory, boolean isDirectionLTR, float[] baselineOffsets) { factory.setLineContext(0, chars.length); Bidi lineBidi = factory.getLineBidi(); int[] charsLtoV = null; byte[] levels = null; if (lineBidi != null) { levels = BidiUtils.getLevels(lineBidi); int[] charsVtoL = BidiUtils.createVisualToLogicalMap(levels); charsLtoV = BidiUtils.createInverseMap(charsVtoL); } TextLineComponent[] components = getComponents(styledParagraph, chars, 0, chars.length, charsLtoV, levels, factory); return new TextLine(factory.getFontRenderContext(), components, baselineOffsets, chars, 0, chars.length, charsLtoV, levels, isDirectionLTR); }
Example #4
Source File: TextLine.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the Font and character data over the * range. The range is relative to both the StyledParagraph and the * character array. */ public static TextLine createLineFromText(char[] chars, StyledParagraph styledParagraph, TextLabelFactory factory, boolean isDirectionLTR, float[] baselineOffsets) { factory.setLineContext(0, chars.length); Bidi lineBidi = factory.getLineBidi(); int[] charsLtoV = null; byte[] levels = null; if (lineBidi != null) { levels = BidiUtils.getLevels(lineBidi); int[] charsVtoL = BidiUtils.createVisualToLogicalMap(levels); charsLtoV = BidiUtils.createInverseMap(charsVtoL); } TextLineComponent[] components = getComponents(styledParagraph, chars, 0, chars.length, charsLtoV, levels, factory); return new TextLine(factory.getFontRenderContext(), components, baselineOffsets, chars, 0, chars.length, charsLtoV, levels, isDirectionLTR); }
Example #5
Source File: TextLine.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the text. chars is just the text in the iterator. */ public static TextLine standardCreateTextLine(FontRenderContext frc, AttributedCharacterIterator text, char[] chars, float[] baselineOffsets) { StyledParagraph styledParagraph = new StyledParagraph(text, chars); Bidi bidi = new Bidi(text); if (bidi.isLeftToRight()) { bidi = null; } int layoutFlags = 0; // no extra info yet, bidi determines run and line direction TextLabelFactory factory = new TextLabelFactory(frc, chars, bidi, layoutFlags); boolean isDirectionLTR = true; if (bidi != null) { isDirectionLTR = bidi.baseIsLeftToRight(); } return createLineFromText(chars, styledParagraph, factory, isDirectionLTR, baselineOffsets); }
Example #6
Source File: TextLine.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the Font and character data over the * range. The range is relative to both the StyledParagraph and the * character array. */ public static TextLine createLineFromText(char[] chars, StyledParagraph styledParagraph, TextLabelFactory factory, boolean isDirectionLTR, float[] baselineOffsets) { factory.setLineContext(0, chars.length); Bidi lineBidi = factory.getLineBidi(); int[] charsLtoV = null; byte[] levels = null; if (lineBidi != null) { levels = BidiUtils.getLevels(lineBidi); int[] charsVtoL = BidiUtils.createVisualToLogicalMap(levels); charsLtoV = BidiUtils.createInverseMap(charsVtoL); } TextLineComponent[] components = getComponents(styledParagraph, chars, 0, chars.length, charsLtoV, levels, factory); return new TextLine(factory.getFontRenderContext(), components, baselineOffsets, chars, 0, chars.length, charsLtoV, levels, isDirectionLTR); }
Example #7
Source File: TextLine.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the Font and character data over the * range. The range is relative to both the StyledParagraph and the * character array. */ public static TextLine createLineFromText(char[] chars, StyledParagraph styledParagraph, TextLabelFactory factory, boolean isDirectionLTR, float[] baselineOffsets) { factory.setLineContext(0, chars.length); Bidi lineBidi = factory.getLineBidi(); int[] charsLtoV = null; byte[] levels = null; if (lineBidi != null) { levels = BidiUtils.getLevels(lineBidi); int[] charsVtoL = BidiUtils.createVisualToLogicalMap(levels); charsLtoV = BidiUtils.createInverseMap(charsVtoL); } TextLineComponent[] components = getComponents(styledParagraph, chars, 0, chars.length, charsLtoV, levels, factory); return new TextLine(factory.getFontRenderContext(), components, baselineOffsets, chars, 0, chars.length, charsLtoV, levels, isDirectionLTR); }
Example #8
Source File: TextLine.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the text. chars is just the text in the iterator. */ public static TextLine standardCreateTextLine(FontRenderContext frc, AttributedCharacterIterator text, char[] chars, float[] baselineOffsets) { StyledParagraph styledParagraph = new StyledParagraph(text, chars); Bidi bidi = new Bidi(text); if (bidi.isLeftToRight()) { bidi = null; } int layoutFlags = 0; // no extra info yet, bidi determines run and line direction TextLabelFactory factory = new TextLabelFactory(frc, chars, bidi, layoutFlags); boolean isDirectionLTR = true; if (bidi != null) { isDirectionLTR = bidi.baseIsLeftToRight(); } return createLineFromText(chars, styledParagraph, factory, isDirectionLTR, baselineOffsets); }
Example #9
Source File: TextLine.java From jdk1.8-source-analysis with Apache License 2.0 | 6 votes |
/** * Create a TextLine from the text. chars is just the text in the iterator. */ public static TextLine standardCreateTextLine(FontRenderContext frc, AttributedCharacterIterator text, char[] chars, float[] baselineOffsets) { StyledParagraph styledParagraph = new StyledParagraph(text, chars); Bidi bidi = new Bidi(text); if (bidi.isLeftToRight()) { bidi = null; } int layoutFlags = 0; // no extra info yet, bidi determines run and line direction TextLabelFactory factory = new TextLabelFactory(frc, chars, bidi, layoutFlags); boolean isDirectionLTR = true; if (bidi != null) { isDirectionLTR = bidi.baseIsLeftToRight(); } return createLineFromText(chars, styledParagraph, factory, isDirectionLTR, baselineOffsets); }
Example #10
Source File: TextLine.java From jdk1.8-source-analysis with Apache License 2.0 | 6 votes |
/** * Create a TextLine from the Font and character data over the * range. The range is relative to both the StyledParagraph and the * character array. */ public static TextLine createLineFromText(char[] chars, StyledParagraph styledParagraph, TextLabelFactory factory, boolean isDirectionLTR, float[] baselineOffsets) { factory.setLineContext(0, chars.length); Bidi lineBidi = factory.getLineBidi(); int[] charsLtoV = null; byte[] levels = null; if (lineBidi != null) { levels = BidiUtils.getLevels(lineBidi); int[] charsVtoL = BidiUtils.createVisualToLogicalMap(levels); charsLtoV = BidiUtils.createInverseMap(charsVtoL); } TextLineComponent[] components = getComponents(styledParagraph, chars, 0, chars.length, charsLtoV, levels, factory); return new TextLine(factory.getFontRenderContext(), components, baselineOffsets, chars, 0, chars.length, charsLtoV, levels, isDirectionLTR); }
Example #11
Source File: TextLine.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the Font and character data over the * range. The range is relative to both the StyledParagraph and the * character array. */ public static TextLine createLineFromText(char[] chars, StyledParagraph styledParagraph, TextLabelFactory factory, boolean isDirectionLTR, float[] baselineOffsets) { factory.setLineContext(0, chars.length); Bidi lineBidi = factory.getLineBidi(); int[] charsLtoV = null; byte[] levels = null; if (lineBidi != null) { levels = BidiUtils.getLevels(lineBidi); int[] charsVtoL = BidiUtils.createVisualToLogicalMap(levels); charsLtoV = BidiUtils.createInverseMap(charsVtoL); } TextLineComponent[] components = getComponents(styledParagraph, chars, 0, chars.length, charsLtoV, levels, factory); return new TextLine(factory.getFontRenderContext(), components, baselineOffsets, chars, 0, chars.length, charsLtoV, levels, isDirectionLTR); }
Example #12
Source File: TextLine.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the text. chars is just the text in the iterator. */ public static TextLine standardCreateTextLine(FontRenderContext frc, AttributedCharacterIterator text, char[] chars, float[] baselineOffsets) { StyledParagraph styledParagraph = new StyledParagraph(text, chars); Bidi bidi = new Bidi(text); if (bidi.isLeftToRight()) { bidi = null; } int layoutFlags = 0; // no extra info yet, bidi determines run and line direction TextLabelFactory factory = new TextLabelFactory(frc, chars, bidi, layoutFlags); boolean isDirectionLTR = true; if (bidi != null) { isDirectionLTR = bidi.baseIsLeftToRight(); } return createLineFromText(chars, styledParagraph, factory, isDirectionLTR, baselineOffsets); }
Example #13
Source File: TextLine.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the text. chars is just the text in the iterator. */ public static TextLine standardCreateTextLine(FontRenderContext frc, AttributedCharacterIterator text, char[] chars, float[] baselineOffsets) { StyledParagraph styledParagraph = new StyledParagraph(text, chars); Bidi bidi = new Bidi(text); if (bidi.isLeftToRight()) { bidi = null; } int layoutFlags = 0; // no extra info yet, bidi determines run and line direction TextLabelFactory factory = new TextLabelFactory(frc, chars, bidi, layoutFlags); boolean isDirectionLTR = true; if (bidi != null) { isDirectionLTR = bidi.baseIsLeftToRight(); } return createLineFromText(chars, styledParagraph, factory, isDirectionLTR, baselineOffsets); }
Example #14
Source File: TextLine.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the Font and character data over the * range. The range is relative to both the StyledParagraph and the * character array. */ public static TextLine createLineFromText(char[] chars, StyledParagraph styledParagraph, TextLabelFactory factory, boolean isDirectionLTR, float[] baselineOffsets) { factory.setLineContext(0, chars.length); Bidi lineBidi = factory.getLineBidi(); int[] charsLtoV = null; byte[] levels = null; if (lineBidi != null) { levels = BidiUtils.getLevels(lineBidi); int[] charsVtoL = BidiUtils.createVisualToLogicalMap(levels); charsLtoV = BidiUtils.createInverseMap(charsVtoL); } TextLineComponent[] components = getComponents(styledParagraph, chars, 0, chars.length, charsLtoV, levels, factory); return new TextLine(factory.getFontRenderContext(), components, baselineOffsets, chars, 0, chars.length, charsLtoV, levels, isDirectionLTR); }
Example #15
Source File: TextLine.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the text. chars is just the text in the iterator. */ public static TextLine standardCreateTextLine(FontRenderContext frc, AttributedCharacterIterator text, char[] chars, float[] baselineOffsets) { StyledParagraph styledParagraph = new StyledParagraph(text, chars); Bidi bidi = new Bidi(text); if (bidi.isLeftToRight()) { bidi = null; } int layoutFlags = 0; // no extra info yet, bidi determines run and line direction TextLabelFactory factory = new TextLabelFactory(frc, chars, bidi, layoutFlags); boolean isDirectionLTR = true; if (bidi != null) { isDirectionLTR = bidi.baseIsLeftToRight(); } return createLineFromText(chars, styledParagraph, factory, isDirectionLTR, baselineOffsets); }
Example #16
Source File: TextLine.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the Font and character data over the * range. The range is relative to both the StyledParagraph and the * character array. */ public static TextLine createLineFromText(char[] chars, StyledParagraph styledParagraph, TextLabelFactory factory, boolean isDirectionLTR, float[] baselineOffsets) { factory.setLineContext(0, chars.length); Bidi lineBidi = factory.getLineBidi(); int[] charsLtoV = null; byte[] levels = null; if (lineBidi != null) { levels = BidiUtils.getLevels(lineBidi); int[] charsVtoL = BidiUtils.createVisualToLogicalMap(levels); charsLtoV = BidiUtils.createInverseMap(charsVtoL); } TextLineComponent[] components = getComponents(styledParagraph, chars, 0, chars.length, charsLtoV, levels, factory); return new TextLine(factory.getFontRenderContext(), components, baselineOffsets, chars, 0, chars.length, charsLtoV, levels, isDirectionLTR); }
Example #17
Source File: TextLine.java From JDKSourceCode1.8 with MIT License | 6 votes |
/** * Create a TextLine from the Font and character data over the * range. The range is relative to both the StyledParagraph and the * character array. */ public static TextLine createLineFromText(char[] chars, StyledParagraph styledParagraph, TextLabelFactory factory, boolean isDirectionLTR, float[] baselineOffsets) { factory.setLineContext(0, chars.length); Bidi lineBidi = factory.getLineBidi(); int[] charsLtoV = null; byte[] levels = null; if (lineBidi != null) { levels = BidiUtils.getLevels(lineBidi); int[] charsVtoL = BidiUtils.createVisualToLogicalMap(levels); charsLtoV = BidiUtils.createInverseMap(charsVtoL); } TextLineComponent[] components = getComponents(styledParagraph, chars, 0, chars.length, charsLtoV, levels, factory); return new TextLine(factory.getFontRenderContext(), components, baselineOffsets, chars, 0, chars.length, charsLtoV, levels, isDirectionLTR); }
Example #18
Source File: TextLine.java From JDKSourceCode1.8 with MIT License | 6 votes |
/** * Create a TextLine from the text. chars is just the text in the iterator. */ public static TextLine standardCreateTextLine(FontRenderContext frc, AttributedCharacterIterator text, char[] chars, float[] baselineOffsets) { StyledParagraph styledParagraph = new StyledParagraph(text, chars); Bidi bidi = new Bidi(text); if (bidi.isLeftToRight()) { bidi = null; } int layoutFlags = 0; // no extra info yet, bidi determines run and line direction TextLabelFactory factory = new TextLabelFactory(frc, chars, bidi, layoutFlags); boolean isDirectionLTR = true; if (bidi != null) { isDirectionLTR = bidi.baseIsLeftToRight(); } return createLineFromText(chars, styledParagraph, factory, isDirectionLTR, baselineOffsets); }
Example #19
Source File: TextLine.java From hottub with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the text. chars is just the text in the iterator. */ public static TextLine standardCreateTextLine(FontRenderContext frc, AttributedCharacterIterator text, char[] chars, float[] baselineOffsets) { StyledParagraph styledParagraph = new StyledParagraph(text, chars); Bidi bidi = new Bidi(text); if (bidi.isLeftToRight()) { bidi = null; } int layoutFlags = 0; // no extra info yet, bidi determines run and line direction TextLabelFactory factory = new TextLabelFactory(frc, chars, bidi, layoutFlags); boolean isDirectionLTR = true; if (bidi != null) { isDirectionLTR = bidi.baseIsLeftToRight(); } return createLineFromText(chars, styledParagraph, factory, isDirectionLTR, baselineOffsets); }
Example #20
Source File: TextLine.java From hottub with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the Font and character data over the * range. The range is relative to both the StyledParagraph and the * character array. */ public static TextLine createLineFromText(char[] chars, StyledParagraph styledParagraph, TextLabelFactory factory, boolean isDirectionLTR, float[] baselineOffsets) { factory.setLineContext(0, chars.length); Bidi lineBidi = factory.getLineBidi(); int[] charsLtoV = null; byte[] levels = null; if (lineBidi != null) { levels = BidiUtils.getLevels(lineBidi); int[] charsVtoL = BidiUtils.createVisualToLogicalMap(levels); charsLtoV = BidiUtils.createInverseMap(charsVtoL); } TextLineComponent[] components = getComponents(styledParagraph, chars, 0, chars.length, charsLtoV, levels, factory); return new TextLine(factory.getFontRenderContext(), components, baselineOffsets, chars, 0, chars.length, charsLtoV, levels, isDirectionLTR); }
Example #21
Source File: TextLine.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the Font and character data over the * range. The range is relative to both the StyledParagraph and the * character array. */ public static TextLine createLineFromText(char[] chars, StyledParagraph styledParagraph, TextLabelFactory factory, boolean isDirectionLTR, float[] baselineOffsets) { factory.setLineContext(0, chars.length); Bidi lineBidi = factory.getLineBidi(); int[] charsLtoV = null; byte[] levels = null; if (lineBidi != null) { levels = BidiUtils.getLevels(lineBidi); int[] charsVtoL = BidiUtils.createVisualToLogicalMap(levels); charsLtoV = BidiUtils.createInverseMap(charsVtoL); } TextLineComponent[] components = getComponents(styledParagraph, chars, 0, chars.length, charsLtoV, levels, factory); return new TextLine(factory.getFontRenderContext(), components, baselineOffsets, chars, 0, chars.length, charsLtoV, levels, isDirectionLTR); }
Example #22
Source File: TextLine.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the text. chars is just the text in the iterator. */ public static TextLine standardCreateTextLine(FontRenderContext frc, AttributedCharacterIterator text, char[] chars, float[] baselineOffsets) { StyledParagraph styledParagraph = new StyledParagraph(text, chars); Bidi bidi = new Bidi(text); if (bidi.isLeftToRight()) { bidi = null; } int layoutFlags = 0; // no extra info yet, bidi determines run and line direction TextLabelFactory factory = new TextLabelFactory(frc, chars, bidi, layoutFlags); boolean isDirectionLTR = true; if (bidi != null) { isDirectionLTR = bidi.baseIsLeftToRight(); } return createLineFromText(chars, styledParagraph, factory, isDirectionLTR, baselineOffsets); }
Example #23
Source File: TextLine.java From Java8CN with Apache License 2.0 | 6 votes |
/** * Create a TextLine from the Font and character data over the * range. The range is relative to both the StyledParagraph and the * character array. */ public static TextLine createLineFromText(char[] chars, StyledParagraph styledParagraph, TextLabelFactory factory, boolean isDirectionLTR, float[] baselineOffsets) { factory.setLineContext(0, chars.length); Bidi lineBidi = factory.getLineBidi(); int[] charsLtoV = null; byte[] levels = null; if (lineBidi != null) { levels = BidiUtils.getLevels(lineBidi); int[] charsVtoL = BidiUtils.createVisualToLogicalMap(levels); charsLtoV = BidiUtils.createInverseMap(charsVtoL); } TextLineComponent[] components = getComponents(styledParagraph, chars, 0, chars.length, charsLtoV, levels, factory); return new TextLine(factory.getFontRenderContext(), components, baselineOffsets, chars, 0, chars.length, charsLtoV, levels, isDirectionLTR); }
Example #24
Source File: TextLine.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the Font and character data over the * range. The range is relative to both the StyledParagraph and the * character array. */ public static TextLine createLineFromText(char[] chars, StyledParagraph styledParagraph, TextLabelFactory factory, boolean isDirectionLTR, float[] baselineOffsets) { factory.setLineContext(0, chars.length); Bidi lineBidi = factory.getLineBidi(); int[] charsLtoV = null; byte[] levels = null; if (lineBidi != null) { levels = BidiUtils.getLevels(lineBidi); int[] charsVtoL = BidiUtils.createVisualToLogicalMap(levels); charsLtoV = BidiUtils.createInverseMap(charsVtoL); } TextLineComponent[] components = getComponents(styledParagraph, chars, 0, chars.length, charsLtoV, levels, factory); return new TextLine(factory.getFontRenderContext(), components, baselineOffsets, chars, 0, chars.length, charsLtoV, levels, isDirectionLTR); }
Example #25
Source File: TextLine.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the text. chars is just the text in the iterator. */ public static TextLine standardCreateTextLine(FontRenderContext frc, AttributedCharacterIterator text, char[] chars, float[] baselineOffsets) { StyledParagraph styledParagraph = new StyledParagraph(text, chars); Bidi bidi = new Bidi(text); if (bidi.isLeftToRight()) { bidi = null; } int layoutFlags = 0; // no extra info yet, bidi determines run and line direction TextLabelFactory factory = new TextLabelFactory(frc, chars, bidi, layoutFlags); boolean isDirectionLTR = true; if (bidi != null) { isDirectionLTR = bidi.baseIsLeftToRight(); } return createLineFromText(chars, styledParagraph, factory, isDirectionLTR, baselineOffsets); }
Example #26
Source File: TextLine.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the Font and character data over the * range. The range is relative to both the StyledParagraph and the * character array. */ public static TextLine createLineFromText(char[] chars, StyledParagraph styledParagraph, TextLabelFactory factory, boolean isDirectionLTR, float[] baselineOffsets) { factory.setLineContext(0, chars.length); Bidi lineBidi = factory.getLineBidi(); int[] charsLtoV = null; byte[] levels = null; if (lineBidi != null) { levels = BidiUtils.getLevels(lineBidi); int[] charsVtoL = BidiUtils.createVisualToLogicalMap(levels); charsLtoV = BidiUtils.createInverseMap(charsVtoL); } TextLineComponent[] components = getComponents(styledParagraph, chars, 0, chars.length, charsLtoV, levels, factory); return new TextLine(factory.getFontRenderContext(), components, baselineOffsets, chars, 0, chars.length, charsLtoV, levels, isDirectionLTR); }
Example #27
Source File: TextLine.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the text. chars is just the text in the iterator. */ public static TextLine standardCreateTextLine(FontRenderContext frc, AttributedCharacterIterator text, char[] chars, float[] baselineOffsets) { StyledParagraph styledParagraph = new StyledParagraph(text, chars); Bidi bidi = new Bidi(text); if (bidi.isLeftToRight()) { bidi = null; } int layoutFlags = 0; // no extra info yet, bidi determines run and line direction TextLabelFactory factory = new TextLabelFactory(frc, chars, bidi, layoutFlags); boolean isDirectionLTR = true; if (bidi != null) { isDirectionLTR = bidi.baseIsLeftToRight(); } return createLineFromText(chars, styledParagraph, factory, isDirectionLTR, baselineOffsets); }
Example #28
Source File: TextLine.java From Bytecoder with Apache License 2.0 | 6 votes |
/** * Create a TextLine from the Font and character data over the * range. The range is relative to both the StyledParagraph and the * character array. */ public static TextLine createLineFromText(char[] chars, StyledParagraph styledParagraph, TextLabelFactory factory, boolean isDirectionLTR, float[] baselineOffsets) { factory.setLineContext(0, chars.length); Bidi lineBidi = factory.getLineBidi(); int[] charsLtoV = null; byte[] levels = null; if (lineBidi != null) { levels = BidiUtils.getLevels(lineBidi); int[] charsVtoL = BidiUtils.createVisualToLogicalMap(levels); charsLtoV = BidiUtils.createInverseMap(charsVtoL); } TextLineComponent[] components = getComponents(styledParagraph, chars, 0, chars.length, charsLtoV, levels, factory); return new TextLine(factory.getFontRenderContext(), components, baselineOffsets, chars, 0, chars.length, charsLtoV, levels, isDirectionLTR); }
Example #29
Source File: TextLine.java From Bytecoder with Apache License 2.0 | 6 votes |
/** * Create a TextLine from the text. chars is just the text in the iterator. */ public static TextLine standardCreateTextLine(FontRenderContext frc, AttributedCharacterIterator text, char[] chars, float[] baselineOffsets) { StyledParagraph styledParagraph = new StyledParagraph(text, chars); Bidi bidi = new Bidi(text); if (bidi.isLeftToRight()) { bidi = null; } int layoutFlags = 0; // no extra info yet, bidi determines run and line direction TextLabelFactory factory = new TextLabelFactory(frc, chars, bidi, layoutFlags); boolean isDirectionLTR = true; if (bidi != null) { isDirectionLTR = bidi.baseIsLeftToRight(); } return createLineFromText(chars, styledParagraph, factory, isDirectionLTR, baselineOffsets); }
Example #30
Source File: TextLine.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * Create a TextLine from the Font and character data over the * range. The range is relative to both the StyledParagraph and the * character array. */ public static TextLine createLineFromText(char[] chars, StyledParagraph styledParagraph, TextLabelFactory factory, boolean isDirectionLTR, float[] baselineOffsets) { factory.setLineContext(0, chars.length); Bidi lineBidi = factory.getLineBidi(); int[] charsLtoV = null; byte[] levels = null; if (lineBidi != null) { levels = BidiUtils.getLevels(lineBidi); int[] charsVtoL = BidiUtils.createVisualToLogicalMap(levels); charsLtoV = BidiUtils.createInverseMap(charsVtoL); } TextLineComponent[] components = getComponents(styledParagraph, chars, 0, chars.length, charsLtoV, levels, factory); return new TextLine(factory.getFontRenderContext(), components, baselineOffsets, chars, 0, chars.length, charsLtoV, levels, isDirectionLTR); }