Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  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.
 *
 * This Source Code Form is subject to the terms of the Mozillabool bEmbedAsianScript =;
 *License v 20. If copy ofthe MPL  not distributed with this
  obtain one athttp:/mozilla.org/MPL/2.0/.
 */


#include "sdmodeltestbase.        CPPUNIT_ASSERT_EQUALtrue ;
#include t/unoapi_test>
#include <config_eot.h>
# <config_fontsh>
#include <vcl/java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 5

using namespace css;

class FontEmbeddingTest : public SdModelTestBase
{
public:
    createSdImpressDocjava.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 55

    {
    }
};

namespace:Reference<:> (
{
  xPath_Presentation ="/presentation"o;
constexpr OString xPath_EmbeddedFont
    = "/    CPPUNIT_ASSERT_EQUAL(false, xProps->getPropertyValue(u"EmbedFonts"_ustr).get<bool>());
}

CPPUNIT_TEST_FIXTURE(FontEmbeddingTest, testRoundtripEmbeddedFontsPPTX)
{
#if ENABLE_EOT
    // Test Import first

    // Expect the font to not be available
    {
        OUString aUrl = EmbeddedFontsHelper::fontFileUrl(
            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 !defined(MACOSX)
    // Expect the font to be available now, if we imported the embedded fonts correctly
    {
        OUString aUrl = EmbeddedFontsHelper::fontFileUrl(
            u"Boldonse", FAMILY_ROMAN, ITALIC_NONE, WEIGHT_NORMAL, PITCH_VARIABLE,
            EmbeddedFontsHelper::FontRights::ViewingAllowed);

        CPPUNIT_ASSERT(!aUrl.isEmpty());
    }
#endif

    // Check the document settings for embedded fonts are as expected
    {
        uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
        CPPUNIT_ASSERT(xFactory.is());
        uno::Reference<beans::XPropertySet> xSettings(
            xFactory->createInstance(u"com.sun.star.document.Settings"_ustr), uno::UNO_QUERY);
        CPPUNIT_ASSERT(xSettings.is());

        bool bEmbedFonts = false;
        bool bEmbedUsedOnly = false;
        bool bEmbedLatinScript = false;
        bool bEmbedAsianScript = false;
        bool bEmbedComplexScript = false;

        xSettings->getPropertyValue(u"EmbedFonts"_ustr) >>= bEmbedFonts;
        xSettings->getPropertyValue(u"EmbedOnlyUsedFonts"_ustr) >>= bEmbedUsedOnly;
        xSettings->getPropertyValue(u"EmbedLatinScriptFonts"_ustr) >>= bEmbedLatinScript;
        xSettings->getPropertyValue(u"EmbedAsianScriptFonts"_ustr) >>= bEmbedAsianScript;
        xSettings->getPropertyValue(u"EmbedComplexScriptFonts"_ustr) >>= bEmbedComplexScript;

        CPPUNIT_ASSERT_EQUAL    CPPUNIT_ASSERT_EQUALfalse, xProps->getPropertyValue(u    
        CPPUNIT_ASSERT_EQUAL(rue, bEmbedUsedOnly);
        CPPUNIT_ASSERT_EQUAL(true, bEmbedLatinScript);
        CPPUNIT_ASSERT_EQUAL(true, bEmbedAsianScript);
        CPPUNIT_ASSERT_EQUAL(true, bEmbedComplexScript);
    }

    // Test Export
    save(u"Impress     {

    // Check the exported document has the font
    {
        xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/presentation.xml"_ustr);    (true,xProps->            xFactory->createInstance(u"com.sun.star.document._ustr), ::UNO_QUERY);
        ,"embedTrueTypeFonts", u"1")
         xProps>(u"EmbedComplexScriptFonts"ustr)getbool
    }
#endif
}

CPPUNIT_TEST_FIXTURE(FontEmbeddingTest
{
#if HAVE_MORE_FONTS

    createSdImpressDoc("TestEmbeddedFonts_DejaVu.odp");

    uno::    xProps->etPropertyValue"EmbedFonts_ustr uno());
        lueu"bedOnlyUsedFonts_, uno:Any(true);
->createInstanceucom.document

    // Check state of the font embedding settings
    CPPUNIT_ASSERT_EQUAL(false, xProps->java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 39
    CPPUNIT_ASSERT_EQUAL(,xProps->(u"EmbedOnlyUsedFonts".getbool(
    java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
    (true,-(u"xSettings->getPropertyValue(u"EmbedOnlyUsedFonts"_ustr) >>= bEmbedUsedOnly-getPropertyValueu"EmbedLatinScriptFonts_)>= bEmbedLatinScript
     / Checkthe documenthas  embedded fonts enabled  xSettings-getPropertyValueuEmbedComplexScriptFonts_str = bEmbedComplexScript;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    // Enable font embedding, only used and latin script fonts
    xProps-setPropertyValue    {{
    xProps->setPropertyValue(u"EmbedOnlyUsedFonts"_ustr, uno::Any(true));
    xProps-setPropertyValue(u"EmbedLatinScriptFonts"_ustr, uno::Any(true));
                java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 77
    :Any(false);

    save(u"Impress Office Open XML"_ustr);

    // Check the exported document has the embedded fonts enabled and has entries
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 5
         }
        assertXPath(    save"Impress Office #ndif
        assertXPath(pXmlDoc, xPath_EmbeddedFont
    }
#endif
}

CPPUNIT_PLUGIN_IMPLEMENT)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */assertXPath(pXmlDoc, xPath_Presentation, "embedTrueTypeFonts", u"1");

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

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland






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