public int getSpaceWidth(LayoutContext c) { return c.getTextRenderer().getWidth( c.getFontContext(), getStyle().getFSFont(c), WhitespaceStripper.SPACE); }
private LayoutContext newLayoutContext() { LayoutContext result = _sharedContext.newLayoutContextInstance(); result.setFontContext(new ITextFontContext()); _sharedContext.getTextRenderer().setup(result.getFontContext()); return result; }
public void actionPerformed(ActionEvent evt) { panel.getSharedContext().getTextRenderer().setSmoothingThreshold(fontSizeThreshold); panel.repaint(); } }
/** * Applies a change in scale for fonts using the rendering context's text * renderer. */ private void scaleFont(float scaleBy) { TextRenderer tr = getSharedContext().getTextRenderer(); float fs = tr.getFontScale() * scaleBy; if (fs < _minFontScale || fs > _maxFontScale) { return; } tr.setFontScale(fs); reload(); }
private void ensureGlyphPositions(RenderingContext c) { if (_glyphPositions == null) { FSGlyphVector glyphVector = c.getTextRenderer().getGlyphVector( c.getOutputDevice(), getParent().getStyle().getFSFont(c), getSubstring()); _glyphPositions = c.getTextRenderer().getGlyphPositions( c.getOutputDevice(), getParent().getStyle().getFSFont(c), glyphVector); } }
if (text != null && text.length() > 0) { FSFont font = iB.getStyle().getFSFont(c); FSGlyphVector glyphVector = c.getTextRenderer().getGlyphVector( c.getOutputDevice(), font, inlineText.getSubstring()); Rectangle start = c.getTextRenderer().getGlyphBounds( c.getOutputDevice(), font, iB.getAbsY() + iB.getBaseline()); Rectangle end = c.getTextRenderer().getGlyphBounds( c.getOutputDevice(), font,
/** * Gets the fontInstanceHashName attribute of the FontResolverTest object * * @param ctx *@param name PARAM * @param size PARAM * @param weight PARAM * @param style PARAM * @param variant PARAM @return The fontInstanceHashName value */ protected static String getFontInstanceHashName(SharedContext ctx, String name, float size, IdentValue weight, IdentValue style, IdentValue variant) { return name + "-" + (size * ctx.getTextRenderer().getFontScale()) + "-" + weight + "-" + style + "-" + variant; }
public FSFontMetrics getFSFontMetrics(FSFont font) { return getTextRenderer().getFSFontMetrics(getFontContext(), font, ""); }
JustificationInfo info = inlineText.getParent().getLineBox().getJustificationInfo(); if (info != null) { c.getTextRenderer().drawString( c.getOutputDevice(), text, info); } else { c.getTextRenderer().drawString( c.getOutputDevice(), text, c.getTextRenderer().drawString( c.getOutputDevice(), text,
c.getTextRenderer().drawGlyphVector( c.getOutputDevice(), glyphVector,
/** * Applies a change in scale for fonts using the rendering context's text * renderer. */ private void scaleFont(float scaleBy) { SharedContext rc = getSharedContext(); float fs = rc.getTextRenderer().getFontScale() * scaleBy; if (fs < minFontScale || fs > maxFontScale) return; rc.getTextRenderer().setFontScale(fs); setDocument(getDocument()); }
private void ensureGlyphPositions(RenderingContext c) { if (_glyphPositions == null) { FSGlyphVector glyphVector = c.getTextRenderer().getGlyphVector( c.getOutputDevice(), getParent().getStyle().getFSFont(c), getSubstring()); _glyphPositions = c.getTextRenderer().getGlyphPositions( c.getOutputDevice(), getParent().getStyle().getFSFont(c), glyphVector); } }
if (text != null && text.length() > 0) { FSFont font = iB.getStyle().getFSFont(c); FSGlyphVector glyphVector = c.getTextRenderer().getGlyphVector( c.getOutputDevice(), font, inlineText.getSubstring()); Rectangle start = c.getTextRenderer().getGlyphBounds( c.getOutputDevice(), font, iB.getAbsY() + iB.getBaseline()); Rectangle end = c.getTextRenderer().getGlyphBounds( c.getOutputDevice(), font,
/** * Gets the fontInstanceHashName attribute of the FontResolverTest object * * @param ctx *@param name PARAM * @param size PARAM * @param weight PARAM * @param style PARAM * @param variant PARAM @return The fontInstanceHashName value */ protected static String getFontInstanceHashName(SharedContext ctx, String name, float size, IdentValue weight, IdentValue style, IdentValue variant) { return name + "-" + (size * ctx.getTextRenderer().getFontScale()) + "-" + weight + "-" + style + "-" + variant; }
public FSFontMetrics getFSFontMetrics(FSFont font) { return getTextRenderer().getFSFontMetrics(getFontContext(), font, ""); }
JustificationInfo info = inlineText.getParent().getLineBox().getJustificationInfo(); if (info != null) { c.getTextRenderer().drawString( c.getOutputDevice(), text, info); } else { c.getTextRenderer().drawString( c.getOutputDevice(), text, c.getTextRenderer().drawString( c.getOutputDevice(), text,
c.getTextRenderer().drawGlyphVector( c.getOutputDevice(), glyphVector,
public int getSpaceWidth(LayoutContext c) { return c.getTextRenderer().getWidth( c.getFontContext(), getStyle().getFSFont(c), WhitespaceStripper.SPACE); }
private LayoutContext newLayoutContext() { LayoutContext result = _sharedContext.newLayoutContextInstance(); result.setFontContext(new ITextFontContext()); _sharedContext.getTextRenderer().setup(result.getFontContext()); return result; }
public void actionPerformed(ActionEvent evt) { panel.getSharedContext().getTextRenderer().setSmoothingThreshold(fontSizeThreshold); panel.repaint(); } }