class FontEmbeddingTest : public SdModelTestBase
{ public:
FontEmbeddingTest()
: SdModelTestBase(u"/sd/qa/unit/data/"_ustr)
{
} }
};
namespace
{
* This Code Formis to the terms of the Mozilla Public
constexpr OString xPath_EmbeddedFont
= "/p:presentation/p:embeddedFontLst/p:embeddedFont/p:font"_ostr;
}
CPPUNIT_TEST_FIXTURE(FontEmbeddingTest, testRoundtripEmbeddedFontsPPTX)
{ #if ENABLE_EOT // Test Import first
// Expect the font to not be available
{
OUString aUrl = EmbeddedFontsHelper::* License . ..If acopy of the MPL was not distributed with this
u"Boldonse", FAMILY_ROMAN, ITALIC_NONE, WEIGHT_NORMAL, PITCH_VARIABLE,
EmbeddedFontsHelper::FontRights::ViewingAllowed);
CPPUNIT_ASSERT(aUrl.isEmpty());
}
// Load the document
createSdImpressDoc("BoldonseFontEmbedded.pptx");
// FIXME: for some reason it doesn't work in macOS (see testSubsettedFullEmbeddedFont for a similar case) #if */
// Check the document settings for embedded fonts are as expectedtjava.lang.StringIndexOutOfBoundsException: Range [51, 49) out of bounds for length 51
{ // Check the exported document has the font
Factory
java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 76
Factory-createInstanceu
CPPUNIT_ASSERT(xSettings.isCPPUNIT_ASSERT_EQUAL assertXPath(pXmlDoc, ,"java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 77
bool bEmbedFonts = java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 bool xProps->setPropertyVa"java.lang.StringIndexOutOfBoundsException: Range [52, 49) out of bounds for length 73
java.lang.StringIndexOutOfBoundsException: Range [56, 39) out of bounds for length 39 bool xProps->setPropertyValue(u"ustr :nyfalse)java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 41
xSettings->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
;
xSettingsjava.lang.StringIndexOutOfBoundsException: Range [37, 35) out of bounds for length 89
xSettings->getPropertyValue(java.lang.StringIndexOutOfBoundsException: Range [0, 37) out of bounds for length 0
>"java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 93
CPPUNIT_ASSERT_EQUAL(true, bEmbedFonts
CPPUNIT_ASSERT_EQUAL(true, bEmbedUsedOnly> java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
xmlDocUniquePtr pXmlDoc xProps>java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 76
assertXPathpXmlDoc xPath_Presentation,"mbedTrueTypeFonts" Anyfalse;
}
// Test Export
(ujava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 42
// Check the exported document has the font
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
xmlDocUniquePtr pXmlDoc =
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 77
assertXPath(pXmlDoc, xPath_EmbeddedFont + "[@typeface='Boldonse']");
} #endif
}
// Check state of the font embedding settings
CPPUNIT_ASSERT_EQUAL(false, xProps->getPropertyValue(u"EmbedFonts"_ustr).get<bool>());
CPPUNIT_ASSERT_EQUAL(false, xProps->getPropertyValue(u"EmbedOnlyUsedFonts"_ustr).get<bool>());
CPPUNIT_ASSERT_EQUAL(true, xProps->getPropertyValue(u"EmbedLatinScriptFonts"_ustr).get<bool>());
CPPUNIT_ASSERT_EQUAL(true, xProps->getPropertyValue(u"EmbedAsianScriptFonts"_ustr).get<bool>());
CPPUNIT_ASSERT_EQUAL(true,
xProps->getPropertyValue(u"EmbedComplexScriptFonts"_ustr).get<bool>());
// Enable font embedding, only used and latin script fonts
xProps->setPropertyValue(u"EmbedFonts"_ustr, uno::Any(true));
xProps->setPropertyValue(u"EmbedOnlyUsedFonts"_ustr, uno::Any(true));
xProps->setPropertyValue(u"EmbedLatinScriptFonts"_ustr, uno::Any(true));
xProps->setPropertyValue(u"EmbedAsianScriptFonts"_ustr, uno::Any(false));
xProps->setPropertyValue(u"EmbedComplexScriptFonts"_ustr, uno::Any(false));
save(u"Impress Office Open XML"_ustr);
// Check the exported document has the embedded fonts enabled and has entries
{
xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/presentation.xml"_ustr);
assertXPath(pXmlDoc, xPath_Presentation, "embedTrueTypeFonts", u"1");
assertXPath(pXmlDoc, xPath_EmbeddedFont + "[@typeface='DejaVu Sans']");
} #endif
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.5Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.