@Override public GVTLineMetrics getLineMetrics(CharacterIterator arg0, int arg1, int arg2, FontRenderContext arg3) { return new GVTLineMetrics(this.baseFont.getLineMetrics(arg0, arg1, arg2, arg3)); }
public void addLineMetrics(GVTFont font, GVTLineMetrics lm) { if (ascent < lm.getAscent()) ascent = lm.getAscent(); if (descent < lm.getDescent()) descent = lm.getDescent(); }
= vertical ? (float) gv.getLogicalBounds().getWidth() : (metrics.getAscent() + Math.abs(metrics.getDescent())); float asc = metrics.getAscent(); float dsc = metrics.getDescent(); verticalFirstOffset = asc+(advY-(asc+dsc))/2; if (glyphOrientationAngle == 0) { float advY = gm.getVerticalAdvance(); float asc = metrics.getAscent(); float dsc = metrics.getDescent(); verticalFirstOffset = asc+(advY-(asc+dsc))/2; } else { (verticalFirstOffset == 0f) && !isLatinChar(ch)) { float advY = gm.getVerticalAdvance(); float asc = metrics.getAscent(); float dsc = metrics.getDescent(); verticalFirstOffset = asc + (advY - (asc+dsc))/2; ox += metrics.getStrikethroughOffset(); } else { Rectangle2D glyphBounds glyphBounds.getWidth()/2); } else if (glyphOrientationAngle == 90) { ox += metrics.getStrikethroughOffset(); } else { // 270
/** * Returns a shape describing the strikethrough line for a given ACI. */ protected Shape getStrikethroughShape() { double y = metrics.getStrikethroughOffset(); float strikethroughThickness = metrics.getStrikethroughThickness(); Stroke strikethroughStroke = new BasicStroke(strikethroughThickness); // Not certain what should be done here... aci.first(); Float dy = (Float) aci.getAttribute(DY); if (dy != null) y += dy; Rectangle2D logicalBounds = gv.getLogicalBounds(); return strikethroughStroke.createStrokedShape( new Line2D.Double( logicalBounds.getMinX() + strikethroughThickness/2.0, offset.getY()+y, logicalBounds.getMaxX() - strikethroughThickness/2.0, offset.getY()+y)); }
/** * Returns a shape describing the overline decoration for a given ACI. */ protected Shape getOverlineShape() { double y = metrics.getOverlineOffset(); float overlineThickness = metrics.getOverlineThickness(); // need to move the overline a bit lower, // not sure if this is correct behaviour or not y += overlineThickness; // Not certain what should be done here... aci.first(); Float dy = (Float) aci.getAttribute(DY); if (dy != null) y += dy.floatValue(); Stroke overlineStroke = new BasicStroke(overlineThickness); Rectangle2D logicalBounds = gv.getLogicalBounds(); return overlineStroke.createStrokedShape( new Line2D.Double( logicalBounds.getMinX() + overlineThickness/2.0, offset.getY()+y, logicalBounds.getMaxX() - overlineThickness/2.0, offset.getY()+y)); }
/** * Returns a shape describing the undeline decoration for a given ACI. */ protected Shape getUnderlineShape() { double y = metrics.getUnderlineOffset(); float underlineThickness = metrics.getUnderlineThickness(); // need to move the underline a bit lower, // not sure if this is correct behaviour or not y += underlineThickness*1.5; BasicStroke underlineStroke = new BasicStroke(underlineThickness); // Not certain what should be done here... aci.first(); Float dy = (Float) aci.getAttribute(DY); if (dy != null) y += dy.floatValue(); Rectangle2D logicalBounds = gv.getLogicalBounds(); return underlineStroke.createStrokedShape( new Line2D.Double( logicalBounds.getMinX() + underlineThickness/2.0, offset.getY()+y, logicalBounds.getMaxX() - underlineThickness/2.0, offset.getY()+y)); }
= vertical ? (float) gv.getLogicalBounds().getWidth() : (metrics.getAscent() + Math.abs(metrics.getDescent())); float asc = metrics.getAscent(); float dsc = metrics.getDescent(); verticalFirstOffset = asc+(advY-(asc+dsc))/2; if (glyphOrientationAngle == 0) { float advY = gm.getVerticalAdvance(); float asc = metrics.getAscent(); float dsc = metrics.getDescent(); verticalFirstOffset = asc+(advY-(asc+dsc))/2; } else { (verticalFirstOffset == 0f) && !isLatinChar(ch)) { float advY = gm.getVerticalAdvance(); float asc = metrics.getAscent(); float dsc = metrics.getDescent(); verticalFirstOffset = asc + (advY - (asc+dsc))/2; ox += metrics.getStrikethroughOffset(); } else { Rectangle2D glyphBounds glyphBounds.getWidth()/2); } else if (glyphOrientationAngle == 90) { ox += metrics.getStrikethroughOffset(); } else { // 270
/** * Returns a shape describing the strikethrough line for a given ACI. */ protected Shape getStrikethroughShape() { double y = metrics.getStrikethroughOffset(); float strikethroughThickness = metrics.getStrikethroughThickness(); Stroke strikethroughStroke = new BasicStroke(strikethroughThickness); // Not certain what should be done here... aci.first(); Float dy = (Float) aci.getAttribute(DY); if (dy != null) y += dy.floatValue(); Rectangle2D logicalBounds = gv.getLogicalBounds(); return strikethroughStroke.createStrokedShape( new Line2D.Double( logicalBounds.getMinX() + strikethroughThickness/2.0, offset.getY()+y, logicalBounds.getMaxX() - strikethroughThickness/2.0, offset.getY()+y)); }
/** * Returns a shape describing the overline decoration for a given ACI. */ protected Shape getOverlineShape() { double y = metrics.getOverlineOffset(); float overlineThickness = metrics.getOverlineThickness(); // need to move the overline a bit lower, // not sure if this is correct behaviour or not y += overlineThickness; // Not certain what should be done here... aci.first(); Float dy = (Float) aci.getAttribute(DY); if (dy != null) y += dy; Stroke overlineStroke = new BasicStroke(overlineThickness); Rectangle2D logicalBounds = gv.getLogicalBounds(); return overlineStroke.createStrokedShape( new Line2D.Double( logicalBounds.getMinX() + overlineThickness/2.0, offset.getY()+y, logicalBounds.getMaxX() - overlineThickness/2.0, offset.getY()+y)); }
/** * Returns a shape describing the undeline decoration for a given ACI. */ protected Shape getUnderlineShape() { double y = metrics.getUnderlineOffset(); float underlineThickness = metrics.getUnderlineThickness(); // need to move the underline a bit lower, // not sure if this is correct behaviour or not y += underlineThickness*1.5; BasicStroke underlineStroke = new BasicStroke(underlineThickness); // Not certain what should be done here... aci.first(); Float dy = (Float) aci.getAttribute(DY); if (dy != null) y += dy; Rectangle2D logicalBounds = gv.getLogicalBounds(); return underlineStroke.createStrokedShape( new Line2D.Double( logicalBounds.getMinX() + underlineThickness/2.0, offset.getY()+y, logicalBounds.getMaxX() - underlineThickness/2.0, offset.getY()+y)); }
public void addLineMetrics(GVTFont font, GVTLineMetrics lm) { if (ascent < lm.getAscent()) ascent = lm.getAscent(); if (descent < lm.getDescent()) descent = lm.getDescent(); }
/** * Returns a LineMetrics object created with the specified arguments. */ public GVTLineMetrics getLineMetrics(char[] chars, int beginIndex, int limit, FontRenderContext frc) { return new GVTLineMetrics (awtFont.getLineMetrics(chars, beginIndex, limit, frc), (float)scale); }
= vertical ? (float) gv.getLogicalBounds().getWidth() : (metrics.getAscent() + Math.abs(metrics.getDescent())); float asc = metrics.getAscent(); float dsc = metrics.getDescent(); verticalFirstOffset = asc+(advY-(asc+dsc))/2; if (glyphOrientationAngle == 0) { float advY = gm.getVerticalAdvance(); float asc = metrics.getAscent(); float dsc = metrics.getDescent(); verticalFirstOffset = asc+(advY-(asc+dsc))/2; } else { (verticalFirstOffset == 0f) && !isLatinChar(ch)) { float advY = gm.getVerticalAdvance(); float asc = metrics.getAscent(); float dsc = metrics.getDescent(); verticalFirstOffset = asc + (advY - (asc+dsc))/2; ox += metrics.getStrikethroughOffset(); } else { Rectangle2D glyphBounds glyphBounds.getWidth()/2); } else if (glyphOrientationAngle == 90) { ox += metrics.getStrikethroughOffset(); } else { // 270
/** * Returns a shape describing the strikethrough line for a given ACI. */ protected Shape getStrikethroughShape() { double y = metrics.getStrikethroughOffset(); float strikethroughThickness = metrics.getStrikethroughThickness(); Stroke strikethroughStroke = new BasicStroke(strikethroughThickness); // Not certain what should be done here... aci.first(); Float dy = (Float) aci.getAttribute(DY); if (dy != null) y += dy; Rectangle2D logicalBounds = gv.getLogicalBounds(); return strikethroughStroke.createStrokedShape( new Line2D.Double( logicalBounds.getMinX() + strikethroughThickness/2.0, offset.getY()+y, logicalBounds.getMaxX() - strikethroughThickness/2.0, offset.getY()+y)); }
/** * Returns a shape describing the overline decoration for a given ACI. */ protected Shape getOverlineShape() { double y = metrics.getOverlineOffset(); float overlineThickness = metrics.getOverlineThickness(); // need to move the overline a bit lower, // not sure if this is correct behaviour or not y += overlineThickness; // Not certain what should be done here... aci.first(); Float dy = (Float) aci.getAttribute(DY); if (dy != null) y += dy; Stroke overlineStroke = new BasicStroke(overlineThickness); Rectangle2D logicalBounds = gv.getLogicalBounds(); return overlineStroke.createStrokedShape( new Line2D.Double( logicalBounds.getMinX() + overlineThickness/2.0, offset.getY()+y, logicalBounds.getMaxX() - overlineThickness/2.0, offset.getY()+y)); }
/** * Returns a shape describing the undeline decoration for a given ACI. */ protected Shape getUnderlineShape() { double y = metrics.getUnderlineOffset(); float underlineThickness = metrics.getUnderlineThickness(); // need to move the underline a bit lower, // not sure if this is correct behaviour or not y += underlineThickness*1.5; BasicStroke underlineStroke = new BasicStroke(underlineThickness); // Not certain what should be done here... aci.first(); Float dy = (Float) aci.getAttribute(DY); if (dy != null) y += dy; Rectangle2D logicalBounds = gv.getLogicalBounds(); return underlineStroke.createStrokedShape( new Line2D.Double( logicalBounds.getMinX() + underlineThickness/2.0, offset.getY()+y, logicalBounds.getMaxX() - underlineThickness/2.0, offset.getY()+y)); }
public void addLineMetrics(GVTFont font, GVTLineMetrics lm) { if (ascent < lm.getAscent()) ascent = lm.getAscent(); if (descent < lm.getDescent()) descent = lm.getDescent(); }
/** * Returns a GVTLineMetrics object created with the specified arguments. */ public GVTLineMetrics getLineMetrics(CharacterIterator ci, int beginIndex, int limit, FontRenderContext frc) { return new GVTLineMetrics (awtFont.getLineMetrics(ci, beginIndex, limit, frc), (float)scale); }
public void initLineInfo(FontRenderContext frc) { float fontSize = 12; Float fsFloat = (Float)fontAttrs.get(TextAttribute.SIZE); if (fsFloat != null) fontSize = fsFloat; for (Object aFontList : fontList) { GVTFont font = (GVTFont) aFontList; GVTLineMetrics lm = font.getLineMetrics("", frc); this.ascent = lm.getAscent(); this.descent = lm.getDescent(); break; } if (ascent == -1) { ascent = fontSize * 0.8f; descent = fontSize * 0.2f; } }
@Override public GVTLineMetrics getLineMetrics(char[] arg0, int arg1, int arg2, FontRenderContext arg3) { return new GVTLineMetrics(this.baseFont.getLineMetrics(arg0, arg1, arg2, arg3)); }