public int getSpaceWidth(LayoutContext c) { return c.getTextRenderer().getWidth( c.getFontContext(), getStyle().getFSFont(c), WhitespaceStripper.SPACE); }
public int getSpaceWidth(LayoutContext c) { return c.getTextRenderer().getWidth( c.getFontContext(), getStyle().getFSFont(c), WhitespaceStripper.SPACE); }
private int getTextWidth(LayoutContext c, CalculatedStyle cs, String s) { return c.getTextRenderer().getWidth(c.getFontContext(), c.getFont(cs.getFont(c)), s); }
private int getTextWidth(LayoutContext c, CalculatedStyle cs, String s) { return c.getTextRenderer().getWidth(c.getFontContext(), c.getFont(cs.getFont(c)), s); }
private int getTextWidth(LayoutContext c, String s) { return c.getTextRenderer().getWidth( c.getFontContext(), c.getFont(getStyle().getFont(c)), s); }
private int getTextWidth(LayoutContext c, String s) { return c.getTextRenderer().getWidth( c.getFontContext(), c.getFont(getStyle().getFont(c)), s); }
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 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 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); } }
private MarkerData.TextMarker makeTextMarker(LayoutContext c, IdentValue listStyle) { String text; int listCounter = getListCounter(); text = CounterFunction.createCounterText(listStyle, listCounter); text += ". "; int w = c.getTextRenderer().getWidth( c.getFontContext(), getStyle().getFSFont(c), text); MarkerData.TextMarker result = new MarkerData.TextMarker(); result.setText(text); result.setLayoutWidth(w); return result; }
private MarkerData.TextMarker makeTextMarker(LayoutContext c, IdentValue listStyle) { String text; int listCounter = getListCounter(); text = CounterFunction.createCounterText(listStyle, listCounter); text += ". "; int w = c.getTextRenderer().getWidth( c.getFontContext(), getStyle().getFSFont(c), text); MarkerData.TextMarker result = new MarkerData.TextMarker(); result.setText(text); result.setLayoutWidth(w); return result; }
private void drawFontMetrics(RenderingContext c, InlineText inlineText) { InlineLayoutBox iB = inlineText.getParent(); String text = inlineText.getSubstring(); setColor(new FSRGBColor(0xFF, 0x33, 0xFF)); FSFontMetrics fm = iB.getStyle().getFSFontMetrics(null); int width = c.getTextRenderer().getWidth( c.getFontContext(), iB.getStyle().getFSFont(c), text); int x = iB.getAbsX() + inlineText.getX(); int y = iB.getAbsY() + iB.getBaseline(); drawLine(x, y, x + width, y); y += (int) Math.ceil(fm.getDescent()); drawLine(x, y, x + width, y); y -= (int) Math.ceil(fm.getDescent()); y -= (int) Math.ceil(fm.getAscent()); drawLine(x, y, x + width, y); }
private void drawFontMetrics(RenderingContext c, InlineText inlineText) { InlineLayoutBox iB = inlineText.getParent(); String text = inlineText.getSubstring(); setColor(new FSRGBColor(0xFF, 0x33, 0xFF)); FSFontMetrics fm = iB.getStyle().getFSFontMetrics(null); int width = c.getTextRenderer().getWidth( c.getFontContext(), iB.getStyle().getFSFont(c), text); int x = iB.getAbsX() + inlineText.getX(); int y = iB.getAbsY() + iB.getBaseline(); drawLine(x, y, x + width, y); y += (int) Math.ceil(fm.getDescent()); drawLine(x, y, x + width, y); y -= (int) Math.ceil(fm.getDescent()); y -= (int) Math.ceil(fm.getAscent()); drawLine(x, y, x + width, y); }
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); } }
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); } }
protected void initDimensions(LayoutContext c, BlockBox box, int cssWidth, int cssHeight) { if (cssWidth != -1) { setWidth(cssWidth); } else { setWidth(c.getTextRenderer().getWidth( c.getFontContext(), box.getStyle().getFSFont(c), spaces(getSize(box.getElement())))); } if (cssHeight != -1) { setHeight(cssHeight); } else { setHeight((int) (box.getStyle().getLineHeight(c))); } }
protected void initDimensions(LayoutContext c, BlockBox box, int cssWidth, int cssHeight) { if (cssWidth != -1) { setWidth(cssWidth); } else { setWidth(c.getTextRenderer().getWidth( c.getFontContext(), box.getStyle().getFSFont(c), spaces(getSize(box.getElement())))); } if (cssHeight != -1) { setHeight(cssHeight); } else { setHeight((int) (box.getStyle().getLineHeight(c))); } }
protected void initDimensions(LayoutContext c, BlockBox box, int cssWidth, int cssHeight) { if (cssWidth != -1) { setWidth(cssWidth); } else { setWidth(c.getTextRenderer().getWidth( c.getFontContext(), box.getStyle().getFSFont(c), spaces(getSize(box.getElement())))); } if (cssHeight != -1) { setHeight(cssHeight); } else { setHeight((int) (box.getStyle().getLineHeight(c))); } }
protected void initDimensions(LayoutContext c, BlockBox box, int cssWidth, int cssHeight) { if (cssWidth != -1) { setWidth(cssWidth); } else { setWidth(c.getTextRenderer().getWidth( c.getFontContext(), box.getStyle().getFSFont(c), spaces(getSize(box.getElement())))); } if (cssHeight != -1) { setHeight(cssHeight); } else { setHeight((int) (box.getStyle().getLineHeight(c))); } }