protected float distanceBetweenRun (CharacterInformation last, CharacterInformation first){ float distance; Point2D startPoint; Point2D endPoint; CharacterInformation info = new CharacterInformation(); //determine where the last run stops info.layout = last.layout; info.glyphIndexEnd = last.layout.getGlyphCount()-1; startPoint = getEndPoint(info); //determine where the next run starts info.layout = first.layout; info.glyphIndexStart = 0; endPoint = getStartPoint(info); if( first.isVertical() ){ distance = (float)(endPoint.getY() - startPoint.getY()); } else{ distance = (float)(endPoint.getX() - startPoint.getX()); } return distance; }
protected float distanceBetweenRun (CharacterInformation last, CharacterInformation first){ float distance; Point2D startPoint; Point2D endPoint; CharacterInformation info = new CharacterInformation(); //determine where the last run stops info.layout = last.layout; info.glyphIndexEnd = last.layout.getGlyphCount()-1; startPoint = getEndPoint(info); //determine where the next run starts info.layout = first.layout; info.glyphIndexStart = 0; endPoint = getStartPoint(info); if( first.isVertical() ){ distance = (float)(endPoint.getY() - startPoint.getY()); } else{ distance = (float)(endPoint.getX() - startPoint.getX()); } return distance; }
protected float distanceBetweenRun (CharacterInformation last, CharacterInformation first){ float distance; Point2D startPoint; Point2D endPoint; CharacterInformation info = new CharacterInformation(); //determine where the last run stops info.layout = last.layout; info.glyphIndexEnd = last.layout.getGlyphCount()-1; startPoint = getEndPoint(info); //determine where the next run starts info.layout = first.layout; info.glyphIndexStart = 0; endPoint = getStartPoint(info); if( first.isVertical() ){ distance = (float)(endPoint.getY() - startPoint.getY()); } else{ distance = (float)(endPoint.getX() - startPoint.getX()); } return distance; }
/** * Implementation of {@link * org.w3c.dom.svg.SVGTextContentElement#getEndPositionOfChar(int charnum)}. */ protected Point2D getEndPositionOfChar(Element element,int charnum ){ TextNode textNode = getTextNode(); AttributedCharacterIterator aci; aci = textNode.getAttributedCharacterIterator(); if (aci == null) return null; int firstChar = getElementStartIndex(element); if ( firstChar == -1 ) return null; //retrieve the text run for the text node List list = getTextRuns(textNode); //find the glyph information for the character 'charnum' CharacterInformation info; info = getCharacterInformation(list, firstChar,charnum, aci); if ( info == null ) return null; return getEndPoint(info); }
/** * Implementation of {@link * org.w3c.dom.svg.SVGTextContentElement#getEndPositionOfChar(int charnum)}. */ protected Point2D getEndPositionOfChar(Element element,int charnum ){ TextNode textNode = getTextNode(); AttributedCharacterIterator aci; aci = textNode.getAttributedCharacterIterator(); if (aci == null) return null; int firstChar = getElementStartIndex(element); if ( firstChar == -1 ) return null; //retrieve the text run for the text node List list = getTextRuns(textNode); //find the glyph information for the character 'charnum' CharacterInformation info; info = getCharacterInformation(list, firstChar,charnum, aci); if ( info == null ) return null; return getEndPoint(info); }
/** * Implementation of {@link * org.w3c.dom.svg.SVGTextContentElement#getEndPositionOfChar(int charnum)}. */ protected Point2D getEndPositionOfChar(Element element,int charnum ){ TextNode textNode = getTextNode(); AttributedCharacterIterator aci; aci = textNode.getAttributedCharacterIterator(); if (aci == null) return null; int firstChar = getElementStartIndex(element); if ( firstChar == -1 ) return null; //retrieve the text run for the text node List list = getTextRuns(textNode); //find the glyph information for the character 'charnum' CharacterInformation info; info = getCharacterInformation(list, firstChar,charnum, aci); if ( info == null ) return null; return getEndPoint(info); }