Skip to content

Commit bdb799c

Browse files
committed
PDFBOX-5946: replace drawCross with drawZapf call
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1923624 13f79535-47bb-0310-9956-ffa450edef68
1 parent 7878f0a commit bdb799c

File tree

1 file changed

+1
-36
lines changed

1 file changed

+1
-36
lines changed

pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDTextAppearanceHandler.java

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public void generateNormalAppearance()
109109
drawNote(annotation, contentStream);
110110
break;
111111
case PDAnnotationText.NAME_CROSS:
112-
drawCross(annotation, contentStream);
112+
drawZapf(annotation, contentStream, 19, 0, "a22"); // 0x2716
113113
break;
114114
case PDAnnotationText.NAME_CIRCLE:
115115
drawCircles(annotation, contentStream);
@@ -271,41 +271,6 @@ private void drawInsert(PDAnnotationText annotation, final PDAppearanceContentSt
271271
contentStream.closeAndFillAndStroke();
272272
}
273273

274-
private void drawCross(PDAnnotationText annotation, final PDAppearanceContentStream contentStream)
275-
throws IOException
276-
{
277-
PDRectangle bbox = adjustRectAndBBox(annotation, 19, 19);
278-
279-
// should be a square, but who knows...
280-
float min = Math.min(bbox.getWidth(), bbox.getHeight());
281-
282-
// small = offset nearest bbox edge
283-
// large = offset second nearest bbox edge
284-
float small = min / 10;
285-
float large = min / 5;
286-
287-
contentStream.setMiterLimit(4);
288-
contentStream.setLineJoinStyle(1);
289-
contentStream.setLineCapStyle(0);
290-
contentStream.setLineWidth(0.59f); // value from Adobe
291-
292-
contentStream.moveTo(small, large);
293-
contentStream.lineTo(large, small);
294-
contentStream.lineTo(min / 2, min / 2 - small);
295-
contentStream.lineTo(min - large, small);
296-
contentStream.lineTo(min - small, large);
297-
contentStream.lineTo(min / 2 + small, min / 2);
298-
contentStream.lineTo(min - small, min - large);
299-
contentStream.lineTo(min - large, min - small);
300-
contentStream.lineTo(min / 2, min / 2 + small);
301-
contentStream.lineTo(large, min - small);
302-
contentStream.lineTo(small, min - large);
303-
contentStream.lineTo(min / 2 - small, min / 2);
304-
contentStream.closeAndFillAndStroke();
305-
306-
// alternatively, this could also be drawn with Zapf Dingbats "a21"
307-
}
308-
309274
private void drawHelp(PDAnnotationText annotation, final PDAppearanceContentStream contentStream)
310275
throws IOException
311276
{

0 commit comments

Comments
 (0)