diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-03-07 18:37:30 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-03-08 13:35:26 +0100 |
commit | 5c1c0a4eef933816685364feef93dfb090ff391d (patch) | |
tree | d7e25370a5f3fc9fbc7d543be34eb51b73eb84dd /vcl/inc | |
parent | fix WAE mbError unused (diff) | |
download | core-5c1c0a4eef933816685364feef93dfb090ff391d.tar.gz core-5c1c0a4eef933816685364feef93dfb090ff391d.zip |
function for duplicated code
Change-Id: If9d6a163abb5a1cbd64838ca005b14dcd51c4588
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/vcl/embeddedfontshelper.hxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vcl/inc/vcl/embeddedfontshelper.hxx b/vcl/inc/vcl/embeddedfontshelper.hxx index ac4778620361..e5aead64c7bd 100644 --- a/vcl/inc/vcl/embeddedfontshelper.hxx +++ b/vcl/inc/vcl/embeddedfontshelper.hxx @@ -12,8 +12,11 @@ #include <vcl/dllapi.h> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/uno/Reference.hxx> #include <rtl/ustring.hxx> #include <tools/fontenum.hxx> +#include <vector> /** Helper functions for handling embedded fonts in documents. @@ -27,6 +30,18 @@ public: */ static OUString fontFileUrl( const OUString& familyName, FontFamily family, FontItalic italic, FontWeight weight, FontPitch pitch, rtl_TextEncoding encoding ); + + /** + Reads a font from the input stream, saves it to a temporary font file and activates the font. + @param stream stream of font data + @param fontName name of the font (e.g. 'Times New Roman') + @param extra additional text to use for name (e.g. to distinguish regular from bold, italic,...), "?" for unique + @param key key to xor the data with, from the start until the key's length (not repeated) + */ + static bool addEmbeddedFont( com::sun::star::uno::Reference< com::sun::star::io::XInputStream > stream, + const OUString& fontName, const char* extra, + std::vector< unsigned char > key = std::vector< unsigned char >()); + /** Returns an URL for a file where to store contents of a given temporary font. The file may or not may not exist yet, and will be cleaned up automatically as appropriate. |