public FSFontMetrics getFSFontMetrics(CssContext c) { if (_FSFontMetrics == null) { _FSFontMetrics = c.getFSFontMetrics(getFSFont(c)); } return _FSFontMetrics; }
public FSFontMetrics getFSFontMetrics(CssContext c) { if (_FSFontMetrics == null) { _FSFontMetrics = c.getFSFontMetrics(getFSFont(c)); } return _FSFontMetrics; }
public Font getFont() { FSFont font = getStyle().getFSFont(getContext()); if (font instanceof AWTFSFont) { return ((AWTFSFont) font).getAWTFont(); } return null; }
public TextFormField(LayoutContext c, BlockBox box, int cssWidth, int cssHeight) { initDimensions(c, box, cssWidth, cssHeight); float fontSize = box.getStyle().getFSFont(c).getSize2D(); _baseline = (int)(getHeight() / 2 + (fontSize * 0.3f)); }
public int getSpaceWidth(LayoutContext c) { return c.getTextRenderer().getWidth( c.getFontContext(), getStyle().getFSFont(c), WhitespaceStripper.SPACE); }
public TextFormField(LayoutContext c, BlockBox box, int cssWidth, int cssHeight) { initDimensions(c, box, cssWidth, cssHeight); float fontSize = box.getStyle().getFSFont(c).getSize2D(); // FIXME: findbugs possible loss of precision, cf. int / (float)2 _baseline = (int) (getHeight() / 2 + (fontSize * 0.3f)); }
public int getSpaceWidth(LayoutContext c) { return c.getTextRenderer().getWidth( c.getFontContext(), getStyle().getFSFont(c), WhitespaceStripper.SPACE); }
public TextFormField(LayoutContext c, BlockBox box, int cssWidth, int cssHeight) { initDimensions(c, box, cssWidth, cssHeight); float fontSize = box.getStyle().getFSFont(c).getSize2D(); // FIXME: findbugs possible loss of precision, cf. int / (float)2 _baseline = (int) (getHeight() / 2 + (fontSize * 0.3f)); }
public TextFormField(LayoutContext c, BlockBox box, int cssWidth, int cssHeight) { initDimensions(c, box, cssWidth, cssHeight); float fontSize = box.getStyle().getFSFont(c).getSize2D(); // FIXME: findbugs possible loss of precision, cf. int / (float)2 _baseline = (int) (getHeight() / 2 + (fontSize * 0.3f)); }
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); } }
public void updateDynamicValue(RenderingContext c) { String value = _functionData.getContentFunction().calculate( c, _functionData.getFunction(), this); _start = 0; _end = value.length(); _masterText = value; _width = c.getTextRenderer().getWidth( c.getFontContext(), getParent().getStyle().getFSFont(c), value); }
public SelectFormField(LayoutContext c, BlockBox box, int cssWidth, int cssHeight) { _options = readOptions(box.getElement()); initDimensions(c, box, cssWidth, cssHeight); float fontSize = box.getStyle().getFSFont(c).getSize2D(); // FIXME: findbugs possible loss of precision, cf. int / (float)2 _baseline = (int)(getHeight() / 2 + (fontSize * 0.3f)); }
public SelectFormField(LayoutContext c, BlockBox box, int cssWidth, int cssHeight) { _options = readOptions(box.getElement()); initDimensions(c, box, cssWidth, cssHeight); float fontSize = box.getStyle().getFSFont(c).getSize2D(); // FIXME: findbugs possible loss of precision, cf. int / (float)2 _baseline = (int)(getHeight() / 2 + (fontSize * 0.3f)); }
public SelectFormField(LayoutContext c, BlockBox box, int cssWidth, int cssHeight) { _options = readOptions(box.getElement()); initDimensions(c, box, cssWidth, cssHeight); float fontSize = box.getStyle().getFSFont(c).getSize2D(); _baseline = (int)(getHeight() / 2 + (fontSize * 0.3f)); }
public SelectFormField(LayoutContext c, BlockBox box, int cssWidth, int cssHeight) { _options = readOptions(box.getElement()); initDimensions(c, box, cssWidth, cssHeight); float fontSize = box.getStyle().getFSFont(c).getSize2D(); // FIXME: findbugs possible loss of precision, cf. int / (float)2 _baseline = (int)(getHeight() / 2 + (fontSize * 0.3f)); }
public void trimTrailingSpace(LayoutContext c) { if (! isEmpty() && _masterText.charAt(_end-1) == ' ') { _end--; setWidth(c.getTextRenderer().getWidth(c.getFontContext(), getParent().getStyle().getFSFont(c), getSubstring())); setTrimmedTrailingSpace(true); } }
public void trimTrailingSpace(LayoutContext c) { if (! isEmpty() && _masterText.charAt(_end-1) == ' ') { _end--; setWidth(c.getTextRenderer().getWidth(c.getFontContext(), getParent().getStyle().getFSFont(c), getSubstring())); setTrimmedTrailingSpace(true); } }
public static void breakFirstLetter(LayoutContext c, LineBreakContext context, int avail, CalculatedStyle style) { FSFont font = style.getFSFont(c); context.setEnd(getFirstLetterEnd(context.getMaster(), context.getStart())); context.setWidth(c.getTextRenderer().getWidth( c.getFontContext(), font, context.getCalculatedSubstring())); if (context.getWidth() > avail) { context.setNeedsNewLine(true); context.setUnbreakable(true); } }
private static void drawText(RenderingContext c, BlockBox box, IdentValue listStyle) { MarkerData.TextMarker text = box.getMarkerData().getTextMarker(); int x = getReferenceX(c, box); x += -text.getLayoutWidth(); int y = getReferenceBaseline(c, box); c.getOutputDevice().setColor(box.getStyle().getColor()); c.getOutputDevice().setFont(box.getStyle().getFSFont(c)); c.getTextRenderer().drawString( c.getOutputDevice(), text.getText(), x, y); } }
private static void drawText(RenderingContext c, BlockBox box, IdentValue listStyle) { MarkerData.TextMarker text = box.getMarkerData().getTextMarker(); int x = getReferenceX(c, box); x += -text.getLayoutWidth(); int y = getReferenceBaseline(c, box); c.getOutputDevice().setColor(box.getStyle().getColor()); c.getOutputDevice().setFont(box.getStyle().getFSFont(c)); c.getTextRenderer().drawString( c.getOutputDevice(), text.getText(), x, y); } }