|
@@ -40,6 +40,23 @@
|
|
|
|
|
|
|
|
namespace Rml {
|
|
namespace Rml {
|
|
|
|
|
|
|
|
|
|
+String FontFaceDescription(const String& font_family, Style::FontStyle style, Style::FontWeight weight)
|
|
|
|
|
+{
|
|
|
|
|
+ String font_attributes;
|
|
|
|
|
+
|
|
|
|
|
+ if (style == Style::FontStyle::Italic)
|
|
|
|
|
+ font_attributes += "italic, ";
|
|
|
|
|
+ if (weight == Style::FontWeight::Bold)
|
|
|
|
|
+ font_attributes += "bold, ";
|
|
|
|
|
+
|
|
|
|
|
+ if (font_attributes.empty())
|
|
|
|
|
+ font_attributes = "regular";
|
|
|
|
|
+ else
|
|
|
|
|
+ font_attributes.resize(font_attributes.size() - 2);
|
|
|
|
|
+
|
|
|
|
|
+ return CreateString(font_attributes.size() + font_family.size() + 8, "'%s' [%s]", font_family.c_str(), font_attributes.c_str());
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
LayoutInlineBoxText::LayoutInlineBoxText(ElementText* element, int _line_begin) : LayoutInlineBox(static_cast<Element*>(element), Box())
|
|
LayoutInlineBoxText::LayoutInlineBoxText(ElementText* element, int _line_begin) : LayoutInlineBox(static_cast<Element*>(element), Box())
|
|
|
{
|
|
{
|
|
|
line_begin = _line_begin;
|
|
line_begin = _line_begin;
|
|
@@ -160,8 +177,9 @@ void LayoutInlineBoxText::BuildWordBox()
|
|
|
height = 0;
|
|
height = 0;
|
|
|
baseline = 0;
|
|
baseline = 0;
|
|
|
|
|
|
|
|
|
|
+ const ComputedValues& computed = text_element->GetComputedValues();
|
|
|
const String font_family_property = text_element->GetProperty<String>("font-family");
|
|
const String font_family_property = text_element->GetProperty<String>("font-family");
|
|
|
- const String& font_family_computed = text_element->GetComputedValues().font_family;
|
|
|
|
|
|
|
+ const String& font_family_computed = computed.font_family;
|
|
|
|
|
|
|
|
if (ComputeFontFamily(font_family_property) != font_family_computed)
|
|
if (ComputeFontFamily(font_family_property) != font_family_computed)
|
|
|
{
|
|
{
|
|
@@ -184,11 +202,13 @@ void LayoutInlineBoxText::BuildWordBox()
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
|
|
+ const String font_face_description = FontFaceDescription(font_family_property, computed.font_style, computed.font_weight);
|
|
|
|
|
+
|
|
|
Log::Message(
|
|
Log::Message(
|
|
|
Log::LT_WARNING,
|
|
Log::LT_WARNING,
|
|
|
- "No font face defined. Ensure that the specified font family '%s' is correct and has been successfully loaded. "
|
|
|
|
|
- "Please see previous log messages for all successfully loaded fonts, their font family names are logged when they are loaded. On element %s",
|
|
|
|
|
- font_family_property.c_str(),
|
|
|
|
|
|
|
+ "No font face defined. Ensure that the specified font face %s has been successfully loaded. "
|
|
|
|
|
+ "Please see previous log messages for all successfully loaded fonts. On element %s",
|
|
|
|
|
+ font_face_description.c_str(),
|
|
|
text_element->GetAddress().c_str()
|
|
text_element->GetAddress().c_str()
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|