Lines Matching refs:Font
29 import java.awt.Font;
32 import java.awt.font.FontRenderContext;
33 import java.awt.font.GlyphVector;
40 * Render the text by breaking it into various scripts and using the right font for each script.
50 private final Font font;
52 private ScriptRun(int start, int limit, @NonNull Font font) {
55 this.font = font;
128 // We break the text into scripts and then select font based on it and then render each of
131 int flag = Font.LAYOUT_NO_LIMIT_CONTEXT | Font.LAYOUT_NO_START_CONTEXT;
132 flag |= isRtl ? Font.LAYOUT_RIGHT_TO_LEFT : Font.LAYOUT_LEFT_TO_RIGHT;
133 renderScript(run.start, run.limit, run.font, flag, advances, advancesIndex, draw);
140 * Render a script run to the right of the bounds passed. Use the preferred font to render as
142 * be drawn using the preferred font.
144 private void renderScript(int start, int limit, Font preferredFont, int flag,
165 // The current character cannot be drawn with the preferred font. Cycle through all the
171 Font font = fontInfos.get(i).mFont;
172 if (font == null) {
176 canDisplayUpTo = font.canDisplayUpTo(mText, start, start + charCount);
178 render(start, start+charCount, font, flag, advances, advancesIndex, draw);
186 // No font can display this char. Use the preferred font. The char will most
205 * Renders the text to the right of the bounds with the given font.
206 * @param font The font to render the text with.
208 private void render(int start, int limit, Font font, int flag, float[] advances,
215 frc = Toolkit.getDefaultToolkit().getFontMetrics(font).getFontRenderContext();
219 AffineTransform transform = font.getTransform();
227 GlyphVector gv = font.layoutGlyphVector(frc, mText, start, limit, flag);
284 // TODO: Replace this method with one which returns the font based on the scriptCode.
286 private static Font getScriptFont(char[] text, int start, int limit, List<FontInfo> fonts) {