Kaydet (Commit) 8da3cfcd authored tarafından Luboš Luňák's avatar Luboš Luňák

editable ttf fonts are usable for print&preview too

Since it's a less restrictive setting (fonts should usually have both
bits set though).

Change-Id: I83f740762698bd0a0f8fdee388a6e710cfd9d00a
üst e2cd75f0
......@@ -2431,7 +2431,7 @@ const ::std::list< KernPair >& PrintFontManager::getKernPairs( fontID nFontID, b
// -------------------------------------------------------------------------
bool PrintFontManager::isFontDownloadingAllowed( fontID nFont ) const
bool PrintFontManager::isFontDownloadingAllowedForPrinting( fontID nFont ) const
{
static const char* pEnable = getenv( "PSPRINT_ENABLE_TTF_COPYRIGHTAWARENESS" );
bool bRet = true;
......@@ -2458,10 +2458,10 @@ bool PrintFontManager::isFontDownloadingAllowed( fontID nFont ) const
unsigned int nCopyrightFlags = pTTFontFile->m_nTypeFlags & TYPEFLAG_COPYRIGHT_MASK;
// font embedding is allowed if either
// no restriction at all (bit 1 clear)
// printing allowed (bit 1 set, bit 2 set )
bRet = ! ( nCopyrightFlags & 0x02 ) || ( nCopyrightFlags & 0x04 );
// http://www.microsoft.com/typography/tt/ttf_spec/ttch02.doc
// Font embedding is allowed if not restricted completely (only bit 1 set).
// Preview&Print (bit 2), Editable (bit 3) or Installable (==0) fonts are ok.
bRet = ( nCopyrightFlags & 0x02 ) != 0x02;
}
}
return bRet;
......
......@@ -169,7 +169,7 @@ void PrinterGfx::DrawGlyphs(
if( nLen <= 0 )
return;
if ( !mrFontMgr.isFontDownloadingAllowed( mnFontID ) )
if ( !mrFontMgr.isFontDownloadingAllowedForPrinting( mnFontID ) )
{
LicenseWarning(rPoint, pUnicodes, nLen, pDeltaArray);
return;
......@@ -569,7 +569,7 @@ PrinterGfx::drawText(
PSUploadPS1Font (mnFontID);
if ( eType == fonttype::TrueType
&& !mrFontMgr.isFontDownloadingAllowed(mnFontID))
&& !mrFontMgr.isFontDownloadingAllowedForPrinting(mnFontID))
{
LicenseWarning(rPoint, pStr, nLen, pDeltaArray);
return;
......
......@@ -479,10 +479,10 @@ public:
// getKernPairs method of PrinterGfx
const std::list< KernPair >& getKernPairs( fontID nFontID, bool bVertical = false ) const;
// evaluates copyright flags for TrueType fonts
// evaluates copyright flags for TrueType fonts for printing/viewing
// type1 fonts do not have such a feature, so return for them is true
// returns true for builtin fonts (surprise!)
bool isFontDownloadingAllowed( fontID nFont ) const;
bool isFontDownloadingAllowedForPrinting( fontID nFont ) const;
// helper for type 1 fonts
std::list< rtl::OString > getAdobeNameFromUnicode( sal_Unicode aChar ) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment