diff options
author | Release Engineers <releng@openoffice.org> | 2009-08-27 12:02:29 +0000 |
---|---|---|
committer | Release Engineers <releng@openoffice.org> | 2009-08-27 12:02:29 +0000 |
commit | 2d1f08d63942666c0094904f50ba8c512ab69b9d (patch) | |
tree | 7a1b5ead5e309735318d0e393ccb769ec0029d71 /vcl/unx/source/gdi | |
parent | 12d7db51687fa7316f99e3dfcb750bdb8125b05d (diff) |
CWS-TOOLING: integrate CWS otf01
2009-08-26 15:25:19 +0200 hdu r275426 : #i10000# make ubuntu-8.10 buildbot happy
2009-08-21 11:58:07 +0200 hdu r275230 : #i43029# another compile fix for 64bit platforms
2009-08-21 09:00:26 +0200 hdu r275216 : #i43029# sal_Int32 is defined differently on some platforms
2009-08-19 13:41:07 +0200 hdu r275149 : #i43029# fix use of sft-based subsetting in centralized code
2009-08-19 10:42:23 +0200 hdu r275140 : #i43029# --amend previous commit with omitted files
2009-08-19 10:14:54 +0200 hdu r275137 : #i43029# finishing touches for CWS otf01
start to centralize the previously open-coded font-subset/font-embed requests
do the rest when the SCM allows source-file moves and commits with finer granularity
2009-08-17 15:11:24 +0200 hdu r275057 : CWS-TOOLING: rebase CWS otf01 to trunk@275001 (milestone: DEV300:m55)
2009-08-14 17:07:06 +0200 hdu r274998 : #i43029# CFF-subsetting now works on all platforms for PDF-export and PS-printing
2009-08-14 15:13:23 +0200 hdu r274984 : #i43029# OOo-build-baseline allows avoiding brute-forcing codepoint coverage calculation
2009-08-14 14:33:36 +0200 hdu r274981 : #i43029# CmapResult becomes a class
2009-08-13 15:57:55 +0200 hdu r274948 : #i43029# start implementing glue-code for CFF-subsetting on WIN
2009-08-10 17:10:46 +0200 hdu r274828 : #100000# WAE: signedness-warning
2009-08-10 14:08:05 +0200 hdu r274810 : #100000#
2009-08-10 13:34:55 +0200 hdu r274807 : #i43029# update ParseCmap() as we need to handle glyph-mapping ourselves on win for non-sft-supported fonts
2009-07-11 11:32:37 +0200 hdu r273909 : CWS-TOOLING: rebase CWS otf01 to trunk@273858 (milestone: DEV300:m52)
2009-07-03 17:14:55 +0200 hdu r273714 : #i43029# last step before centralizing UNX fontsubset code into platform independent layer
2009-07-03 17:00:14 +0200 hdu r273712 : #i10000# remove compile warning when debug=t
2009-07-03 16:28:29 +0200 hdu r273710 : #i43029# another step to centralize fontsubset code
2009-07-03 15:23:45 +0200 hdu r273705 : #i43029# PDF-export on UNX now starts to support OTF/CFF
2009-07-02 16:19:46 +0200 hdu r273663 : #i43029# warn when subsetting encounters glyph with deprecated SEAC-like endchar
2009-06-25 11:40:55 +0200 hdu r273372 : #i43029# ensure validity of cff-subsetted glyph name
2009-06-24 10:22:13 +0200 hdu r273318 : #i43029# check validity of exported sfnt subtable
2009-06-23 16:25:54 +0200 hdu r273292 : #i43029# use direct CFF->PFA font subsetting
2009-06-23 16:24:33 +0200 hdu r273289 : #i43029# allow font subset directly into a provided FILE handle
2009-06-23 16:22:44 +0200 hdu r273286 : #i43029# implement direct CFF->PFA font subsetting
2009-06-19 17:13:02 +0200 hdu r273171 : #i43029# CFF subsetting starts to work for psprinting
2009-06-18 15:48:42 +0200 hdu r273122 : #i43029# psprint requires explicit control of font subset name
2009-06-18 15:43:21 +0200 hdu r273121 : #i43029# psprint requires explicit control of font subset name
2009-06-16 18:15:43 +0200 hdu r273033 : #i43029# minor reshuffling to prepare CFF->PS font uploading
2009-06-16 16:25:21 +0200 hdu r273025 : #i43029# minimal-invasive change to sft.cxx to access a SFNT's CFF subtable
2009-06-12 15:51:42 +0200 hdu r272925 : #i43029# support OT/CFF subsetting for our PDF export on MacOSX
2009-06-12 15:43:26 +0200 hdu r272924 : #i43029# provide subset metrics as required by subset requesters
2009-05-27 13:58:59 +0200 hdu r272342 : #i43029# TripleInt is already reserved by OSX Carbon
2009-05-27 13:41:12 +0200 hdu r272339 : #i43029# fix warnings and make it compile on different platforms
2009-05-26 18:18:38 +0200 hdu r272315 : #i43029# start moving font subsetting into specialized class
2009-05-26 17:23:55 +0200 hdu r272312 : #i43029# improve name for CFF->PFB subsetted font
2009-05-25 17:12:27 +0200 hdu r272264 : #i43029# PDF-export: get type1-subsetting of the ground
2009-05-25 11:15:39 +0200 hdu r272227 : #i43029# fix BlueValues/FontBBox topdict entries
2009-05-25 10:59:16 +0200 hdu r272222 : #i43029# better PFB-DICT entries for FontBBox and BlueValues
2009-05-25 10:26:46 +0200 hdu r272219 : #i43029# emit other PRIVDICT hints for CFF->PFB subsetting
2009-05-25 10:10:25 +0200 hdu r272218 : #i43029# sign-extend shortint/longint typeopts/dictops
2009-05-25 09:38:33 +0200 hdu r272217 : #i43029# better glyph names for CFF-subsetted PFB
2009-05-20 18:57:11 +0200 hdu r272147 : #i43029# a CFF-subsetter gets the Blues
2009-05-20 14:05:35 +0200 hdu r272127 : #i43029# implement CreateFontSubsetFromCff()
2009-05-18 12:33:05 +0200 hdu r272012 : #i43029# add and use CffSubsetterContext::writeCurveTo()
2009-05-15 11:38:08 +0200 hdu r271931 : CffTable: allow charwidth parameter for type2 endchar operator
2009-05-14 18:55:25 +0200 hdu r271916 : #i43029# implement flex/flex1/hflex/hflex1 typeop conversion, fix type1val writing
2009-05-11 09:53:26 +0200 hdu r271750 : #i101695# improve import of ghostscript-PDF font names
2009-05-07 11:35:12 +0200 hdu r271644 : #i43029# adusted whitespace conventions from previously private code
2009-05-06 12:33:11 +0200 hdu r271579 : #i43029# change copyright header, fix warnings on some compilers
2009-05-06 10:50:50 +0200 hdu r271576 : improve whitespace and constness in some POS code
2009-05-05 16:10:56 +0200 hdu r271532 : #i43029# makefile support for new cff subsetter code
2009-05-05 14:56:29 +0200 hdu r271519 : #i43029# start integrating my CFF->Type1 subsetter code
2009-05-04 17:07:14 +0200 hdu r271474 : #i100140# remove obsoleted tables used for encoding conversion
2009-05-04 17:05:20 +0200 hdu r271473 : #i100140# use generic encoding converters in xlat.cxx
2009-04-15 11:58:25 +0200 hdu r270829 : #i101102# remove build dependency to removed module psprint
2009-04-14 15:57:13 +0200 hdu r270788 : CWS-TOOLING: rebase CWS otf01 to trunk@270723 (milestone: DEV300:m46)
2009-03-11 14:49:56 +0100 hdu r269335 : CWS-TOOLING: rebase CWS otf01 to trunk@269297 (milestone: DEV300:m43)
2009-02-06 12:32:22 +0100 hdu r267451 : resync CWS across CVS->SVN change
2009-02-06 12:32:04 +0100 hdu r267450 : resync CWS across CVS->SVN change
Diffstat (limited to 'vcl/unx/source/gdi')
-rw-r--r-- | vcl/unx/source/gdi/pspgraphics.cxx | 88 | ||||
-rw-r--r-- | vcl/unx/source/gdi/salgdi3.cxx | 42 |
2 files changed, 41 insertions, 89 deletions
diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx index 18a54ef0d770..009b14c56062 100644 --- a/vcl/unx/source/gdi/pspgraphics.cxx +++ b/vcl/unx/source/gdi/pspgraphics.cxx @@ -6,9 +6,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: pspgraphics.cxx,v $ - * $Revision: 1.33 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -40,6 +37,7 @@ #include "vcl/glyphcache.hxx" #include "vcl/impfont.hxx" #include "vcl/outfont.hxx" +#include "vcl/fontsubset.hxx" #include "vcl/svapp.hxx" #include "vcl/salprn.hxx" #include "vcl/sysdata.hxx" @@ -775,16 +773,13 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) ImplFontCharMap* PspGraphics::GetImplFontCharMap() const { // TODO: get ImplFontCharMap directly from fonts - int nPairCount = 0; - if( m_pServerFont[0] ) - nPairCount = m_pServerFont[0]->GetFontCodeRanges( NULL ); - if( !nPairCount ) + if( !m_pServerFont[0] ) return NULL; - sal_uInt32* pCodePairs = new sal_uInt32[ 2 * nPairCount ]; - if( m_pServerFont[0] ) - m_pServerFont[0]->GetFontCodeRanges( pCodePairs ); - return new ImplFontCharMap( nPairCount, pCodePairs ); + CmapResult aCmapResult; + if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) ) + return NULL; + return new ImplFontCharMap( aCmapResult ); } USHORT PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel ) @@ -1016,7 +1011,7 @@ BOOL PspGraphics::CreateFontSubset( sal_Int32* pGlyphIDs, sal_uInt8* pEncoding, sal_Int32* pWidths, - int nGlyphs, + int nGlyphCount, FontSubsetInfo& rInfo ) { @@ -1026,7 +1021,16 @@ BOOL PspGraphics::CreateFontSubset( // which this method was created). The correct way would // be to have the GlyphCache search for the ImplFontData pFont psp::fontID aFont = pFont->GetFontId(); - return PspGraphics::DoCreateFontSubset( rToFile, aFont, pGlyphIDs, pEncoding, pWidths, nGlyphs, rInfo ); + + psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); + bool bSuccess = rMgr.createFontSubset( rInfo, + aFont, + rToFile, + pGlyphIDs, + pEncoding, + pWidths, + nGlyphCount ); + return bSuccess; } //-------------------------------------------------------------------------- @@ -1081,50 +1085,6 @@ void PspGraphics::GetGlyphWidths( const ImplFontData* pFont, // static helpers of PspGraphics -bool PspGraphics::DoCreateFontSubset( const rtl::OUString& rToFile, - psp::fontID aFont, - sal_Int32* pGlyphIDs, - sal_uInt8* pEncoding, - sal_Int32* pWidths, - int nGlyphs, - FontSubsetInfo& rInfo ) -{ - psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); - psp::PrintFontInfo aFontInfo; - - if( ! rMgr.getFontInfo( aFont, aFontInfo ) ) - return false; - - // fill in font info - switch( aFontInfo.m_eType ) - { - case psp::fonttype::TrueType: rInfo.m_nFontType = SAL_FONTSUBSETINFO_TYPE_TRUETYPE;break; - case psp::fonttype::Type1: rInfo.m_nFontType = SAL_FONTSUBSETINFO_TYPE_TYPE1;break; - default: - return false; - } - rInfo.m_nAscent = aFontInfo.m_nAscend; - rInfo.m_nDescent = aFontInfo.m_nDescend; - rInfo.m_aPSName = rMgr.getPSName( aFont ); - - int xMin, yMin, xMax, yMax; - rMgr.getFontBoundingBox( aFont, xMin, yMin, xMax, yMax ); - - if( ! rMgr.createFontSubset( aFont, - rToFile, - pGlyphIDs, - pEncoding, - pWidths, - nGlyphs - ) ) - return false; - - rInfo.m_aFontBBox = Rectangle( Point( xMin, yMin ), Size( xMax-xMin, yMax-yMin ) ); - rInfo.m_nCapHeight = yMax; // Well ... - - return true; -} - const void* PspGraphics::DoGetEmbedFontData( fontID aFont, const sal_Ucs* pUnicodes, sal_Int32* pWidths, FontSubsetInfo& rInfo, long* pDataLen ) { psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); @@ -1136,8 +1096,8 @@ const void* PspGraphics::DoGetEmbedFontData( fontID aFont, const sal_Ucs* pUnico // fill in font info switch( aFontInfo.m_eType ) { - case psp::fonttype::TrueType: rInfo.m_nFontType = SAL_FONTSUBSETINFO_TYPE_TRUETYPE;break; - case psp::fonttype::Type1: rInfo.m_nFontType = SAL_FONTSUBSETINFO_TYPE_TYPE1;break; + case psp::fonttype::TrueType: rInfo.m_nFontType = FontSubsetInfo::SFNT_TTF; break; + case psp::fonttype::Type1: rInfo.m_nFontType = FontSubsetInfo::ANY_TYPE1; break; default: return NULL; } @@ -1315,6 +1275,8 @@ ImplDevFontAttributes PspGraphics::Info2DevFontAttributes( const psp::FastPrintF aDFA.meWidthType = ToFontWidth (rInfo.m_eWidth); aDFA.mePitch = ToFontPitch (rInfo.m_ePitch); aDFA.mbSymbolFlag = (rInfo.m_aEncoding == RTL_TEXTENCODING_SYMBOL); + aDFA.mbSubsettable = rInfo.m_bSubsettable; + aDFA.mbEmbeddable = rInfo.m_bEmbeddable; switch (rInfo.m_eEmbeddedbitmap) { @@ -1347,26 +1309,18 @@ ImplDevFontAttributes PspGraphics::Info2DevFontAttributes( const psp::FastPrintF case psp::fonttype::Builtin: aDFA.mnQuality = 1024; aDFA.mbDevice = true; - aDFA.mbSubsettable = false; - aDFA.mbEmbeddable = false; break; case psp::fonttype::TrueType: aDFA.mnQuality = 512; aDFA.mbDevice = false; - aDFA.mbSubsettable = true; - aDFA.mbEmbeddable = false; break; case psp::fonttype::Type1: aDFA.mnQuality = 0; aDFA.mbDevice = false; - aDFA.mbSubsettable = false; - aDFA.mbEmbeddable = true; break; default: aDFA.mnQuality = 0; aDFA.mbDevice = false; - aDFA.mbSubsettable = false; - aDFA.mbEmbeddable = false; break; } diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index 0ee0e0bb20c8..5d6cd464376a 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -6,9 +6,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: salgdi3.cxx,v $ - * $Revision: 1.157.12.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -1455,21 +1452,17 @@ void X11SalGraphics::DrawStringUCS2MB( ExtendedFontStruct& rFont, ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const { // TODO: get ImplFontCharMap directly from fonts - int nPairCount = 0; - if( mpServerFont[0] ) - nPairCount = mpServerFont[0]->GetFontCodeRanges( NULL ); - else if( mXFont[0] ) - nPairCount = mXFont[0]->GetFontCodeRanges( NULL ); - - if( !nPairCount ) + if( !mpServerFont[0] ) +#if 0 // RIP XLFD fonts + if( mXFont[0] ) + // TODO?: nPairCount = mXFont[0]->GetFontCodeRanges( NULL ); +#endif return NULL; - sal_uInt32* pCodePairs = new sal_uInt32[ 2 * nPairCount ]; - if( mpServerFont[0] ) - mpServerFont[0]->GetFontCodeRanges( pCodePairs ); - else if( mXFont[0] ) - mXFont[0]->GetFontCodeRanges( pCodePairs ); - return new ImplFontCharMap( nPairCount, pCodePairs ); + CmapResult aCmapResult; + if( !mpServerFont[0]->GetFontCodeRanges( aCmapResult ) ) + return NULL; + return new ImplFontCharMap( aCmapResult ); } // ---------------------------------------------------------------------------- @@ -1750,21 +1743,26 @@ BOOL X11SalGraphics::CreateFontSubset( sal_Int32* pGlyphIDs, sal_uInt8* pEncoding, sal_Int32* pWidths, - int nGlyphs, + int nGlyphCount, FontSubsetInfo& rInfo ) { -#ifndef _USE_PRINT_EXTENSION_ // in this context the pFont->GetFontId() is a valid PSP // font since they are the only ones left after the PDF // export has filtered its list of subsettable fonts (for // which this method was created). The correct way would // be to have the GlyphCache search for the ImplFontData pFont psp::fontID aFont = pFont->GetFontId(); - return PspGraphics::DoCreateFontSubset( rToFile, aFont, pGlyphIDs, pEncoding, pWidths, nGlyphs, rInfo ); -#else - return FALSE; -#endif + + psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); + bool bSuccess = rMgr.createFontSubset( rInfo, + aFont, + rToFile, + pGlyphIDs, + pEncoding, + pWidths, + nGlyphCount ); + return bSuccess; } //-------------------------------------------------------------------------- |