diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-03-07 20:08:22 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-03-08 13:35:27 +0100 |
commit | e99d502df6561949fe34af42c7910d24455d3ba6 (patch) | |
tree | e0f86035498cd0b852c47e3e3328c74d64816ea1 | |
parent | 8da3cfcde0631a74d0446ce751c32ce8c895dc8b (diff) |
fix handling of ttf embedding restrictions
Font is usable for viewing if not restricted from embedding completely
(since otherwise either viewing is allowed or a less restrictive setting
is present). Font is usable for editing if it's installable or editable.
Change-Id: I57604a54390b935bae3699dda581d1093fc245e3
-rw-r--r-- | vcl/source/gdi/embeddedfontshelper.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/vcl/source/gdi/embeddedfontshelper.cxx b/vcl/source/gdi/embeddedfontshelper.cxx index eedab37098aa..a147ea3a419c 100644 --- a/vcl/source/gdi/embeddedfontshelper.cxx +++ b/vcl/source/gdi/embeddedfontshelper.cxx @@ -146,17 +146,15 @@ bool EmbeddedFontsHelper::sufficientFontRights( const void* data, long size, Fon GetTTGlobalFontInfo( font, &info ); CloseTTFont( font ); // http://www.microsoft.com/typography/tt/ttf_spec/ttch02.doc - // font embedding is allowed if either - // no restriction at all (bit 1 clear) - // viewing allowed (bit 1 set, bit 2 set) - // editting allowed (bit 1 set, bit 3 set) int copyright = info.typeFlags & TYPEFLAG_COPYRIGHT_MASK; switch( rights ) { case ViewingAllowed: - return ( copyright & 0x02 ) == 0 || ( copyright & 0x04 ) || ( copyright & 0x08 ); + // Embedding not restricted completely. + return ( copyright & 0x02 ) != 0x02; case EditingAllowed: - return ( copyright & 0x02 ) == 0 || ( copyright & 0x08 ); + // Font is installable or editable. + return copyright == 0 || ( copyright & 0x08 ); } } return true; // no known restriction |