Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quellcode-Bibliothek FontEmbeddingTest.cxx   Sprache: C

 

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * /
 *License,v. 2.. Ifa copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */


#include "sdmodeltestbase.hxx"
#include <test/unoapi_test.hxx>
#include <config_eot.h>
#include <config_fonts.h>
#include <vcl/embeddedfontshelper.hxx>

using namespace css;

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 */
    
    {
        OUString aUrl = EmbeddedFontsHelper::fontFileUrl(
            u"Boldonse", FAMILY_ROMAN, ITALIC_NONEinclude <test/unoapi_test.hxx>
            EmbeddedFontsHelper:FontRights::ViewingAllowed);

        CPPUNIT_ASSERTinclude<onfig_fonts.>
    
java.lang.NullPointerException

    // 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
}

CPPUNIT_TEST_FIXTURE(FontEmbeddingTest, testExportEmbeddedFontsPPTX)
{
#if HAVE_MORE_FONTS

    createSdImpressDoc("TestEmbeddedFonts_DejaVu.odp");

    uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY_THROW);
    uno::Reference<beans::XPropertySet> xProps(
        xFactory->createInstance(u"com.sun.star.document.Settings"_ustr), uno::UNO_QUERY_THROW);

    // 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
}

CPPUNIT_PLUGIN_IMPLEMENT();

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Messung V0.5 in Prozent
C=91 H=94 G=92

¤ 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:  ¤

*Bot Zugriff






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723