protected void drawMixedMediaText(BufferedImage target, ArrayList<MixedMediaText> lines, ElementLayout elementLayout) {
        Graphics2D g = (Graphics2D) target.getGraphics();
        g.setFont(elementLayout.getFont());
        g.setColor(elementLayout.getCardFont().getColor());
        g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);
        g.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
        g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
        g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
        
        FontMetrics fm = g.getFontMetrics();
        int actualHeight = fm.getAscent() - fm.getDescent();
        int lineHeight = fm.getHeight();
        int index = 0;
        
        for (MixedMediaText mmt: lines) {
            MarkupElement me;
        
            int offset = 0;
            int spaceWidth = fm.getStringBounds(" ", g).getBounds().width;
            int textBottom = (elementLayout.getY() + elementLayout.getMarginY() + actualHeight) + (index * lineHeight);
            
            // Debugging lines
            if (ConfigHolder.getConfig("debug") != null) {
                g.setColor(Color.GREEN);
                g.drawLine(elementLayout.getX(), textBottom, elementLayout.getWidth(), textBottom);
                g.setColor(Color.BLUE);
                g.drawLine(elementLayout.getX(), textBottom - fm.getAscent(), elementLayout.getWidth(), textBottom - fm.getAscent());
                g.setColor(Color.RED);
                g.drawLine(elementLayout.getX(), textBottom - (fm.getAscent() - fm.getDescent()), elementLayout.getWidth(), textBottom - (fm.getAscent() - fm.getDescent()));
            }
            
            g.setColor(elementLayout.getCardFont().getColor());
            
            while ((me = mmt.next()) != null) {
                int startX;

                switch (elementLayout.getAlign()) {
                    case "right":
                        startX = (elementLayout.getWidth() - elementLayout.getMarginX() - mmt.getWidth());
                        break;
                    case "center":
                        startX = elementLayout.getMarginX() + (elementLayout.getWidth() - mmt.getWidth())/2;
                        break;
                    case "left":
                    default:
                        startX = elementLayout.getMarginX();
                        break;
                }
                
                if (me instanceof TextInsert) {
                	TextInsert ti = (TextInsert)me;
                	
                	CardFont cf = elementLayout.getCardFont();
                    Font f = new Font(cf.getFamily(), ti.getFontWeight(), cf.getSize());
                    g.setFont(f);
                    fm = g.getFontMetrics();
                    spaceWidth = fm.getStringBounds(" ", g).getBounds().width;
                    
                    g.drawString(me.getText(), elementLayout.getX() + startX + offset, textBottom);
                    offset += fm.getStringBounds(me.getText(), g).getBounds().width + spaceWidth;
                } else if (me instanceof ImageInsert) {
                    Resource r = cardLayout.getResource(me.getText());
                    Integer larger = Math.max(r.getHeight(), actualHeight);
                    Integer diff = Math.abs(r.getHeight() - actualHeight);
                    Integer correction = (int)Math.round((double)diff/2.0);
                    Integer imageDelta = larger - correction;
                    g.drawImage(r.getImage(), null, elementLayout.getX() + startX + offset, (textBottom - imageDelta));
                    offset += r.getWidth() + spaceWidth;
                }
            }
            index++;
        }
    }