StrutMetrics strutMetrics = box.getStructMetrics(); int h = (int) Math.round(strutMetrics.getAscent()); int rad = (int)((strutMetrics.getAscent() + strutMetrics.getDescent()) / 3); int x = box.getAbsX() + (int)box.getStyle().getMarginWidth(c).left() - rad * 5 / 2; int y = box.getAbsY() + box.ty + strutMetrics.getBaseline() - h / 2 - rad / 2;
StrutMetrics strutMetrics = box.getMarkerData().getStructMetrics(); MarkerData.GlyphMarker marker = box.getMarkerData().getGlyphMarker(); int x = getReferenceX(c, box); if (box.getStyle().getCalculatedStyle().isIdent(CSSName.LIST_STYLE_POSITION, IdentValue.INSIDE)) { x += marker.getLayoutWidth() / 2 - marker.getDiameter() / 2; } else { x += -marker.getLayoutWidth() + (marker.getLayoutWidth() / 2 - marker.getDiameter() / 2); } int y = getReferenceBaseline(c, box) - (int)strutMetrics.getAscent() / 2 - marker.getDiameter() / 2;
    private static void drawGlyph(RenderingContext c, BlockBox box, CalculatedStyle style, IdentValue listStyle) {        // save the old AntiAliasing setting, then force it on        Object aa_key = c.getGraphics().getRenderingHint(RenderingHints.KEY_ANTIALIASING);        c.getGraphics().setRenderingHint(RenderingHints.KEY_ANTIALIASING,                RenderingHints.VALUE_ANTIALIAS_ON);        // calculations for bullets        StrutMetrics strutMetrics = box.getStructMetrics();        int h = (int) Math.round(strutMetrics.getAscent());        int rad = (int)((strutMetrics.getAscent() + strutMetrics.getDescent()) / 3);        int x = box.getAbsX() + (int)box.getStyle().getMarginWidth(c).left() - rad * 5 / 2;        int y = box.getAbsY() + box.ty + strutMetrics.getBaseline() - h / 2 - rad / 2;        if (listStyle == IdentValue.DISC) {            c.getGraphics().fillOval(x, y, rad, rad);        } else if (listStyle == IdentValue.SQUARE) {            c.getGraphics().fillRect(x, y, rad, rad);        } else if (listStyle == IdentValue.CIRCLE) {            c.getGraphics().drawOval(x, y, rad, rad);        }        // restore the old AntiAliasing setting        c.getGraphics().setRenderingHint(RenderingHints.KEY_ANTIALIASING,                aa_key);    }