@Override
    protected void paintComponent(Graphics g) {
        g.clearRect(0, 0, getWidth(), getHeight());
        
        final float pageWidth = currentPage.getClipBox().getWidth();
        final float scalingScalar = pageSize.width / pageWidth;
        
        for (Text t : currentPage.getText()) {
            int style = Font.PLAIN;
            if (t.getFontFace().equals("Bold")) {
                style = Font.BOLD;
            } else if (t.getFontFace().equals("Italic")
                    || t.getFontFace().equals("Oblique")) {
                style = Font.ITALIC;
            }
            Font f = new Font(Font.SANS_SERIF, 
                              style, 
                              (int) (t.getPointSize() * scalingScalar));
            
            int x = (int) (scalingScalar * t.getX());
            int y = (int) (scalingScalar * t.getBaseline());
            g.setFont(f);
            g.setColor(Color.BLACK);
            g.drawString(t.getRun(), x, y);
            
            int top = (int) (scalingScalar * t.getTop());
            int width = (int) (scalingScalar * t.getWidth());
            int height = (int) (scalingScalar * t.getHeight());
            g.setColor(Color.GREEN);
            g.drawRect(x, top, width, height);
        }
    }