diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-03-07 19:45:49 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-03-08 13:35:27 +0100 |
commit | e2cd75f005dd5bf57336f39abd8820ecac0b048e (patch) | |
tree | 429e024b52781adc38817f4039c833b12d340cf4 /vcl/inc | |
parent | 8fcc60bee755b812489ef652ab2fa779babddeac (diff) |
embed also view-only fonts, but do not use them
MSO embeds even fonts which allow only embedding for viewing the document
but not editing it. So embed such fonts too, but do not actually use
them from the document. What MSO does when such a font is not present
locally when opening the document is switching to read-only mode,
warning about this and providing a button for switching to editing mode
by dumping the font(s). That should be done for LO too, but right now
dropping view-only fonts is better than using them for editing.
Change-Id: I19c28fadb091e6b21beaf4cbf8b47e3078256d1c
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/vcl/embeddedfontshelper.hxx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/vcl/inc/vcl/embeddedfontshelper.hxx b/vcl/inc/vcl/embeddedfontshelper.hxx index e5aead64c7bd..0b66e8ab157a 100644 --- a/vcl/inc/vcl/embeddedfontshelper.hxx +++ b/vcl/inc/vcl/embeddedfontshelper.hxx @@ -25,11 +25,18 @@ class VCL_DLLPUBLIC EmbeddedFontsHelper { public: + /// Specification of what kind of operation is allowed when embedding a font + enum FontRights + { + ViewingAllowed, ///< Font may be embedded for viewing the document (but not editing) + EditingAllowed ///< Font may be embedded for editing document (implies viewing) + }; + /** Returns URL for a font file for the given font, or empty if it does not exist. */ static OUString fontFileUrl( const OUString& familyName, FontFamily family, FontItalic italic, - FontWeight weight, FontPitch pitch, rtl_TextEncoding encoding ); + FontWeight weight, FontPitch pitch, rtl_TextEncoding encoding, FontRights rights ); /** Reads a font from the input stream, saves it to a temporary font file and activates the font. @@ -62,6 +69,15 @@ public: static void activateFont( const OUString& fontName, const OUString& fileUrl ); /** + Returns if the restrictions specified in the font (if present) allow embedding + the font for a particular purpose. + @param data font data + @param size size of the font data + @param rights type of operation to be allowed for the font + */ + static bool sufficientFontRights( const void* data, long size, FontRights rights ); + + /** Removes all temporary fonts in the path used by fileUrlForTemporaryFont(). @internal */ |