+ else if (m_pango_page_ok)
+ {
+ int elements = m_pango_page.m_elements.size();
+ subfont_t face;
+
+ for (int i=0; i<elements; ++i)
+ {
+ face = Subtitle_Regular;
+ ePangoSubtitlePageElement &element = m_pango_page.m_elements[i];
+ std::string text = element.m_pango_line;
+ std::string::size_type loc = text.find("<", 0 );
+ if ( loc != std::string::npos )
+ {
+ switch (char(text.at(1)))
+ {
+ case 'i':
+ face = Subtitle_Italic;
+ break;
+ case 'b':
+ face = Subtitle_Bold;
+ break;
+ }
+ text = text.substr(3, text.length()-7);
+ }
+ text = replace_all(text, "'", "'");
+ text = replace_all(text, """, "\"");
+ text = replace_all(text, "&", "&");
+ painter.setFont(subtitleStyles[face].font);
+ eRect &area = element.m_area;
+ eRect shadow = area;
+ shadow.moveBy(subtitleStyles[face].shadow_offset);
+ painter.setForegroundColor(subtitleStyles[face].shadow_color);
+ painter.renderText(shadow, text, gPainter::RT_WRAP|gPainter::RT_VALIGN_CENTER|gPainter::RT_HALIGN_CENTER);
+ if ( !subtitleStyles[face].have_foreground_color && element.m_have_color )
+ painter.setForegroundColor(element.m_color);
+ else
+ painter.setForegroundColor(subtitleStyles[face].foreground_color);
+ painter.renderText(area, text, gPainter::RT_WRAP|gPainter::RT_VALIGN_CENTER|gPainter::RT_HALIGN_CENTER);
+ }
+ }