Files
libreoffice/vcl/source/gdi/outdev3.cxx

8101 lines
284 KiB
C++
Raw Normal View History

2000-09-18 16:07:07 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 16:07:07 +00:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 16:07:07 +00:00
*
* This file is part of OpenOffice.org.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
2000-09-18 16:07:07 +00:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2000-09-18 16:07:07 +00:00
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
2002-04-23 06:40:42 +00:00
#include "i18npool/mslangid.hxx"
#include "svsys.h"
#include "vcl/salgdi.hxx"
#include "vcl/sallayout.hxx"
#include "rtl/tencinfo.h"
#include "tools/debug.hxx"
#include "vcl/svdata.hxx"
#include "vcl/metric.hxx"
#include "vcl/impfont.hxx"
#include "vcl/metaact.hxx"
#include "vcl/gdimtf.hxx"
#include "vcl/outdata.hxx"
#include "vcl/outfont.hxx"
#include "basegfx/polygon/b2dpolygon.hxx"
#include "basegfx/polygon/b2dpolypolygon.hxx"
#include "basegfx/matrix/b2dhommatrix.hxx"
#include "tools/poly.hxx"
#include "vcl/outdev.h"
#include "vcl/virdev.hxx"
#include "vcl/print.hxx"
#include "vcl/event.hxx"
#include "vcl/window.h"
#include "vcl/window.hxx"
#include "vcl/svapp.hxx"
#include "vcl/bmpacc.hxx"
#include "unotools/fontcvt.hxx"
#include "vcl/outdev.hxx"
#include "vcl/edit.hxx"
#include "unotools/fontcfg.hxx"
#include "vcl/sysdata.hxx"
#include "vcl/textlayout.hxx"
#include "vcl/svids.hrc"
#include "osl/file.h"
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
#ifdef ENABLE_GRAPHITE
#include "vcl/graphite_features.hxx"
#endif
#include "vcl/glyphcache.hxx"
2000-09-18 16:07:07 +00:00
#include "vcl/unohelp.hxx"
#include "pdfwriter_impl.hxx"
#include "vcl/controllayout.hxx"
#include "rtl/logfile.hxx"
#include "com/sun/star/beans/PropertyValues.hpp"
#include "com/sun/star/i18n/XBreakIterator.hpp"
#include "com/sun/star/i18n/WordType.hpp"
#include "com/sun/star/linguistic2/XLinguServiceManager.hpp"
2000-09-18 16:07:07 +00:00
#if defined UNX
#define GLYPH_FONT_HEIGHT 128
#elif defined OS2
#define GLYPH_FONT_HEIGHT 176
#else
#define GLYPH_FONT_HEIGHT 256
#endif
#include "sal/alloca.h"
#include <cmath>
#include <cstring>
2002-08-15 10:17:51 +00:00
#include <memory>
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
#include <algorithm>
2002-08-15 10:17:51 +00:00
2000-09-18 16:07:07 +00:00
// =======================================================================
DBG_NAMEEX( OutputDevice )
DBG_NAMEEX( Font )
2000-09-18 16:07:07 +00:00
// =======================================================================
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
2000-09-18 16:07:07 +00:00
using namespace ::rtl;
using namespace ::vcl;
using namespace ::utl;
2000-09-18 16:07:07 +00:00
// =======================================================================
#define TEXT_DRAW_ELLIPSIS (TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_PATHELLIPSIS | TEXT_DRAW_NEWSELLIPSIS)
// =======================================================================
#define UNDERLINE_LAST UNDERLINE_BOLDWAVE
#define STRIKEOUT_LAST STRIKEOUT_X
// =======================================================================
static void ImplRotatePos( long nOriginX, long nOriginY, long& rX, long& rY,
int nOrientation )
{
if ( (nOrientation >= 0) && !(nOrientation % 900) )
{
if ( (nOrientation >= 3600) )
nOrientation %= 3600;
if ( nOrientation )
{
rX -= nOriginX;
rY -= nOriginY;
if ( nOrientation == 900 )
{
long nTemp = rX;
rX = rY;
rY = -nTemp;
}
else if ( nOrientation == 1800 )
{
rX = -rX;
rY = -rY;
}
else /* ( nOrientation == 2700 ) */
{
long nTemp = rX;
rX = -rY;
rY = nTemp;
}
rX += nOriginX;
rY += nOriginY;
}
}
else
{
double nRealOrientation = nOrientation*F_PI1800;
double nCos = cos( nRealOrientation );
double nSin = sin( nRealOrientation );
// Translation...
long nX = rX-nOriginX;
long nY = rY-nOriginY;
// Rotation...
rX = +((long)(nCos*nX + nSin*nY)) + nOriginX;
rY = -((long)(nSin*nX - nCos*nY)) + nOriginY;
}
}
2000-09-18 16:07:07 +00:00
// =======================================================================
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
void OutputDevice::ImplUpdateFontData( bool bNewFontLists )
2000-09-18 16:07:07 +00:00
{
// the currently selected logical font is no longer needed
2000-09-18 16:07:07 +00:00
if ( mpFontEntry )
{
mpFontCache->Release( mpFontEntry );
mpFontEntry = NULL;
}
mbInitFont = true;
mbNewFont = true;
2000-09-18 16:07:07 +00:00
if ( bNewFontLists )
{
if ( mpGetDevFontList )
{
delete mpGetDevFontList;
mpGetDevFontList = NULL;
}
if ( mpGetDevSizeList )
{
delete mpGetDevSizeList;
mpGetDevSizeList = NULL;
}
// release all physically selected fonts on this device
if( ImplGetGraphics() )
mpGraphics->ReleaseFonts();
2000-09-18 16:07:07 +00:00
}
2002-07-15 11:04:39 +00:00
if ( GetOutDevType() == OUTDEV_PRINTER || mpPDFWriter )
2000-09-18 16:07:07 +00:00
{
2002-07-15 11:04:39 +00:00
ImplSVData* pSVData = ImplGetSVData();
if( mpFontCache && mpFontCache != pSVData->maGDIData.mpScreenFontCache )
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mpFontCache->Invalidate();
2000-09-18 16:07:07 +00:00
if ( bNewFontLists )
{
// we need a graphics
if ( ImplGetGraphics() )
{
2002-07-15 11:04:39 +00:00
if( mpFontList && mpFontList != pSVData->maGDIData.mpScreenFontList )
mpFontList->Clear();
if( mpPDFWriter )
{
2002-07-20 14:54:30 +00:00
if( mpFontList && mpFontList != pSVData->maGDIData.mpScreenFontList )
2002-07-15 11:04:39 +00:00
delete mpFontList;
2002-07-20 14:54:30 +00:00
if( mpFontCache && mpFontCache != pSVData->maGDIData.mpScreenFontCache )
delete mpFontCache;
2002-07-15 11:04:39 +00:00
mpFontList = mpPDFWriter->filterDevFontList( pSVData->maGDIData.mpScreenFontList );
2002-07-20 14:54:30 +00:00
mpFontCache = new ImplFontCache( FALSE );
2002-07-15 11:04:39 +00:00
}
else
{
if( mpOutDevData )
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
mpOutDevData->maDevFontSubst.Clear();
2002-07-15 11:04:39 +00:00
mpGraphics->GetDevFontList( mpFontList );
mpGraphics->GetDevFontSubstList( this );
}
2000-09-18 16:07:07 +00:00
}
}
}
// also update child windows if needed
2000-09-18 16:07:07 +00:00
if ( GetOutDevType() == OUTDEV_WINDOW )
{
Window* pChild = ((Window*)this)->mpWindowImpl->mpFirstChild;
2000-09-18 16:07:07 +00:00
while ( pChild )
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
pChild->ImplUpdateFontData( true );
pChild = pChild->mpWindowImpl->mpNext;
2000-09-18 16:07:07 +00:00
}
}
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
void OutputDevice::ImplUpdateAllFontData( bool bNewFontLists )
2000-09-18 16:07:07 +00:00
{
ImplSVData* pSVData = ImplGetSVData();
// update all windows
2000-09-18 16:07:07 +00:00
Window* pFrame = pSVData->maWinData.mpFirstFrame;
while ( pFrame )
{
pFrame->ImplUpdateFontData( bNewFontLists );
Window* pSysWin = pFrame->mpWindowImpl->mpFrameData->mpFirstOverlap;
2000-09-18 16:07:07 +00:00
while ( pSysWin )
{
pSysWin->ImplUpdateFontData( bNewFontLists );
pSysWin = pSysWin->mpWindowImpl->mpNextOverlap;
2000-09-18 16:07:07 +00:00
}
pFrame = pFrame->mpWindowImpl->mpFrameData->mpNextFrame;
2000-09-18 16:07:07 +00:00
}
// update all virtual devices
2000-09-18 16:07:07 +00:00
VirtualDevice* pVirDev = pSVData->maGDIData.mpFirstVirDev;
while ( pVirDev )
{
pVirDev->ImplUpdateFontData( bNewFontLists );
pVirDev = pVirDev->mpNext;
}
// update all printers
2000-09-18 16:07:07 +00:00
Printer* pPrinter = pSVData->maGDIData.mpFirstPrinter;
while ( pPrinter )
{
pPrinter->ImplUpdateFontData( bNewFontLists );
pPrinter = pPrinter->mpNext;
}
// clear global font lists to have them updated
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
pSVData->maGDIData.mpScreenFontCache->Invalidate();
2000-09-18 16:07:07 +00:00
if ( bNewFontLists )
{
pSVData->maGDIData.mpScreenFontList->Clear();
pFrame = pSVData->maWinData.mpFirstFrame;
if ( pFrame )
{
if ( pFrame->ImplGetGraphics() )
// MT: Stupid typecast here and somewhere ((OutputDevice*)&aVDev)->, because bug in .NET2002 compiler.
((OutputDevice*)pFrame)->mpGraphics->GetDevFontList( pFrame->mpWindowImpl->mpFrameData->mpFontList );
2000-09-18 16:07:07 +00:00
}
}
}
// =======================================================================
// =======================================================================
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
// TODO: remove this method when the CWS-gfbfcfg dust has settled
2000-09-18 16:07:07 +00:00
void ImplFreeOutDevFontData()
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
{}
2000-09-18 16:07:07 +00:00
// =======================================================================
void OutputDevice::BeginFontSubstitution()
{
ImplSVData* pSVData = ImplGetSVData();
pSVData->maGDIData.mbFontSubChanged = FALSE;
}
// -----------------------------------------------------------------------
void OutputDevice::EndFontSubstitution()
{
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->maGDIData.mbFontSubChanged )
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplUpdateAllFontData( false );
2000-09-18 16:07:07 +00:00
Application* pApp = GetpApp();
DataChangedEvent aDCEvt( DATACHANGED_FONTSUBSTITUTION );
pApp->DataChanged( aDCEvt );
pApp->NotifyAllWindows( aDCEvt );
pSVData->maGDIData.mbFontSubChanged = FALSE;
}
}
// -----------------------------------------------------------------------
void OutputDevice::AddFontSubstitute( const XubString& rFontName,
const XubString& rReplaceFontName,
USHORT nFlags )
{
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
ImplDirectFontSubstitution*& rpSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
if( !rpSubst )
rpSubst = new ImplDirectFontSubstitution();
rpSubst->AddFontSubstitute( rFontName, rReplaceFontName, nFlags );
ImplGetSVData()->maGDIData.mbFontSubChanged = TRUE;
}
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
void ImplDirectFontSubstitution::AddFontSubstitute( const String& rFontName,
const String& rSubstFontName, USHORT nFlags )
{
maFontSubstList.push_back( ImplFontSubstEntry( rFontName, rSubstFontName, nFlags ) );
}
// -----------------------------------------------------------------------
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
ImplFontSubstEntry::ImplFontSubstEntry( const String& rFontName,
const String& rSubstFontName, USHORT nSubstFlags )
: maName( rFontName )
, maReplaceName( rSubstFontName )
, mnFlags( nSubstFlags )
{
maSearchName = rFontName;
maSearchReplaceName = rSubstFontName;
GetEnglishSearchFontName( maSearchName );
GetEnglishSearchFontName( maSearchReplaceName );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void OutputDevice::ImplAddDevFontSubstitute( const XubString& rFontName,
const XubString& rReplaceFontName,
USHORT nFlags )
{
ImplInitOutDevData();
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
mpOutDevData->maDevFontSubst.AddFontSubstitute( rFontName, rReplaceFontName, nFlags );
}
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
void OutputDevice::RemoveFontSubstitute( USHORT n )
{
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
ImplDirectFontSubstitution* pSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
if( pSubst )
pSubst->RemoveFontSubstitute( n );
}
2002-04-23 06:40:42 +00:00
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
void ImplDirectFontSubstitution::RemoveFontSubstitute( int nIndex )
{
FontSubstList::iterator it = maFontSubstList.begin();
2008-10-10 13:02:43 +00:00
for( int nCount = 0; (it != maFontSubstList.end()) && (nCount++ != nIndex); ++it ) ;
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
if( it != maFontSubstList.end() )
maFontSubstList.erase( it );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
USHORT OutputDevice::GetFontSubstituteCount()
{
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
const ImplDirectFontSubstitution* pSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
if( !pSubst )
return 0;
int nCount = pSubst->GetFontSubstituteCount();
return (USHORT)nCount;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void OutputDevice::GetFontSubstitute( USHORT n,
XubString& rFontName,
XubString& rReplaceFontName,
USHORT& rFlags )
{
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
const ImplDirectFontSubstitution* pSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
if( pSubst )
pSubst->GetFontSubstitute( n, rFontName, rReplaceFontName, rFlags );
}
// -----------------------------------------------------------------------
bool ImplDirectFontSubstitution::GetFontSubstitute( int nIndex,
String& rFontName, String& rSubstFontName, USHORT& rFlags ) const
{
FontSubstList::const_iterator it = maFontSubstList.begin();
2008-10-10 13:02:43 +00:00
for( int nCount = 0; (it != maFontSubstList.end()) && (nCount++ != nIndex); ++it ) ;
if( it == maFontSubstList.end() )
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
return false;
const ImplFontSubstEntry* pEntry = &(*it);
rFontName = pEntry->maName;
rSubstFontName = pEntry->maReplaceName;
rFlags = pEntry->mnFlags;
return true;
}
// -----------------------------------------------------------------------
bool ImplDirectFontSubstitution::FindFontSubstitute( String& rSubstName,
const String& rSearchName, USHORT nFlags ) const
{
// TODO: get rid of O(N) searches
FontSubstList::const_iterator it = maFontSubstList.begin();
for(; it != maFontSubstList.end(); ++it )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
const ImplFontSubstEntry& rEntry = *it;
if( ((rEntry.mnFlags & nFlags) || !nFlags)
&& (rEntry.maSearchName == rSearchName) )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
rSubstName = rEntry.maSearchReplaceName;
return true;
2000-09-18 16:07:07 +00:00
}
}
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
return false;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
static void ImplFontSubstitute( String& rFontName,
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
USHORT nFlags, ImplDirectFontSubstitution* pDevSpecific )
2000-09-18 16:07:07 +00:00
{
#ifdef DBG_UTIL
String aTempName = rFontName;
GetEnglishSearchFontName( aTempName );
DBG_ASSERT( aTempName == rFontName, "ImplFontSubstitute() called without a searchname" );
#endif
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
String aSubstFontName;
// apply user-configurable font replacement (eg, from the list in Tools->Options)
const ImplDirectFontSubstitution* pSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
if( pSubst && pSubst->FindFontSubstitute( aSubstFontName, rFontName, FONT_SUBSTITUTE_ALWAYS ) )
{
rFontName = aSubstFontName;
return;
2000-09-18 16:07:07 +00:00
}
// apply device specific font replacement (e.g. to use printer builtin fonts)
if( !pDevSpecific )
return;
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
if( pDevSpecific->FindFontSubstitute( aSubstFontName, rFontName, nFlags ) )
{
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
rFontName = aSubstFontName;
return;
}
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
Font OutputDevice::GetDefaultFont( USHORT nType, LanguageType eLang,
2001-07-06 15:01:44 +00:00
ULONG nFlags, const OutputDevice* pOutDev )
{
DBG_TRACE( "OutputDevice::GetDefaultFont()" );
com::sun::star::lang::Locale aLocale;
if( eLang == LANGUAGE_NONE || eLang == LANGUAGE_SYSTEM || eLang == LANGUAGE_DONTKNOW )
{
aLocale = Application::GetSettings().GetUILocale();
}
else
{
MsLangId::convertLanguageToLocale( eLang, aLocale );
}
utl::DefaultFontConfiguration& rDefaults = *utl::DefaultFontConfiguration::get();
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
String aSearch = rDefaults.getUserInterfaceFont( aLocale ); // ensure a fallback
String aDefault = rDefaults.getDefaultFont( aLocale, nType );
if( aDefault.Len() )
aSearch = aDefault;
int nDefaultHeight = 12;
Font aFont;
aFont.SetPitch( PITCH_VARIABLE );
switch ( nType )
{
case DEFAULTFONT_SANS_UNICODE:
case DEFAULTFONT_UI_SANS:
aFont.SetFamily( FAMILY_SWISS );
break;
case DEFAULTFONT_SANS:
case DEFAULTFONT_LATIN_HEADING:
case DEFAULTFONT_LATIN_SPREADSHEET:
case DEFAULTFONT_LATIN_DISPLAY:
aFont.SetFamily( FAMILY_SWISS );
break;
case DEFAULTFONT_SERIF:
case DEFAULTFONT_LATIN_TEXT:
case DEFAULTFONT_LATIN_PRESENTATION:
aFont.SetFamily( FAMILY_ROMAN );
break;
case DEFAULTFONT_FIXED:
case DEFAULTFONT_LATIN_FIXED:
case DEFAULTFONT_UI_FIXED:
aFont.SetPitch( PITCH_FIXED );
aFont.SetFamily( FAMILY_MODERN );
break;
case DEFAULTFONT_SYMBOL:
aFont.SetCharSet( RTL_TEXTENCODING_SYMBOL );
break;
case DEFAULTFONT_CJK_TEXT:
case DEFAULTFONT_CJK_PRESENTATION:
case DEFAULTFONT_CJK_SPREADSHEET:
case DEFAULTFONT_CJK_HEADING:
case DEFAULTFONT_CJK_DISPLAY:
aFont.SetFamily( FAMILY_SYSTEM ); // don't care, but don't use font subst config later...
break;
case DEFAULTFONT_CTL_TEXT:
case DEFAULTFONT_CTL_PRESENTATION:
case DEFAULTFONT_CTL_SPREADSHEET:
case DEFAULTFONT_CTL_HEADING:
case DEFAULTFONT_CTL_DISPLAY:
aFont.SetFamily( FAMILY_SYSTEM ); // don't care, but don't use font subst config later...
break;
}
if ( aSearch.Len() )
{
aFont.SetHeight( nDefaultHeight );
aFont.SetWeight( WEIGHT_NORMAL );
aFont.SetLanguage( eLang );
if ( aFont.GetCharSet() == RTL_TEXTENCODING_DONTKNOW )
aFont.SetCharSet( gsl_getSystemTextEncoding() );
// Should we only return available fonts on the given device
if ( pOutDev )
{
pOutDev->ImplInitFontList();
// Search Font in the FontList
String aName;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
String aSearchName;
xub_StrLen nIndex = 0;
do
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
aSearchName = GetNextFontToken( aSearch, nIndex );
GetEnglishSearchFontName( aSearchName );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplDevFontListData* pFontFamily = pOutDev->mpFontList->ImplFindBySearchName( aSearchName );
if( pFontFamily )
{
AddTokenFontName( aName, pFontFamily->GetFamilyName() );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( nFlags & DEFAULTFONT_FLAGS_ONLYONE )
break;
}
}
while ( nIndex != STRING_NOTFOUND );
aFont.SetName( aName );
}
// No Name, than set all names
if ( !aFont.GetName().Len() )
{
xub_StrLen nIndex = 0;
if ( nFlags & DEFAULTFONT_FLAGS_ONLYONE )
{
//aFont.SetName( aSearch.GetToken( 0, ';', nIndex ) );
if( !pOutDev )
pOutDev = (const OutputDevice *)ImplGetSVData()->mpDefaultWin;
if( !pOutDev )
aFont.SetName( aSearch.GetToken( 0, ';', nIndex ) );
else
{
pOutDev->ImplInitFontList();
aFont.SetName( aSearch );
// convert to pixel height
Size aSize = pOutDev->ImplLogicToDevicePixel( aFont.GetSize() );
if ( !aSize.Height() )
{
// use default pixel height only when logical height is zero
if ( aFont.GetHeight() )
aSize.Height() = 1;
else
aSize.Height() = (12*pOutDev->mnDPIY)/72;
}
// use default width only when logical width is zero
if( (0 == aSize.Width()) && (0 != aFont.GetSize().Width()) )
aSize.Width() = 1;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// get the name of the first available font
float fExactHeight = static_cast<float>(aSize.Height());
ImplFontEntry* pEntry = pOutDev->mpFontCache->GetFontEntry( pOutDev->mpFontList, aFont, aSize, fExactHeight, pOutDev->mpOutDevData ? &pOutDev->mpOutDevData->maDevFontSubst : NULL );
if( pEntry->maFontSelData.mpFontData )
aFont.SetName( pEntry->maFontSelData.mpFontData->maName );
else
aFont.SetName( pEntry->maFontSelData.maTargetName );
}
}
else
aFont.SetName( aSearch );
}
}
#if OSL_DEBUG_LEVEL > 2
const char* s = "DEFAULTFONT_SANS_UNKNOWN";
switch ( nType )
{
case DEFAULTFONT_SANS_UNICODE: s = "DEFAULTFONT_SANS_UNICODE"; break;
case DEFAULTFONT_UI_SANS: s = "DEFAULTFONT_UI_SANS"; break;
case DEFAULTFONT_SANS: s = "DEFAULTFONT_SANS"; break;
case DEFAULTFONT_LATIN_HEADING: s = "DEFAULTFONT_LATIN_HEADING"; break;
case DEFAULTFONT_LATIN_SPREADSHEET: s = "DEFAULTFONT_LATIN_SPREADSHEET"; break;
case DEFAULTFONT_LATIN_DISPLAY: s = "DEFAULTFONT_LATIN_DISPLAY"; break;
case DEFAULTFONT_SERIF: s = "DEFAULTFONT_SERIF"; break;
case DEFAULTFONT_LATIN_TEXT: s = "DEFAULTFONT_LATIN_TEXT"; break;
case DEFAULTFONT_LATIN_PRESENTATION: s = "DEFAULTFONT_LATIN_PRESENTATION"; break;
case DEFAULTFONT_FIXED: s = "DEFAULTFONT_FIXED"; break;
case DEFAULTFONT_LATIN_FIXED: s = "DEFAULTFONT_LATIN_FIXED"; break;
case DEFAULTFONT_UI_FIXED: s = "DEFAULTFONT_UI_FIXED"; break;
case DEFAULTFONT_SYMBOL: s = "DEFAULTFONT_SYMBOL"; break;
case DEFAULTFONT_CJK_TEXT: s = "DEFAULTFONT_CJK_TEXT"; break;
case DEFAULTFONT_CJK_PRESENTATION: s = "DEFAULTFONT_CJK_PRESENTATION"; break;
case DEFAULTFONT_CJK_SPREADSHEET: s = "DEFAULTFONT_CJK_SPREADSHEET"; break;
case DEFAULTFONT_CJK_HEADING: s = "DEFAULTFONT_CJK_HEADING"; break;
case DEFAULTFONT_CJK_DISPLAY: s = "DEFAULTFONT_CJK_DISPLAY"; break;
case DEFAULTFONT_CTL_TEXT: s = "DEFAULTFONT_CTL_TEXT"; break;
case DEFAULTFONT_CTL_PRESENTATION: s = "DEFAULTFONT_CTL_PRESENTATION"; break;
case DEFAULTFONT_CTL_SPREADSHEET: s = "DEFAULTFONT_CTL_SPREADSHEET"; break;
case DEFAULTFONT_CTL_HEADING: s = "DEFAULTFONT_CTL_HEADING"; break;
case DEFAULTFONT_CTL_DISPLAY: s = "DEFAULTFONT_CTL_DISPLAY"; break;
}
fprintf( stderr, " OutputDevice::GetDefaultFont() Type=\"%s\" lang=%d flags=%ld FontName=\"%s\"\n",
s, eLang, nFlags,
OUStringToOString( aFont.GetName(), RTL_TEXTENCODING_UTF8 ).getStr()
);
#endif
return aFont;
}
// =======================================================================
static unsigned ImplIsCJKFont( const String& rFontName )
{
// Test, if Fontname includes CJK characters --> In this case we
// mention that it is a CJK font
const sal_Unicode* pStr = rFontName.GetBuffer();
while ( *pStr )
{
// japanese
if ( ((*pStr >= 0x3040) && (*pStr <= 0x30FF)) ||
((*pStr >= 0x3190) && (*pStr <= 0x319F)) )
return IMPL_FONT_ATTR_CJK|IMPL_FONT_ATTR_CJK_JP;
// korean
if ( ((*pStr >= 0xAC00) && (*pStr <= 0xD7AF)) ||
((*pStr >= 0x3130) && (*pStr <= 0x318F)) ||
((*pStr >= 0x1100) && (*pStr <= 0x11FF)) )
return IMPL_FONT_ATTR_CJK|IMPL_FONT_ATTR_CJK_KR;
// chinese
if ( ((*pStr >= 0x3400) && (*pStr <= 0x9FFF)) )
return IMPL_FONT_ATTR_CJK|IMPL_FONT_ATTR_CJK_TC|IMPL_FONT_ATTR_CJK_SC;
// cjk
if ( ((*pStr >= 0x3000) && (*pStr <= 0xD7AF)) ||
((*pStr >= 0xFF00) && (*pStr <= 0xFFEE)) )
return IMPL_FONT_ATTR_CJK;
pStr++;
}
return 0;
}
// -----------------------------------------------------------------------
static void ImplCalcType( ULONG& rType, FontWeight& rWeight, FontWidth& rWidth,
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
FontFamily eFamily, const FontNameAttr* pFontAttr )
{
if ( eFamily != FAMILY_DONTKNOW )
{
if ( eFamily == FAMILY_SWISS )
rType |= IMPL_FONT_ATTR_SANSSERIF;
else if ( eFamily == FAMILY_ROMAN )
rType |= IMPL_FONT_ATTR_SERIF;
else if ( eFamily == FAMILY_SCRIPT )
rType |= IMPL_FONT_ATTR_SCRIPT;
else if ( eFamily == FAMILY_MODERN )
rType |= IMPL_FONT_ATTR_FIXED;
else if ( eFamily == FAMILY_DECORATIVE )
rType |= IMPL_FONT_ATTR_DECORATIVE;
}
if ( pFontAttr )
{
rType |= pFontAttr->Type;
if ( ((rWeight == WEIGHT_DONTKNOW) || (rWeight == WEIGHT_NORMAL)) &&
(pFontAttr->Weight != WEIGHT_DONTKNOW) )
rWeight = pFontAttr->Weight;
if ( ((rWidth == WIDTH_DONTKNOW) || (rWidth == WIDTH_NORMAL)) &&
(pFontAttr->Width != WIDTH_DONTKNOW) )
rWidth = pFontAttr->Width;
}
}
// =======================================================================
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplFontData::ImplFontData( const ImplDevFontAttributes& rDFA, int nMagic )
: ImplDevFontAttributes( rDFA ),
mnWidth(0),
mnHeight(0),
mnMagic( nMagic ),
mpNext( NULL )
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// StarSymbol is a unicode font, but it still deserves the symbol flag
if( !mbSymbolFlag )
if( 0 == GetFamilyName().CompareIgnoreCaseToAscii( "starsymbol", 10)
|| 0 == GetFamilyName().CompareIgnoreCaseToAscii( "opensymbol", 10) )
mbSymbolFlag = true;
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
StringCompare ImplFontData::CompareIgnoreSize( const ImplFontData& rOther ) const
2000-09-18 16:07:07 +00:00
{
// compare their width, weight, italic and style name
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( meWidthType < rOther.meWidthType )
2000-09-18 16:07:07 +00:00
return COMPARE_LESS;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
else if( meWidthType > rOther.meWidthType )
2000-09-18 16:07:07 +00:00
return COMPARE_GREATER;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( meWeight < rOther.meWeight )
2000-09-18 16:07:07 +00:00
return COMPARE_LESS;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
else if( meWeight > rOther.meWeight )
2000-09-18 16:07:07 +00:00
return COMPARE_GREATER;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( meItalic < rOther.meItalic )
2000-09-18 16:07:07 +00:00
return COMPARE_LESS;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
else if( meItalic > rOther.meItalic )
2000-09-18 16:07:07 +00:00
return COMPARE_GREATER;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
StringCompare eCompare = maName.CompareTo( rOther.maName );
return eCompare;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
StringCompare ImplFontData::CompareWithSize( const ImplFontData& rOther ) const
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
StringCompare eCompare = CompareIgnoreSize( rOther );
if( eCompare != COMPARE_EQUAL )
return eCompare;
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( mnHeight < rOther.mnHeight )
2000-09-18 16:07:07 +00:00
return COMPARE_LESS;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
else if( mnHeight > rOther.mnHeight )
2000-09-18 16:07:07 +00:00
return COMPARE_GREATER;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( mnWidth < rOther.mnWidth )
2000-09-18 16:07:07 +00:00
return COMPARE_LESS;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
else if( mnWidth > rOther.mnWidth )
2000-09-18 16:07:07 +00:00
return COMPARE_GREATER;
return COMPARE_EQUAL;
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
struct FontMatchStatus
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
public:
int mnFaceMatch;
int mnHeightMatch;
int mnWidthMatch;
const xub_Unicode* mpTargetStyleName;
};
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
bool ImplFontData::IsBetterMatch( const ImplFontSelectData& rFSD, FontMatchStatus& rStatus ) const
{
int nMatch = 0;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
const String& rFontName = rFSD.maTargetName;
if( (rFontName == maName) || rFontName.EqualsIgnoreCaseAscii( maName ) )
nMatch += 240000;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( rStatus.mpTargetStyleName
&& maStyleName.EqualsIgnoreCaseAscii( rStatus.mpTargetStyleName ) )
nMatch += 120000;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( (rFSD.mePitch != PITCH_DONTKNOW) && (rFSD.mePitch == mePitch) )
nMatch += 20000;
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// prefer NORMAL font width
// TODO: change when the upper layers can tell their width preference
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( meWidthType == WIDTH_NORMAL )
nMatch += 400;
else if( (meWidthType == WIDTH_SEMI_EXPANDED) || (meWidthType == WIDTH_SEMI_CONDENSED) )
nMatch += 300;
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( rFSD.meWeight != WEIGHT_DONTKNOW )
{
// if not bold prefer light fonts to bold fonts
int nReqWeight = (int)rFSD.meWeight;
if ( rFSD.meWeight > WEIGHT_MEDIUM )
nReqWeight += 100;
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
int nGivenWeight = (int)meWeight;
if( meWeight > WEIGHT_MEDIUM )
nGivenWeight += 100;
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
int nWeightDiff = nReqWeight - nGivenWeight;
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if ( nWeightDiff == 0 )
nMatch += 1000;
else if ( nWeightDiff == +1 || nWeightDiff == -1 )
nMatch += 700;
else if ( nWeightDiff < +50 && nWeightDiff > -50)
nMatch += 200;
}
else // requested weight == WEIGHT_DONTKNOW
{
// prefer NORMAL font weight
// TODO: change when the upper layers can tell their weight preference
if( meWeight == WEIGHT_NORMAL )
nMatch += 450;
else if( meWeight == WEIGHT_MEDIUM )
nMatch += 350;
else if( (meWeight == WEIGHT_SEMILIGHT) || (meWeight == WEIGHT_SEMIBOLD) )
nMatch += 200;
else if( meWeight == WEIGHT_LIGHT )
nMatch += 150;
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if ( rFSD.meItalic == ITALIC_NONE )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( meItalic == ITALIC_NONE )
nMatch += 900;
}
else
{
if( rFSD.meItalic == meItalic )
nMatch += 900;
else if( meItalic != ITALIC_NONE )
nMatch += 600;
2000-09-18 16:07:07 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( mbDevice )
nMatch += 1;
2000-09-18 16:07:07 +00:00
int nHeightMatch = 0;
int nWidthMatch = 0;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( IsScalable() )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( rFSD.mnOrientation != 0 )
nMatch += 80;
else if( rFSD.mnWidth != 0 )
nMatch += 25;
else
nMatch += 5;
}
else
{
if( rFSD.mnHeight == mnHeight )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
nMatch += 20;
if( rFSD.mnWidth == mnWidth )
nMatch += 10;
2000-09-18 16:07:07 +00:00
}
else
{
// for non-scalable fonts the size difference is very important
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// prefer the smaller font face because of clipping/overlapping issues
int nHeightDiff = (rFSD.mnHeight - mnHeight) * 1000;
nHeightMatch = (nHeightDiff >= 0) ? -nHeightDiff : 100+nHeightDiff;
if( rFSD.mnHeight )
nHeightMatch /= rFSD.mnHeight;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( (rFSD.mnWidth != 0) && (mnWidth != 0) && (rFSD.mnWidth != mnWidth) )
2000-09-18 16:07:07 +00:00
{
int nWidthDiff = (rFSD.mnWidth - mnWidth) * 100;
nWidthMatch = (nWidthDiff >= 0) ? -nWidthDiff : +nWidthDiff;
2000-09-18 16:07:07 +00:00
}
}
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( rStatus.mnFaceMatch > nMatch )
return false;
else if( rStatus.mnFaceMatch < nMatch )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
rStatus.mnFaceMatch = nMatch;
rStatus.mnHeightMatch = nHeightMatch;
rStatus.mnWidthMatch = nWidthMatch;
return true;
2000-09-18 16:07:07 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// when two fonts are still competing prefer the
// one with the best matching height
if( rStatus.mnHeightMatch > nHeightMatch )
return false;
else if( rStatus.mnHeightMatch < nHeightMatch )
{
rStatus.mnHeightMatch = nHeightMatch;
rStatus.mnWidthMatch = nWidthMatch;
return true;
}
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( rStatus.mnWidthMatch > nWidthMatch )
return false;
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
rStatus.mnWidthMatch = nWidthMatch;
return true;
2000-09-18 16:07:07 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// =======================================================================
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
ImplFontEntry::ImplFontEntry( const ImplFontSelectData& rFontSelData )
: maFontSelData( rFontSelData ),
maMetric( rFontSelData ),
mpConversion( NULL ),
mnRefCount( 1 ),
mnSetFontFlags( 0 ),
mnOwnOrientation( 0 ),
mnOrientation( 0 ),
mbInit( false ),
mpUnicodeFallbackList( NULL )
{
maFontSelData.mpFontEntry = this;
}
// -----------------------------------------------------------------------
ImplFontEntry::~ImplFontEntry()
{
delete mpUnicodeFallbackList;
}
// -----------------------------------------------------------------------
size_t ImplFontEntry::GFBCacheKey_Hash::operator()( const GFBCacheKey& rData ) const
{
std::hash<sal_UCS4> a;
std::hash<int > b;
return a(rData.first) ^ b(rData.second);
}
inline void ImplFontEntry::AddFallbackForUnicode( sal_UCS4 cChar, FontWeight eWeight, const String& rFontName )
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
{
if( !mpUnicodeFallbackList )
mpUnicodeFallbackList = new UnicodeFallbackList;
(*mpUnicodeFallbackList)[ GFBCacheKey(cChar,eWeight) ] = rFontName;
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
}
// -----------------------------------------------------------------------
inline bool ImplFontEntry::GetFallbackForUnicode( sal_UCS4 cChar, FontWeight eWeight, String* pFontName ) const
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
{
if( !mpUnicodeFallbackList )
return false;
UnicodeFallbackList::const_iterator it = mpUnicodeFallbackList->find( GFBCacheKey(cChar,eWeight) );
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
if( it == mpUnicodeFallbackList->end() )
return false;
*pFontName = (*it).second;
return true;
}
// -----------------------------------------------------------------------
inline void ImplFontEntry::IgnoreFallbackForUnicode( sal_UCS4 cChar, FontWeight eWeight, const String& rFontName )
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
{
// DBG_ASSERT( mpUnicodeFallbackList, "ImplFontEntry::IgnoreFallbackForUnicode no list" );
UnicodeFallbackList::iterator it = mpUnicodeFallbackList->find( GFBCacheKey(cChar,eWeight) );
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
// DBG_ASSERT( it != mpUnicodeFallbackList->end(), "ImplFontEntry::IgnoreFallbackForUnicode no match" );
if( it == mpUnicodeFallbackList->end() )
return;
if( (*it).second == rFontName )
mpUnicodeFallbackList->erase( it );
}
// =======================================================================
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplDevFontListData::ImplDevFontListData( const String& rSearchName )
: mpFirst( NULL ),
maSearchName( rSearchName ),
mnTypeFaces( 0 ),
mnMatchType( 0 ),
meMatchWeight( WEIGHT_DONTKNOW ),
meMatchWidth( WIDTH_DONTKNOW ),
meFamily( FAMILY_DONTKNOW ),
mePitch( PITCH_DONTKNOW ),
mnMinQuality( -1 )
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
{}
2000-09-18 16:07:07 +00:00
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplDevFontListData::~ImplDevFontListData()
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// release all physical font faces
while( mpFirst )
{
2004-07-20 14:44:15 +00:00
ImplFontData* pFace = mpFirst;
mpFirst = pFace->GetNextFace();
delete pFace;
}
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
bool ImplDevFontListData::AddFontFace( ImplFontData* pNewData )
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
pNewData->mpNext = NULL;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( !mpFirst )
{
maName = pNewData->maName;
maMapNames = pNewData->maMapNames;
meFamily = pNewData->meFamily;
mePitch = pNewData->mePitch;
mnMinQuality = pNewData->mnQuality;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
}
else
{
if( meFamily == FAMILY_DONTKNOW )
meFamily = pNewData->meFamily;
if( mePitch == PITCH_DONTKNOW )
mePitch = pNewData->mePitch;
if( mnMinQuality > pNewData->mnQuality )
mnMinQuality = pNewData->mnQuality;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// set attributes for attribute based font matching
if( pNewData->IsScalable() )
mnTypeFaces |= IMPL_DEVFONT_SCALABLE;
if( pNewData->IsSymbolFont() )
mnTypeFaces |= IMPL_DEVFONT_SYMBOL;
else
mnTypeFaces |= IMPL_DEVFONT_NONESYMBOL;
if( pNewData->meWeight != WEIGHT_DONTKNOW )
{
if( pNewData->meWeight >= WEIGHT_SEMIBOLD )
mnTypeFaces |= IMPL_DEVFONT_BOLD;
else if( pNewData->meWeight <= WEIGHT_SEMILIGHT )
mnTypeFaces |= IMPL_DEVFONT_LIGHT;
else
mnTypeFaces |= IMPL_DEVFONT_NORMAL;
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( pNewData->meItalic == ITALIC_NONE )
mnTypeFaces |= IMPL_DEVFONT_NONEITALIC;
else if( (pNewData->meItalic == ITALIC_NORMAL)
|| (pNewData->meItalic == ITALIC_OBLIQUE) )
mnTypeFaces |= IMPL_DEVFONT_ITALIC;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( (meMatchWeight == WEIGHT_DONTKNOW)
|| (meMatchWidth == WIDTH_DONTKNOW)
|| (mnMatchType == 0) )
{
// TODO: is it cheaper to calc matching attributes now or on demand?
// calc matching attributes if other entries are already initialized
// MT: Perform05: Do lazy, quite expensive, not needed in start-up!
// const FontSubstConfiguration& rFontSubst = *FontSubstConfiguration::get();
// InitMatchData( rFontSubst, maSearchName );
// mbMatchData=true; // Somewhere else???
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
}
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// reassign name (sharing saves memory)
if( pNewData->maName == maName )
pNewData->maName = maName;
// insert new physical font face into linked list
// TODO: get rid of linear search?
ImplFontData* pData;
ImplFontData** ppHere = &mpFirst;
for(; (pData=*ppHere) != NULL; ppHere=&pData->mpNext )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
StringCompare eComp = pNewData->CompareWithSize( *pData );
if( eComp == COMPARE_GREATER )
continue;
if( eComp == COMPARE_LESS )
break;
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// ignore duplicate if its quality is worse
if( pNewData->mnQuality < pData->mnQuality )
return false;
// keep the device font if its quality is good enough
if( (pNewData->mnQuality == pData->mnQuality)
&& (pData->mbDevice || !pNewData->mbDevice) )
return false;
// replace existing font face with a better one
pNewData->mpNext = pData->mpNext;
*ppHere = pNewData;
delete pData;
return true;
2000-09-18 16:07:07 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// insert into or append to list of physical font faces
pNewData->mpNext = pData;
*ppHere = pNewData;
return true;
2000-09-18 16:07:07 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// get font attributes using the normalized font family name
void ImplDevFontListData::InitMatchData( const utl::FontSubstConfiguration& rFontSubst,
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
const String& rSearchName )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
String aShortName;
// get font attributes from the decorated font name
rFontSubst.getMapName( rSearchName, aShortName, maMatchFamilyName,
meMatchWeight, meMatchWidth, mnMatchType );
const FontNameAttr* pFontAttr = rFontSubst.getSubstInfo( rSearchName );
// eventually use the stripped name
if( !pFontAttr )
if( aShortName != rSearchName )
pFontAttr = rFontSubst.getSubstInfo( aShortName );
ImplCalcType( mnMatchType, meMatchWeight, meMatchWidth, meFamily, pFontAttr );
mnMatchType |= ImplIsCJKFont( maName );
2000-09-18 16:07:07 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplFontData* ImplDevFontListData::FindBestFontFace( const ImplFontSelectData& rFSD ) const
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( !mpFirst )
return NULL;
if( !mpFirst->GetNextFace() )
return mpFirst;
// FontName+StyleName should map to FamilyName+StyleName
const String& rSearchName = rFSD.maTargetName;
const xub_Unicode* pTargetStyleName = NULL;
if( (rSearchName.Len() > maSearchName.Len())
&& rSearchName.Equals( maSearchName, 0, maSearchName.Len() ) )
pTargetStyleName = rSearchName.GetBuffer() + maSearchName.Len() + 1;
// linear search, TODO: improve?
ImplFontData* pFontFace = mpFirst;
ImplFontData* pBestFontFace = pFontFace;
FontMatchStatus aFontMatchStatus = {0,0,0, pTargetStyleName};
for(; pFontFace; pFontFace = pFontFace->GetNextFace() )
if( pFontFace->IsBetterMatch( rFSD, aFontMatchStatus ) )
pBestFontFace = pFontFace;
return pBestFontFace;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// update device font list with unique font faces, with uniqueness
// meaning different font attributes, but not different fonts sizes
void ImplDevFontListData::UpdateDevFontList( ImplGetDevFontList& rDevFontList ) const
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplFontData* pPrevFace = NULL;
for( ImplFontData* pFace = mpFirst; pFace; pFace = pFace->GetNextFace() )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( !pPrevFace || pFace->CompareIgnoreSize( *pPrevFace ) )
rDevFontList.Add( pFace );
pPrevFace = pFace;
2000-09-18 16:07:07 +00:00
}
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
void ImplDevFontListData::GetFontHeights( std::set<int>& rHeights ) const
{
// add all available font heights
for( const ImplFontData* pFace = mpFirst; pFace; pFace = pFace->GetNextFace() )
rHeights.insert( pFace->GetHeight() );
}
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// -----------------------------------------------------------------------
void ImplDevFontListData::UpdateCloneFontList( ImplDevFontList& rDevFontList,
bool bScalable, bool bEmbeddable ) const
{
2004-07-20 14:44:15 +00:00
for( ImplFontData* pFace = mpFirst; pFace; pFace = pFace->GetNextFace() )
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( bScalable && !pFace->IsScalable() )
continue;
if( bEmbeddable && !pFace->IsEmbeddable() && !pFace->IsSubsettable() )
continue;
ImplFontData* pClonedFace = pFace->Clone();
rDevFontList.Add( pClonedFace );
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// =======================================================================
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplDevFontList::ImplDevFontList()
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
: mbMatchData( false )
, mbMapNames( false )
, mpPreMatchHook( NULL )
, mpFallbackHook( NULL )
, mpFallbackList( NULL )
, mnFallbackCount( -1 )
{}
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplDevFontList::~ImplDevFontList()
{
Clear();
}
// -----------------------------------------------------------------------
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
void ImplDevFontList::SetPreMatchHook( ImplPreMatchFontSubstitution* pHook )
{
mpPreMatchHook = pHook;
}
// -----------------------------------------------------------------------
void ImplDevFontList::SetFallbackHook( ImplGlyphFallbackFontSubstitution* pHook )
{
mpFallbackHook = pHook;
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
void ImplDevFontList::Clear()
{
// remove fallback lists
delete[] mpFallbackList;
mpFallbackList = NULL;
mnFallbackCount = -1;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// clear all entries in the device font list
DevFontList::iterator it = maDevFontList.begin();
for(; it != maDevFontList.end(); ++it )
{
ImplDevFontListData* pEntry = (*it).second;
delete pEntry;
2000-09-18 16:07:07 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
maDevFontList.clear();
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// match data must be recalculated too
mbMatchData = false;
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// -----------------------------------------------------------------------
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
void ImplDevFontList::InitGenericGlyphFallback( void ) const
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
{
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
// normalized family names of fonts suited for glyph fallback
// if a font is available related fonts can be ignored
// TODO: implement dynamic lists
static const char* aGlyphFallbackList[] = {
// empty strings separate the names of unrelated fonts
"eudc", "",
"arialunicodems", "cyberbit", "code2000", "",
"andalesansui", "",
"starsymbol", "opensymbol", "",
"msmincho", "fzmingti", "fzheiti", "ipamincho", "sazanamimincho", "kochimincho", "",
"sunbatang", "sundotum", "baekmukdotum", "gulim", "batang", "dotum", "",
"hgmincholightj", "msunglightsc", "msunglighttc", "hymyeongjolightk", "",
"tahoma", "dejavusans", "timesnewroman", "liberationsans", "",
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
"shree", "mangal", "",
"raavi", "shruti", "tunga", "",
"latha", "gautami", "kartika", "vrinda", "",
"shayyalmt", "naskmt", "scheherazade", "",
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
"david", "nachlieli", "lucidagrande", "",
"norasi", "angsanaupc", "",
"khmerossystem", "",
"muktinarrow", "",
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
"phetsarathot", "",
"padauk", "pinlonmyanmar", "",
"iskoolapota", "lklug", "",
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
0
};
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
bool bHasEudc = false;
int nMaxLevel = 0;
int nBestQuality = 0;
ImplDevFontListData** pFallbackList = NULL;
for( const char** ppNames = &aGlyphFallbackList[0];; ++ppNames )
{
// advance to next sub-list when end-of-sublist marker
if( !**ppNames ) // #i46456# check for empty string, i.e., deref string itself not only ptr to it
{
if( nBestQuality > 0 )
if( ++nMaxLevel >= MAX_FALLBACK )
break;
if( !ppNames[1] )
break;
nBestQuality = 0;
continue;
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
// test if the glyph fallback candidate font is available and scalable
String aTokenName( *ppNames, RTL_TEXTENCODING_UTF8 );
ImplDevFontListData* pFallbackFont = FindFontFamily( aTokenName );
if( !pFallbackFont )
continue;
if( !pFallbackFont->IsScalable() )
continue;
// keep the best font of the glyph fallback sub-list
if( nBestQuality < pFallbackFont->GetMinQuality() )
{
nBestQuality = pFallbackFont->GetMinQuality();
// store available glyph fallback fonts
if( !pFallbackList )
pFallbackList = new ImplDevFontListData*[ MAX_FALLBACK ];
pFallbackList[ nMaxLevel ] = pFallbackFont;
if( !bHasEudc && !nMaxLevel )
bHasEudc = !strncmp( *ppNames, "eudc", 5 );
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
}
}
#ifdef SAL_FONTENUM_STABLE_ON_PLATFORM // #i113472#
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
// sort the list of fonts for glyph fallback by quality (highest first)
// #i33947# keep the EUDC font at the front of the list
// an insertion sort is good enough for this short list
const int nSortStart = bHasEudc ? 1 : 0;
for( int i = nSortStart+1, j; i < nMaxLevel; ++i )
{
ImplDevFontListData* pTestFont = pFallbackList[ i ];
int nTestQuality = pTestFont->GetMinQuality();
for( j = i; --j >= nSortStart; )
if( nTestQuality > pFallbackList[j]->GetMinQuality() )
pFallbackList[ j+1 ] = pFallbackList[ j ];
else
break;
pFallbackList[ j+1 ] = pTestFont;
}
#endif
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
#if defined(HDU_DEBUG)
for( int i = 0; i < nMaxLevel; ++i )
{
ImplDevFontListData* pFont = pFallbackList[ i ];
ByteString aFontName( pFont->GetFamilyName(), RTL_TEXTENCODING_UTF8 );
fprintf( stderr, "GlyphFallbackFont[%d] (quality=%05d): \"%s\"\n",
i, pFont->GetMinQuality(), aFontName.GetBuffer() );
}
#endif
mnFallbackCount = nMaxLevel;
mpFallbackList = pFallbackList;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
}
// -----------------------------------------------------------------------
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( ImplFontSelectData& rFontSelData,
rtl::OUString& rMissingCodes, int nFallbackLevel ) const
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
{
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
ImplDevFontListData* pFallbackData = NULL;
// find a matching font candidate for platform specific glyph fallback
if( mpFallbackHook )
{
// check cache for the first matching entry
// to avoid calling the expensive fallback hook (#i83491#)
sal_UCS4 cChar = 0;
bool bCached = true;
sal_Int32 nStrIndex = 0;
while( nStrIndex < rMissingCodes.getLength() )
{
cChar = rMissingCodes.iterateCodePoints( &nStrIndex );
bCached = rFontSelData.mpFontEntry->GetFallbackForUnicode( cChar, rFontSelData.GetWeight(), &rFontSelData.maSearchName );
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
// ignore entries which don't have a fallback
if( !bCached || (rFontSelData.maSearchName.Len() != 0) )
break;
}
if( bCached )
{
// there is a matching fallback in the cache
// so update rMissingCodes with codepoints not yet resolved by this fallback
int nRemainingLength = 0;
sal_UCS4* pRemainingCodes = (sal_UCS4*)alloca( rMissingCodes.getLength() * sizeof(sal_UCS4) );
String aFontName;
while( nStrIndex < rMissingCodes.getLength() )
{
cChar = rMissingCodes.iterateCodePoints( &nStrIndex );
bCached = rFontSelData.mpFontEntry->GetFallbackForUnicode( cChar, rFontSelData.GetWeight(), &aFontName );
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
if( !bCached || (rFontSelData.maSearchName != aFontName) )
pRemainingCodes[ nRemainingLength++ ] = cChar;
}
rMissingCodes = rtl::OUString( pRemainingCodes, nRemainingLength );
}
else
{
rtl::OUString aOldMissingCodes = rMissingCodes;
// call the hook to query the best matching glyph fallback font
if( mpFallbackHook->FindFontSubstitute( rFontSelData, rMissingCodes ) )
// apply outdev3.cxx specific fontname normalization
GetEnglishSearchFontName( rFontSelData.maSearchName );
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
else
rFontSelData.maSearchName = String();
// cache the result even if there was no match
for(;;)
{
if( !rFontSelData.mpFontEntry->GetFallbackForUnicode( cChar, rFontSelData.GetWeight(), &rFontSelData.maSearchName ) )
rFontSelData.mpFontEntry->AddFallbackForUnicode( cChar, rFontSelData.GetWeight(), rFontSelData.maSearchName );
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
if( nStrIndex >= aOldMissingCodes.getLength() )
break;
cChar = aOldMissingCodes.iterateCodePoints( &nStrIndex );
}
if( rFontSelData.maSearchName.Len() != 0 )
{
// remove cache entries that were still not resolved
for( nStrIndex = 0; nStrIndex < rMissingCodes.getLength(); )
{
cChar = rMissingCodes.iterateCodePoints( &nStrIndex );
rFontSelData.mpFontEntry->IgnoreFallbackForUnicode( cChar, rFontSelData.GetWeight(), rFontSelData.maSearchName );
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
}
}
}
// find the matching device font
if( rFontSelData.maSearchName.Len() != 0 )
pFallbackData = FindFontFamily( rFontSelData.maSearchName );
}
// else find a matching font candidate for generic glyph fallback
if( !pFallbackData )
{
// initialize font candidates for generic glyph fallback if needed
if( mnFallbackCount < 0 )
InitGenericGlyphFallback();
// TODO: adjust nFallbackLevel by number of levels resolved by the fallback hook
if( nFallbackLevel < mnFallbackCount )
pFallbackData = mpFallbackList[ nFallbackLevel ];
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
}
return pFallbackData;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
}
// -----------------------------------------------------------------------
void ImplDevFontList::Add( ImplFontData* pNewData )
{
int nAliasQuality = pNewData->mnQuality - 100;
String aMapNames = pNewData->maMapNames;
pNewData->maMapNames = String();
bool bKeepNewData = false;
for( xub_StrLen nMapNameIndex = 0; nMapNameIndex != STRING_NOTFOUND; )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
String aSearchName = pNewData->maName;
GetEnglishSearchFontName( aSearchName );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
DevFontList::const_iterator it = maDevFontList.find( aSearchName );
ImplDevFontListData* pFoundData = NULL;
if( it != maDevFontList.end() )
pFoundData = (*it).second;
if( !pFoundData )
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
pFoundData = new ImplDevFontListData( aSearchName );
maDevFontList[ aSearchName ] = pFoundData;
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
bKeepNewData = pFoundData->AddFontFace( pNewData );
// add font alias if available
// a font alias should never win against an original font with similar quality
if( aMapNames.Len() >= nMapNameIndex )
break;
if( bKeepNewData ) // try to recycle obsoleted object
pNewData = pNewData->CreateAlias();
bKeepNewData = false;
pNewData->mnQuality = nAliasQuality;
pNewData->maName = GetNextFontToken( aMapNames, nMapNameIndex );
2000-09-18 16:07:07 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( !bKeepNewData )
delete pNewData;
}
// -----------------------------------------------------------------------
// find the font from the normalized font family name
ImplDevFontListData* ImplDevFontList::ImplFindBySearchName( const String& rSearchName ) const
{
#ifdef DEBUG
String aTempName = rSearchName;
GetEnglishSearchFontName( aTempName );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
DBG_ASSERT( aTempName == rSearchName, "ImplDevFontList::ImplFindBySearchName() called with non-normalized name" );
#endif
DevFontList::const_iterator it = maDevFontList.find( rSearchName );
if( it == maDevFontList.end() )
return NULL;
ImplDevFontListData* pFoundData = (*it).second;
return pFoundData;
}
// -----------------------------------------------------------------------
ImplDevFontListData* ImplDevFontList::ImplFindByAliasName( const String& rSearchName, const String& rShortName ) const
{
// short circuit for impossible font name alias
if( !rSearchName.Len() )
return NULL;
// short circuit if no alias names are available
if( !mbMapNames )
return NULL;
// use the font's alias names to find the font
// TODO: get rid of linear search
DevFontList::const_iterator it = maDevFontList.begin();
while( it != maDevFontList.end() )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplDevFontListData* pData = (*it).second;
if( !pData->maMapNames.Len() )
continue;
// if one alias name matches we found a matching font
String aTempName;
xub_StrLen nIndex = 0;
2000-09-18 16:07:07 +00:00
do
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
aTempName = GetNextFontToken( pData->maMapNames, nIndex );
// Test, if the Font name match with one of the mapping names
if ( (aTempName == rSearchName) || (aTempName == rShortName) )
return pData;
2000-09-18 16:07:07 +00:00
}
while ( nIndex != STRING_NOTFOUND );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
}
return NULL;
}
// -----------------------------------------------------------------------
ImplDevFontListData* ImplDevFontList::FindFontFamily( const String& rFontName ) const
{
// normalize the font fomily name and
String aName = rFontName;
GetEnglishSearchFontName( aName );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplDevFontListData* pFound = ImplFindBySearchName( aName );
return pFound;
}
// -----------------------------------------------------------------------
ImplDevFontListData* ImplDevFontList::ImplFindByTokenNames( const String& rTokenStr ) const
{
ImplDevFontListData* pFoundData = NULL;
// use normalized font name tokens to find the font
for( xub_StrLen nTokenPos = 0; nTokenPos != STRING_NOTFOUND; )
{
String aSearchName = GetNextFontToken( rTokenStr, nTokenPos );
if( !aSearchName.Len() )
continue;
GetEnglishSearchFontName( aSearchName );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
pFoundData = ImplFindBySearchName( aSearchName );
if( pFoundData )
break;
2000-09-18 16:07:07 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
return pFoundData;
}
// -----------------------------------------------------------------------
ImplDevFontListData* ImplDevFontList::ImplFindBySubstFontAttr( const utl::FontNameAttr& rFontAttr ) const
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
{
ImplDevFontListData* pFoundData = NULL;
// use the font substitutions suggested by the FontNameAttr to find the font
::std::vector< String >::const_iterator it = rFontAttr.Substitutions.begin();
for(; it != rFontAttr.Substitutions.end(); ++it )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
String aSearchName( *it );
GetEnglishSearchFontName( aSearchName );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
pFoundData = ImplFindBySearchName( aSearchName );
if( pFoundData )
return pFoundData;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
}
// use known attributes from the configuration to find a matching substitute
const ULONG nSearchType = rFontAttr.Type;
if( nSearchType != 0 )
{
const FontWeight eSearchWeight = rFontAttr.Weight;
const FontWidth eSearchWidth = rFontAttr.Width;
const FontItalic eSearchSlant = ITALIC_DONTKNOW;
const FontFamily eSearchFamily = FAMILY_DONTKNOW;
const String aSearchName;
pFoundData = ImplFindByAttributes( nSearchType,
eSearchWeight, eSearchWidth, eSearchFamily, eSearchSlant, aSearchName );
if( pFoundData )
return pFoundData;
}
return NULL;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
}
// -----------------------------------------------------------------------
void ImplDevFontList::InitMatchData() const
{
// short circuit if already done
if( mbMatchData )
return;
mbMatchData = true;
// calculate MatchData for all entries
const FontSubstConfiguration& rFontSubst = *FontSubstConfiguration::get();
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
DevFontList::const_iterator it = maDevFontList.begin();
for(; it != maDevFontList.end(); ++it )
{
const String& rSearchName = (*it).first;
ImplDevFontListData* pEntry = (*it).second;
pEntry->InitMatchData( rFontSubst, rSearchName );
}
}
//----------------------------------------------------------------------------
ImplDevFontListData* ImplDevFontList::ImplFindByLocale(com::sun::star::lang::Locale lc) const
{
// get the default font for a specified locale
const DefaultFontConfiguration& rDefaults = *DefaultFontConfiguration::get();
String aDefault = rDefaults.getUserInterfaceFont( lc );
ImplDevFontListData* pFontData = ImplFindByTokenNames( aDefault );
if( pFontData )
return pFontData;
return 0;
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// -----------------------------------------------------------------------
ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( ULONG nSearchType,
FontWeight eSearchWeight, FontWidth eSearchWidth, FontFamily /*eSearchFamily*/,
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
FontItalic eSearchItalic, const String& rSearchFamilyName ) const
{
if( (eSearchItalic != ITALIC_NONE) && (eSearchItalic != ITALIC_DONTKNOW) )
nSearchType |= IMPL_FONT_ATTR_ITALIC;
// don't bother to match attributes if the attributes aren't worth matching
if( !nSearchType
&& ((eSearchWeight == WEIGHT_DONTKNOW) || (eSearchWeight == WEIGHT_NORMAL))
&& ((eSearchWidth == WIDTH_DONTKNOW) || (eSearchWidth == WIDTH_NORMAL)) )
return NULL;
InitMatchData();
ImplDevFontListData* pFoundData = NULL;
long nTestMatch;
long nBestMatch = 40000;
ULONG nBestType = 0;
DevFontList::const_iterator it = maDevFontList.begin();
for(; it != maDevFontList.end(); ++it )
{
ImplDevFontListData* pData = (*it).second;
// Get all information about the matching font
ULONG nMatchType = pData->mnMatchType;
FontWeight eMatchWeight= pData->meMatchWeight;
FontWidth eMatchWidth = pData->meMatchWidth;
// Calculate Match Value
// 1000000000
// 100000000
// 10000000 CJK, CTL, None-Latin, Symbol
// 1000000 FamilyName, Script, Fixed, -Special, -Decorative,
// Titling, Capitals, Outline, Shadow
// 100000 Match FamilyName, Serif, SansSerif, Italic,
// Width, Weight
// 10000 Scalable, Standard, Default,
// full, Normal, Knownfont,
// Otherstyle, +Special, +Decorative,
// 1000 Typewriter, Rounded, Gothic, Schollbook
// 100
nTestMatch = 0;
// test CJK script attributes
if ( nSearchType & IMPL_FONT_ATTR_CJK )
{
// Matching language
if( 0 == ((nSearchType ^ nMatchType) & IMPL_FONT_ATTR_CJK_ALLLANG) )
nTestMatch += 10000000*3;
if( nMatchType & IMPL_FONT_ATTR_CJK )
nTestMatch += 10000000*2;
if( nMatchType & IMPL_FONT_ATTR_FULL )
nTestMatch += 10000000;
}
else if ( nMatchType & IMPL_FONT_ATTR_CJK )
nTestMatch -= 10000000;
// test CTL script attributes
if( nSearchType & IMPL_FONT_ATTR_CTL )
{
if( nMatchType & IMPL_FONT_ATTR_CTL )
nTestMatch += 10000000*2;
if( nMatchType & IMPL_FONT_ATTR_FULL )
nTestMatch += 10000000;
}
else if ( nMatchType & IMPL_FONT_ATTR_CTL )
nTestMatch -= 10000000;
// test LATIN script attributes
if( nSearchType & IMPL_FONT_ATTR_NONELATIN )
{
if( nMatchType & IMPL_FONT_ATTR_NONELATIN )
nTestMatch += 10000000*2;
if( nMatchType & IMPL_FONT_ATTR_FULL )
nTestMatch += 10000000;
}
// test SYMBOL attributes
if ( nSearchType & IMPL_FONT_ATTR_SYMBOL )
{
const String& rSearchName = it->first;
// prefer some special known symbol fonts
if ( rSearchName.EqualsAscii( "starsymbol" ) )
nTestMatch += 10000000*6+(10000*3);
else if ( rSearchName.EqualsAscii( "opensymbol" ) )
nTestMatch += 10000000*6;
else if ( rSearchName.EqualsAscii( "starbats" )
|| rSearchName.EqualsAscii( "wingdings" )
|| rSearchName.EqualsAscii( "monotypesorts" )
|| rSearchName.EqualsAscii( "dingbats" )
|| rSearchName.EqualsAscii( "zapfdingbats" ) )
nTestMatch += 10000000*5;
else if ( pData->mnTypeFaces & IMPL_DEVFONT_SYMBOL )
nTestMatch += 10000000*4;
else
{
if( nMatchType & IMPL_FONT_ATTR_SYMBOL )
nTestMatch += 10000000*2;
if( nMatchType & IMPL_FONT_ATTR_FULL )
nTestMatch += 10000000;
}
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
else if ( (pData->mnTypeFaces & (IMPL_DEVFONT_SYMBOL | IMPL_DEVFONT_NONESYMBOL)) == IMPL_DEVFONT_SYMBOL )
nTestMatch -= 10000000;
else if ( nMatchType & IMPL_FONT_ATTR_SYMBOL )
nTestMatch -= 10000;
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// match stripped family name
if( rSearchFamilyName.Len() && (rSearchFamilyName == pData->maMatchFamilyName) )
nTestMatch += 1000000*3;
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// match ALLSCRIPT? attribute
if( nSearchType & IMPL_FONT_ATTR_ALLSCRIPT )
{
if( nMatchType & IMPL_FONT_ATTR_ALLSCRIPT )
nTestMatch += 1000000*2;
if( nSearchType & IMPL_FONT_ATTR_ALLSUBSCRIPT )
{
if( 0 == ((nSearchType ^ nMatchType) & IMPL_FONT_ATTR_ALLSUBSCRIPT) )
nTestMatch += 1000000*2;
if( 0 != ((nSearchType ^ nMatchType) & IMPL_FONT_ATTR_BRUSHSCRIPT) )
nTestMatch -= 1000000;
}
}
else if( nMatchType & IMPL_FONT_ATTR_ALLSCRIPT )
nTestMatch -= 1000000;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// test MONOSPACE+TYPEWRITER attributes
if( nSearchType & IMPL_FONT_ATTR_FIXED )
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( nMatchType & IMPL_FONT_ATTR_FIXED )
nTestMatch += 1000000*2;
// a typewriter attribute is even better
if( 0 == ((nSearchType ^ nMatchType) & IMPL_FONT_ATTR_TYPEWRITER) )
nTestMatch += 10000*2;
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
else if( nMatchType & IMPL_FONT_ATTR_FIXED )
nTestMatch -= 1000000;
// test SPECIAL attribute
if( nSearchType & IMPL_FONT_ATTR_SPECIAL )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( nMatchType & IMPL_FONT_ATTR_SPECIAL )
nTestMatch += 10000;
else if( !(nSearchType & IMPL_FONT_ATTR_ALLSERIFSTYLE) )
{
if( nMatchType & IMPL_FONT_ATTR_SERIF )
nTestMatch += 1000*2;
else if( nMatchType & IMPL_FONT_ATTR_SANSSERIF )
nTestMatch += 1000;
}
}
else if( (nMatchType & IMPL_FONT_ATTR_SPECIAL) && !(nSearchType & IMPL_FONT_ATTR_SYMBOL) )
nTestMatch -= 1000000;
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// test DECORATIVE attribute
if( nSearchType & IMPL_FONT_ATTR_DECORATIVE )
{
if( nMatchType & IMPL_FONT_ATTR_DECORATIVE )
nTestMatch += 10000;
else if( !(nSearchType & IMPL_FONT_ATTR_ALLSERIFSTYLE) )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( nMatchType & IMPL_FONT_ATTR_SERIF )
nTestMatch += 1000*2;
else if ( nMatchType & IMPL_FONT_ATTR_SANSSERIF )
nTestMatch += 1000;
2000-09-18 16:07:07 +00:00
}
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
else if( nMatchType & IMPL_FONT_ATTR_DECORATIVE )
nTestMatch -= 1000000;
// test TITLE+CAPITALS attributes
if( nSearchType & (IMPL_FONT_ATTR_TITLING | IMPL_FONT_ATTR_CAPITALS) )
{
if( nMatchType & (IMPL_FONT_ATTR_TITLING | IMPL_FONT_ATTR_CAPITALS) )
nTestMatch += 1000000*2;
if( 0 == ((nSearchType^nMatchType) & (IMPL_FONT_ATTR_TITLING | IMPL_FONT_ATTR_CAPITALS)))
nTestMatch += 1000000;
else if( (nMatchType & (IMPL_FONT_ATTR_TITLING | IMPL_FONT_ATTR_CAPITALS))
&& (nMatchType & (IMPL_FONT_ATTR_STANDARD | IMPL_FONT_ATTR_DEFAULT)) )
nTestMatch += 1000000;
}
else if( nMatchType & (IMPL_FONT_ATTR_TITLING | IMPL_FONT_ATTR_CAPITALS) )
nTestMatch -= 1000000;
// test OUTLINE+SHADOW attributes
if( nSearchType & (IMPL_FONT_ATTR_OUTLINE | IMPL_FONT_ATTR_SHADOW) )
{
if( nMatchType & (IMPL_FONT_ATTR_OUTLINE | IMPL_FONT_ATTR_SHADOW) )
nTestMatch += 1000000*2;
if( 0 == ((nSearchType ^ nMatchType) & (IMPL_FONT_ATTR_OUTLINE | IMPL_FONT_ATTR_SHADOW)) )
nTestMatch += 1000000;
else if( (nMatchType & (IMPL_FONT_ATTR_OUTLINE | IMPL_FONT_ATTR_SHADOW))
&& (nMatchType & (IMPL_FONT_ATTR_STANDARD | IMPL_FONT_ATTR_DEFAULT)) )
nTestMatch += 1000000;
}
else if ( nMatchType & (IMPL_FONT_ATTR_OUTLINE | IMPL_FONT_ATTR_SHADOW) )
nTestMatch -= 1000000;
// test font name substrings
// TODO: calculate name matching score using e.g. Levenstein distance
if( (rSearchFamilyName.Len() >= 4) && (pData->maMatchFamilyName.Len() >= 4)
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
&& ((rSearchFamilyName.Search( pData->maMatchFamilyName ) != STRING_NOTFOUND)
|| (pData->maMatchFamilyName.Search( rSearchFamilyName ) != STRING_NOTFOUND)) )
nTestMatch += 5000;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// test SERIF attribute
if( nSearchType & IMPL_FONT_ATTR_SERIF )
2002-02-21 09:45:39 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( nMatchType & IMPL_FONT_ATTR_SERIF )
nTestMatch += 1000000*2;
else if( nMatchType & IMPL_FONT_ATTR_SANSSERIF )
nTestMatch -= 1000000;
2002-02-21 09:45:39 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// test SANSERIF attribute
if( nSearchType & IMPL_FONT_ATTR_SANSSERIF )
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( nMatchType & IMPL_FONT_ATTR_SANSSERIF )
nTestMatch += 1000000;
else if ( nMatchType & IMPL_FONT_ATTR_SERIF )
nTestMatch -= 1000000;
}
// test ITALIC attribute
if( nSearchType & IMPL_FONT_ATTR_ITALIC )
{
if( pData->mnTypeFaces & IMPL_DEVFONT_ITALIC )
nTestMatch += 1000000*3;
if( nMatchType & IMPL_FONT_ATTR_ITALIC )
nTestMatch += 1000000;
}
else if( !(nSearchType & IMPL_FONT_ATTR_ALLSCRIPT)
&& ((nMatchType & IMPL_FONT_ATTR_ITALIC)
|| !(pData->mnTypeFaces & IMPL_DEVFONT_NONEITALIC)) )
nTestMatch -= 1000000*2;
// test WIDTH attribute
if( (eSearchWidth != WIDTH_DONTKNOW) && (eSearchWidth != WIDTH_NORMAL) )
{
if( eSearchWidth < WIDTH_NORMAL )
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( eSearchWidth == eMatchWidth )
nTestMatch += 1000000*3;
else if( (eMatchWidth < WIDTH_NORMAL) && (eMatchWidth != WIDTH_DONTKNOW) )
nTestMatch += 1000000;
}
else
{
if( eSearchWidth == eMatchWidth )
nTestMatch += 1000000*3;
else if( eMatchWidth > WIDTH_NORMAL )
nTestMatch += 1000000;
2001-06-29 14:29:24 +00:00
}
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
else if( (eMatchWidth != WIDTH_DONTKNOW) && (eMatchWidth != WIDTH_NORMAL) )
nTestMatch -= 1000000;
2001-06-29 14:29:24 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// test WEIGHT attribute
if( (eSearchWeight != WEIGHT_DONTKNOW) && (eSearchWeight != WEIGHT_NORMAL) && (eSearchWeight != WEIGHT_MEDIUM) )
2001-06-29 14:29:24 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( eSearchWeight < WEIGHT_NORMAL )
2001-06-29 14:29:24 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( pData->mnTypeFaces & IMPL_DEVFONT_LIGHT )
nTestMatch += 1000000;
if( (eMatchWeight < WEIGHT_NORMAL) && (eMatchWeight != WEIGHT_DONTKNOW) )
nTestMatch += 1000000;
}
else
{
if( pData->mnTypeFaces & IMPL_DEVFONT_BOLD )
nTestMatch += 1000000;
if( eMatchWeight > WEIGHT_BOLD )
nTestMatch += 1000000;
2001-06-29 14:29:24 +00:00
}
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
else if( ((eMatchWeight != WEIGHT_DONTKNOW) && (eMatchWeight != WEIGHT_NORMAL) && (eMatchWeight != WEIGHT_MEDIUM))
|| !(pData->mnTypeFaces & IMPL_DEVFONT_NORMAL) )
nTestMatch -= 1000000;
// prefer scalable fonts
if( pData->mnTypeFaces & IMPL_DEVFONT_SCALABLE )
nTestMatch += 10000*4;
else
nTestMatch -= 10000*4;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// test STANDARD+DEFAULT+FULL+NORMAL attributes
if( nMatchType & IMPL_FONT_ATTR_STANDARD )
nTestMatch += 10000*2;
if( nMatchType & IMPL_FONT_ATTR_DEFAULT )
nTestMatch += 10000;
if( nMatchType & IMPL_FONT_ATTR_FULL )
nTestMatch += 10000;
if( nMatchType & IMPL_FONT_ATTR_NORMAL )
nTestMatch += 10000;
// test OTHERSTYLE attribute
if( nMatchType & IMPL_FONT_ATTR_OTHERSTYLE )
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( !(nMatchType & IMPL_FONT_ATTR_OTHERSTYLE) )
nTestMatch -= 10000;
}
else if( nMatchType & IMPL_FONT_ATTR_OTHERSTYLE )
nTestMatch -= 10000;
// test ROUNDED attribute
if( 0 == ((nSearchType ^ nMatchType) & IMPL_FONT_ATTR_ROUNDED) )
nTestMatch += 1000;
// test TYPEWRITER attribute
if( 0 == ((nSearchType ^ nMatchType) & IMPL_FONT_ATTR_TYPEWRITER) )
nTestMatch += 1000;
2001-06-29 14:29:24 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// test GOTHIC attribute
if( nSearchType & IMPL_FONT_ATTR_GOTHIC )
{
if( nMatchType & IMPL_FONT_ATTR_GOTHIC )
nTestMatch += 1000*3;
if( nMatchType & IMPL_FONT_ATTR_SANSSERIF )
nTestMatch += 1000*2;
}
// test SCHOOLBOOK attribute
if( nSearchType & IMPL_FONT_ATTR_SCHOOLBOOK )
{
if( nMatchType & IMPL_FONT_ATTR_SCHOOLBOOK )
nTestMatch += 1000*3;
if( nMatchType & IMPL_FONT_ATTR_SERIF )
nTestMatch += 1000*2;
}
// compare with best matching font yet
if ( nTestMatch > nBestMatch )
{
pFoundData = pData;
nBestMatch = nTestMatch;
nBestType = nMatchType;
}
else if( nTestMatch == nBestMatch )
{
// some fonts are more suitable defaults
if( nMatchType & IMPL_FONT_ATTR_DEFAULT )
{
pFoundData = pData;
nBestType = nMatchType;
}
else if( (nMatchType & IMPL_FONT_ATTR_STANDARD) &&
!(nBestType & IMPL_FONT_ATTR_DEFAULT) )
2001-06-29 14:29:24 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
pFoundData = pData;
nBestType = nMatchType;
}
}
}
2001-06-29 14:29:24 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
return pFoundData;
}
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplDevFontListData* ImplDevFontList::FindDefaultFont() const
{
// try to find one of the default fonts of the
// UNICODE, SANSSERIF, SERIF or FIXED default font lists
const DefaultFontConfiguration& rDefaults = *DefaultFontConfiguration::get();
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
com::sun::star::lang::Locale aLocale( OUString( RTL_CONSTASCII_USTRINGPARAM("en") ), OUString(), OUString() );
String aFontname = rDefaults.getDefaultFont( aLocale, DEFAULTFONT_SANS_UNICODE );
ImplDevFontListData* pFoundData = ImplFindByTokenNames( aFontname );
if( pFoundData )
return pFoundData;
aFontname = rDefaults.getDefaultFont( aLocale, DEFAULTFONT_SANS );
pFoundData = ImplFindByTokenNames( aFontname );
if( pFoundData )
return pFoundData;
aFontname = rDefaults.getDefaultFont( aLocale, DEFAULTFONT_SERIF );
pFoundData = ImplFindByTokenNames( aFontname );
if( pFoundData )
return pFoundData;
aFontname = rDefaults.getDefaultFont( aLocale, DEFAULTFONT_FIXED );
pFoundData = ImplFindByTokenNames( aFontname );
if( pFoundData )
return pFoundData;
// now try to find a reasonable non-symbol font
InitMatchData();
DevFontList::const_iterator it = maDevFontList.begin();
for(; it != maDevFontList.end(); ++it )
{
ImplDevFontListData* pData = (*it).second;
if( pData->mnMatchType & IMPL_FONT_ATTR_SYMBOL )
continue;
pFoundData = pData;
if( pData->mnMatchType & (IMPL_FONT_ATTR_DEFAULT|IMPL_FONT_ATTR_STANDARD) )
break;
}
if( pFoundData )
return pFoundData;
2001-06-29 14:29:24 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// finding any font is better than finding no font at all
it = maDevFontList.begin();
if( it != maDevFontList.end() )
pFoundData = (*it).second;
2001-06-29 14:29:24 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
return pFoundData;
}
2001-06-29 14:29:24 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// -----------------------------------------------------------------------
2001-06-29 14:29:24 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplDevFontList* ImplDevFontList::Clone( bool bScalable, bool bEmbeddable ) const
{
ImplDevFontList* pClonedList = new ImplDevFontList;
// pClonedList->mbMatchData = mbMatchData;
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
pClonedList->mbMapNames = mbMapNames;
pClonedList->mpPreMatchHook = mpPreMatchHook;
pClonedList->mpFallbackHook = mpFallbackHook;
2001-06-29 14:29:24 +00:00
// TODO: clone the config-font attributes too?
pClonedList->mbMatchData = false;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
DevFontList::const_iterator it = maDevFontList.begin();
for(; it != maDevFontList.end(); ++it )
{
const ImplDevFontListData* pFontFace = (*it).second;
pFontFace->UpdateCloneFontList( *pClonedList, bScalable, bEmbeddable );
}
2001-06-29 14:29:24 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
return pClonedList;
}
2001-06-29 14:29:24 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplGetDevFontList* ImplDevFontList::GetDevFontList() const
{
ImplGetDevFontList* pGetDevFontList = new ImplGetDevFontList;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
DevFontList::const_iterator it = maDevFontList.begin();
for(; it != maDevFontList.end(); ++it )
{
const ImplDevFontListData* pFontFamily = (*it).second;
pFontFamily->UpdateDevFontList( *pGetDevFontList );
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
return pGetDevFontList;
}
2001-06-29 14:29:24 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplGetDevSizeList* ImplDevFontList::GetDevSizeList( const String& rFontName ) const
{
ImplGetDevSizeList* pGetDevSizeList = new ImplGetDevSizeList( rFontName );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplDevFontListData* pFontFamily = FindFontFamily( rFontName );
if( pFontFamily != NULL )
{
std::set<int> rHeights;
pFontFamily->GetFontHeights( rHeights );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
std::set<int>::const_iterator it = rHeights.begin();
for(; it != rHeights.begin(); ++it )
pGetDevSizeList->Add( *it );
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
return pGetDevSizeList;
}
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// =======================================================================
2002-02-21 09:45:39 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplFontSelectData::ImplFontSelectData( const Font& rFont,
const String& rSearchName, const Size& rSize, float fExactHeight)
: maSearchName( rSearchName ),
mnWidth( rSize.Width() ),
mnHeight( rSize.Height() ),
mfExactHeight( fExactHeight),
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mnOrientation( rFont.GetOrientation() ),
meLanguage( rFont.GetLanguage() ),
mbVertical( rFont.IsVertical() ),
mbNonAntialiased( false ),
mpFontData( NULL ),
mpFontEntry( NULL )
{
maTargetName = maName;
rFont.GetFontAttributes( *this );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// normalize orientation between 0 and 3600
if( 3600 <= (unsigned)mnOrientation )
{
if( mnOrientation >= 0 )
mnOrientation %= 3600;
else
mnOrientation = 3600 - (-mnOrientation % 3600);
2000-09-18 16:07:07 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// normalize width and height
if( mnHeight < 0 )
mnHeight = -mnHeight;
if( mnWidth < 0 )
mnWidth = -mnWidth;
}
// -----------------------------------------------------------------------
ImplFontSelectData::ImplFontSelectData( const ImplFontData& rFontData,
const Size& rSize, float fExactHeight, int nOrientation, bool bVertical )
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
: ImplFontAttributes( rFontData ),
mnWidth( rSize.Width() ),
mnHeight( rSize.Height() ),
mfExactHeight( fExactHeight ),
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mnOrientation( nOrientation ),
meLanguage( 0 ),
mbVertical( bVertical ),
mbNonAntialiased( false ),
mpFontData( &rFontData ),
mpFontEntry( NULL )
{
maTargetName = maSearchName = maName;
// NOTE: no normalization for width/height/orientation
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
}
// =======================================================================
size_t ImplFontCache::IFSD_Hash::operator()( const ImplFontSelectData& rFSD ) const
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
{
// TODO: does it pay off to improve this hash function?
static FontNameHash aFontNameHash;
size_t nHash = aFontNameHash( rFSD.maSearchName );
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
#ifdef ENABLE_GRAPHITE
// check for features and generate a unique hash if necessary
if (rFSD.maTargetName.Search(grutils::GrFeatureParser::FEAT_PREFIX)
!= STRING_NOTFOUND)
{
nHash = aFontNameHash( rFSD.maTargetName );
}
#endif
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
nHash += 11 * rFSD.mnHeight;
nHash += 19 * rFSD.meWeight;
nHash += 29 * rFSD.meItalic;
nHash += 37 * rFSD.mnOrientation;
nHash += 41 * rFSD.meLanguage;
if( rFSD.mbVertical )
nHash += 53;
return nHash;
}
// -----------------------------------------------------------------------
bool ImplFontCache::IFSD_Equal::operator()(const ImplFontSelectData& rA, const ImplFontSelectData& rB) const
{
// check normalized font family name
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( rA.maSearchName != rB.maSearchName )
return false;
// check font transformation
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( (rA.mnHeight != rB.mnHeight)
|| (rA.mnWidth != rB.mnWidth)
|| (rA.mnOrientation != rB.mnOrientation) )
return false;
// check mapping relevant attributes
if( (rA.mbVertical != rB.mbVertical)
|| (rA.meLanguage != rB.meLanguage) )
return false;
// check font face attributes
if( (rA.meWeight != rB.meWeight)
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
|| (rA.meItalic != rB.meItalic)
// || (rA.meFamily != rB.meFamily) // TODO: remove this mostly obsolete member
|| (rA.mePitch != rB.mePitch) )
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
return false;
// check style name
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( rA.maStyleName != rB.maStyleName)
return false;
// Symbol fonts may recode from one type to another So they are only
// safely equivalent for equal targets
if (
(rA.mpFontData && rA.mpFontData->IsSymbolFont()) ||
(rB.mpFontData && rB.mpFontData->IsSymbolFont())
)
{
if (rA.maTargetName != rB.maTargetName)
return false;
}
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
#ifdef ENABLE_GRAPHITE
// check for features
if ((rA.maTargetName.Search(grutils::GrFeatureParser::FEAT_PREFIX)
!= STRING_NOTFOUND ||
rB.maTargetName.Search(grutils::GrFeatureParser::FEAT_PREFIX)
!= STRING_NOTFOUND) && rA.maTargetName != rB.maTargetName)
return false;
#endif
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
return true;
}
// -----------------------------------------------------------------------
ImplFontCache::ImplFontCache( bool bPrinter )
: mpFirstEntry( NULL ),
mnRef0Count( 0 ),
mbPrinter( bPrinter )
{}
// -----------------------------------------------------------------------
ImplFontCache::~ImplFontCache()
{
FontInstanceList::iterator it = maFontInstanceList.begin();
for(; it != maFontInstanceList.end(); ++it )
{
ImplFontEntry* pEntry = (*it).second;
delete pEntry;
}
}
// -----------------------------------------------------------------------
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList,
const Font& rFont, const Size& rSize, float fExactHeight, ImplDirectFontSubstitution* pDevSpecific )
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
{
String aSearchName = rFont.GetName();
// TODO: also add device specific name caching
if( !pDevSpecific )
{
// check if the requested font name is already known
// if it is already known get its normalized search name
FontNameList::const_iterator it_name = maFontNameList.find( aSearchName );
if( it_name != maFontNameList.end() )
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
if( !(*it_name).second.EqualsAscii( "hg", 0, 2)
#ifdef ENABLE_GRAPHITE
&& (aSearchName.Search(grutils::GrFeatureParser::FEAT_PREFIX)
== STRING_NOTFOUND)
#endif
)
aSearchName = (*it_name).second;
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// initialize internal font request object
ImplFontSelectData aFontSelData( rFont, aSearchName, rSize, fExactHeight );
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
return GetFontEntry( pFontList, aFontSelData, pDevSpecific );
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
// -----------------------------------------------------------------------
ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList,
ImplFontSelectData& aFontSelData, ImplDirectFontSubstitution* pDevSpecific )
{
// check if a directly matching logical font instance is already cached,
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// the most recently used font usually has a hit rate of >50%
ImplFontEntry *pEntry = NULL;
ImplDevFontListData* pFontFamily = NULL;
IFSD_Equal aIFSD_Equal;
if( mpFirstEntry && aIFSD_Equal( aFontSelData, mpFirstEntry->maFontSelData ) )
pEntry = mpFirstEntry;
else
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
FontInstanceList::iterator it = maFontInstanceList.find( aFontSelData );
if( it != maFontInstanceList.end() )
pEntry = (*it).second;
}
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( !pEntry ) // no direct cache hit
{
// find the best matching logical font family and update font selector accordingly
pFontFamily = pFontList->ImplFindByFont( aFontSelData, mbPrinter, pDevSpecific );
DBG_ASSERT( (pFontFamily != NULL), "ImplFontCache::Get() No logical font found!" );
if( pFontFamily )
aFontSelData.maSearchName = pFontFamily->GetSearchName();
2000-09-18 16:07:07 +00:00
// check if an indirectly matching logical font instance is already cached
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
FontInstanceList::iterator it = maFontInstanceList.find( aFontSelData );
if( it != maFontInstanceList.end() )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// we have an indirect cache hit
pEntry = (*it).second;
// cache the requested and the selected font names
// => next time there is a good chance for a direct cache hit
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// don't allow the cache to grow too big
// TODO: implement some fancy LRU caching?
if( maFontNameList.size() >= 4000 )
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
maFontNameList.clear();
// TODO: also add device specific name caching
if( !pDevSpecific )
if( aFontSelData.maName != aFontSelData.maSearchName )
maFontNameList[ aFontSelData.maName ] = aFontSelData.maSearchName;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
}
}
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( pEntry ) // cache hit => use existing font instance
{
// increase the font instance's reference count
if( !pEntry->mnRefCount++ )
--mnRef0Count;
}
else // no cache hit => create a new font instance
{
// find the best matching physical font face
ImplFontData* pFontData = pFontFamily->FindBestFontFace( aFontSelData );
aFontSelData.mpFontData = pFontData;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// create a new logical font instance from this physical font face
pEntry = pFontData->CreateFontInstance( aFontSelData );
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// if we found a different symbol font we need a symbol conversion table
if( pFontData->IsSymbolFont() )
if( aFontSelData.maTargetName != aFontSelData.maSearchName )
pEntry->mpConversion = ConvertChar::GetRecodeData( aFontSelData.maTargetName, aFontSelData.maSearchName );
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// add the new entry to the cache
maFontInstanceList[ aFontSelData ] = pEntry;
}
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mpFirstEntry = pEntry;
return pEntry;
}
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplDevFontListData* ImplDevFontList::ImplFindByFont( ImplFontSelectData& rFSD,
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
bool bPrinter, ImplDirectFontSubstitution* pDevSpecific ) const
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
{
// give up if no fonts are available
if( !Count() )
return NULL;
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// test if a font in the token list is available
// substitute the font if this was requested
USHORT nSubstFlags = FONT_SUBSTITUTE_ALWAYS;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if ( bPrinter )
nSubstFlags |= FONT_SUBSTITUTE_SCREENONLY;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
bool bMultiToken = false;
xub_StrLen nTokenPos = 0;
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
String& aSearchName = rFSD.maSearchName; // TODO: get rid of reference
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
for(;;)
{
rFSD.maTargetName = GetNextFontToken( rFSD.maName, nTokenPos );
aSearchName = rFSD.maTargetName;
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
#ifdef ENABLE_GRAPHITE
// Until features are properly supported, they are appended to the
// font name, so we need to strip them off so the font is found.
xub_StrLen nFeat = aSearchName.Search(grutils::GrFeatureParser::FEAT_PREFIX);
String aOrigName = rFSD.maTargetName;
String aBaseFontName(aSearchName, 0, (nFeat != STRING_NOTFOUND)?nFeat:aSearchName.Len());
if (nFeat != STRING_NOTFOUND && STRING_NOTFOUND !=
aSearchName.Search(grutils::GrFeatureParser::FEAT_ID_VALUE_SEPARATOR, nFeat))
{
aSearchName = aBaseFontName;
rFSD.maTargetName = aBaseFontName;
}
#endif
GetEnglishSearchFontName( aSearchName );
ImplFontSubstitute( aSearchName, nSubstFlags, pDevSpecific );
// #114999# special emboldening for Ricoh fonts
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
// TODO: smarter check for special cases by using PreMatch infrastructure?
if( (rFSD.meWeight > WEIGHT_MEDIUM)
&& aSearchName.EqualsAscii( "hg", 0, 2) )
{
String aBoldName;
if( aSearchName.EqualsAscii( "hggothicb", 0, 9) )
aBoldName = String(RTL_CONSTASCII_USTRINGPARAM("hggothice"));
else if( aSearchName.EqualsAscii( "hgpgothicb", 0, 10) )
aBoldName = String(RTL_CONSTASCII_USTRINGPARAM("hgpgothice"));
else if( aSearchName.EqualsAscii( "hgminchol", 0, 9) )
aBoldName = String(RTL_CONSTASCII_USTRINGPARAM("hgminchob"));
else if( aSearchName.EqualsAscii( "hgpminchol", 0, 10) )
aBoldName = String(RTL_CONSTASCII_USTRINGPARAM("hgpminchob"));
else if( aSearchName.EqualsAscii( "hgminchob" ) )
aBoldName = String(RTL_CONSTASCII_USTRINGPARAM("hgminchoe"));
else if( aSearchName.EqualsAscii( "hgpminchob" ) )
aBoldName = String(RTL_CONSTASCII_USTRINGPARAM("hgpminchoe"));
if( aBoldName.Len() && ImplFindBySearchName( aBoldName ) )
{
// the other font is available => use it
aSearchName = aBoldName;
// prevent synthetic emboldening of bold version
rFSD.meWeight = WEIGHT_DONTKNOW;
}
}
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
#ifdef ENABLE_GRAPHITE
// restore the features to make the font selection data unique
rFSD.maTargetName = aOrigName;
#endif
CWS-TOOLING: integrate CWS vcl99 2009-01-29 15:34:04 +0100 hdu r267149 : #i77520# fix AquaSalGraphics::GetGlyphBoundRect() result y-sign 2009-01-29 10:14:23 +0100 hdu r267099 : #i77520# implement AquaSalGraphics::GetGlyphBoundRect() 2009-01-28 17:31:17 +0100 hdu r267071 : #i79046# restore MultiSalLayout components after drawing them 2009-01-28 12:02:19 +0100 tl r267050 : #78466# default curreny listbox for Arabic builds fixed 2009-01-28 11:54:21 +0100 tl r267049 : #78466# default curreny listbox for Arabic builds fixed 2009-01-28 11:43:44 +0100 tl r267047 : #78466# default curreny listbox for Arabic builds fixed 2009-01-28 11:17:42 +0100 tl r267041 : #78466# default curreny listbox for Arabic builds fixed 2009-01-28 11:14:30 +0100 tl r267038 : #78466# default curreny listbox for Arabic builds fixed 2009-01-28 10:33:03 +0100 tl r267032 : #i72073# auto spellcheck markups in RTL context fixed 2009-01-28 09:26:00 +0100 tl r267027 : #78466# default curreny listbox for Arabic builds fixed 2009-01-28 09:25:31 +0100 tl r267026 : #78466# default curreny listbox for Arabic builds fixed 2009-01-27 16:55:14 +0100 tl r267009 : #78466# default curreny listbox for Arabic builds fixed 2009-01-27 16:54:46 +0100 tl r267008 : #78466# default curreny listbox for Arabic builds fixed 2009-01-27 16:52:23 +0100 tl r267007 : #78466# default curreny listbox for Arabic builds fixed 2009-01-27 16:46:52 +0100 tl r267006 : #i72073# auto spellcheck markups in RTL context fixed 2009-01-27 11:53:53 +0100 pl r266975 : #i98515# fix a buffer overflow 2009-01-26 19:13:28 +0100 pl r266946 : #i98119# add static vcl object helper 2009-01-26 18:11:06 +0100 pl r266940 : #i94040# catch a corner case (thanks af) 2009-01-23 10:54:42 +0100 pl r266793 : #i92102# fix some RTL UI issues 2009-01-23 10:53:35 +0100 pl r266790 : #i98169# one more case of DrawWaveLine 2009-01-23 08:38:32 +0100 hdu r266768 : #i98139# prefer Tools->Options->FontSubstitution over PreMatchHook 2009-01-21 17:30:57 +0100 pl r266694 : #i92102# adjust spin buttons 2009-01-21 13:54:16 +0100 pl r266667 : #i97130# add Click handler 2009-01-21 13:32:47 +0100 os r266662 : #158646# set SwWrtShell in C'tor of SwIndexMarkDlg 2009-01-21 12:14:03 +0100 pl r266649 : #i98196# fix autospellchecking in writer 2009-01-19 14:25:28 +0100 pl r266497 : #i97130# implement functionality of ExplainButton
2009-02-17 10:33:03 +00:00
// check if the current font name token or its substitute is valid
ImplDevFontListData* pFoundData = ImplFindBySearchName( aSearchName );
if( pFoundData )
return pFoundData;
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
// some systems provide special customization
// e.g. they suggest "serif" as UI-font, but this name cannot be used directly
// because the system wants to map it to another font first, e.g. "Helvetica"
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
#ifdef ENABLE_GRAPHITE
// use the target name to search in the prematch hook
rFSD.maTargetName = aBaseFontName;
#endif
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
if( mpPreMatchHook )
if( mpPreMatchHook->FindFontSubstitute( rFSD ) )
GetEnglishSearchFontName( aSearchName );
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
#ifdef ENABLE_GRAPHITE
// the prematch hook uses the target name to search, but we now need
// to restore the features to make the font selection data unique
rFSD.maTargetName = aOrigName;
#endif
pFoundData = ImplFindBySearchName( aSearchName );
if( pFoundData )
return pFoundData;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
// break after last font name token was checked unsuccessfully
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( nTokenPos == STRING_NOTFOUND)
break;
bMultiToken = true;
}
// if the first font was not available find the next available font in
// the semicolon separated list of font names. A font is also considered
// available when there is a matching entry in the Tools->Options->Fonts
// dialog witho neither ALWAYS nor SCREENONLY flags set and the substitution
// font is available
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
for( nTokenPos = 0; nTokenPos != STRING_NOTFOUND; )
{
if( bMultiToken )
{
rFSD.maTargetName = GetNextFontToken( rFSD.maName, nTokenPos );
aSearchName = rFSD.maTargetName;
GetEnglishSearchFontName( aSearchName );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
}
else
nTokenPos = STRING_NOTFOUND;
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
if( mpPreMatchHook )
if( mpPreMatchHook->FindFontSubstitute( rFSD ) )
GetEnglishSearchFontName( aSearchName );
ImplFontSubstitute( aSearchName, nSubstFlags, pDevSpecific );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplDevFontListData* pFoundData = ImplFindBySearchName( aSearchName );
if( pFoundData )
return pFoundData;
}
// if no font with a directly matching name is available use the
// first font name token and get its attributes to find a replacement
if ( bMultiToken )
{
nTokenPos = 0;
rFSD.maTargetName = GetNextFontToken( rFSD.maName, nTokenPos );
aSearchName = rFSD.maTargetName;
GetEnglishSearchFontName( aSearchName );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
}
String aSearchShortName;
String aSearchFamilyName;
FontWeight eSearchWeight = rFSD.meWeight;
FontWidth eSearchWidth = rFSD.meWidthType;
ULONG nSearchType = 0;
FontSubstConfiguration::getMapName( aSearchName, aSearchShortName, aSearchFamilyName,
eSearchWeight, eSearchWidth, nSearchType );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// note: the search name was already translated to english (if possible)
// use the font's shortened name if needed
if ( aSearchShortName != aSearchName )
{
ImplDevFontListData* pFoundData = ImplFindBySearchName( aSearchShortName );
if( pFoundData )
{
#ifdef UNX
/* #96738# don't use mincho as an replacement for "MS Mincho" on X11: Mincho is
a korean bitmap font that is not suitable here. Use the font replacement table,
that automatically leads to the desired "HG Mincho Light J". Same story for
MS Gothic, there are thai and korean "Gothic" fonts, so we even prefer Andale */
static String aMS_Mincho( RTL_CONSTASCII_USTRINGPARAM("msmincho") );
static String aMS_Gothic( RTL_CONSTASCII_USTRINGPARAM("msgothic") );
if ((aSearchName != aMS_Mincho) && (aSearchName != aMS_Gothic))
// TODO: add heuristic to only throw out the fake ms* fonts
#endif
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
return pFoundData;
2000-09-18 16:07:07 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
}
}
// use font fallback
const FontNameAttr* pFontAttr = NULL;
if( aSearchName.Len() )
{
// get fallback info using FontSubstConfiguration and
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// the target name, it's shortened name and family name in that order
const FontSubstConfiguration& rFontSubst = *FontSubstConfiguration::get();
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
pFontAttr = rFontSubst.getSubstInfo( aSearchName );
if ( !pFontAttr && (aSearchShortName != aSearchName) )
pFontAttr = rFontSubst.getSubstInfo( aSearchShortName );
if ( !pFontAttr && (aSearchFamilyName != aSearchShortName) )
pFontAttr = rFontSubst.getSubstInfo( aSearchFamilyName );
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// try the font substitutions suggested by the fallback info
if( pFontAttr )
{
ImplDevFontListData* pFoundData = ImplFindBySubstFontAttr( *pFontAttr );
if( pFoundData )
return pFoundData;
2000-09-18 16:07:07 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
}
2001-06-29 14:29:24 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// if a target symbol font is not available use a default symbol font
if( rFSD.IsSymbolFont() )
{
com::sun::star::lang::Locale aDefaultLocale( OUString( RTL_CONSTASCII_USTRINGPARAM("en") ), OUString(), OUString() );
aSearchName = DefaultFontConfiguration::get()->getDefaultFont( aDefaultLocale, DEFAULTFONT_SYMBOL );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplDevFontListData* pFoundData = ImplFindByTokenNames( aSearchName );
if( pFoundData )
return pFoundData;
2000-09-18 16:07:07 +00:00
}
// now try the other font name tokens
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
while( nTokenPos != STRING_NOTFOUND )
{
rFSD.maTargetName = GetNextFontToken( rFSD.maName, nTokenPos );
if( !rFSD.maTargetName.Len() )
continue;
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
aSearchName = rFSD.maTargetName;
GetEnglishSearchFontName( aSearchName );
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
String aTempShortName;
String aTempFamilyName;
ULONG nTempType = 0;
FontWeight eTempWeight = rFSD.meWeight;
FontWidth eTempWidth = WIDTH_DONTKNOW;
FontSubstConfiguration::getMapName( aSearchName, aTempShortName, aTempFamilyName,
eTempWeight, eTempWidth, nTempType );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// use a shortend token name if available
if( aTempShortName != aSearchName )
{
ImplDevFontListData* pFoundData = ImplFindBySearchName( aTempShortName );
if( pFoundData )
return pFoundData;
}
// use a font name from font fallback list to determine font attributes
// get fallback info using FontSubstConfiguration and
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// the target name, it's shortened name and family name in that order
const FontSubstConfiguration& rFontSubst = *FontSubstConfiguration::get();
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
const FontNameAttr* pTempFontAttr = rFontSubst.getSubstInfo( aSearchName );
if ( !pTempFontAttr && (aTempShortName != aSearchName) )
pTempFontAttr = rFontSubst.getSubstInfo( aTempShortName );
if ( !pTempFontAttr && (aTempFamilyName != aTempShortName) )
pTempFontAttr = rFontSubst.getSubstInfo( aTempFamilyName );
// try the font substitutions suggested by the fallback info
if( pTempFontAttr )
{
ImplDevFontListData* pFoundData = ImplFindBySubstFontAttr( *pTempFontAttr );
if( pFoundData )
return pFoundData;
if( !pFontAttr )
pFontAttr = pTempFontAttr;
}
}
// if still needed use the alias names of the installed fonts
if( mbMapNames )
{
ImplDevFontListData* pFoundData = ImplFindByAliasName( rFSD.maTargetName, aSearchShortName );
if( pFoundData )
return pFoundData;
}
// if still needed use the font request's attributes to find a good match
switch( rFSD.meLanguage )
{
case LANGUAGE_CHINESE:
case LANGUAGE_CHINESE_SIMPLIFIED:
case LANGUAGE_CHINESE_SINGAPORE:
nSearchType |= IMPL_FONT_ATTR_CJK | IMPL_FONT_ATTR_CJK_SC;
break;
case LANGUAGE_CHINESE_TRADITIONAL:
case LANGUAGE_CHINESE_HONGKONG:
case LANGUAGE_CHINESE_MACAU:
nSearchType |= IMPL_FONT_ATTR_CJK | IMPL_FONT_ATTR_CJK_TC;
break;
case LANGUAGE_KOREAN:
case LANGUAGE_KOREAN_JOHAB:
nSearchType |= IMPL_FONT_ATTR_CJK | IMPL_FONT_ATTR_CJK_KR;
break;
case LANGUAGE_JAPANESE:
nSearchType |= IMPL_FONT_ATTR_CJK | IMPL_FONT_ATTR_CJK_JP;
break;
default:
nSearchType |= ImplIsCJKFont( rFSD.maName );
if( rFSD.IsSymbolFont() )
nSearchType |= IMPL_FONT_ATTR_SYMBOL;
break;
}
ImplCalcType( nSearchType, eSearchWeight, eSearchWidth, rFSD.meFamily, pFontAttr );
ImplDevFontListData* pFoundData = ImplFindByAttributes( nSearchType,
eSearchWeight, eSearchWidth, rFSD.meFamily, rFSD.meItalic, aSearchFamilyName );
if( pFoundData )
{
// overwrite font selection attributes using info from the typeface flags
if( (eSearchWeight >= WEIGHT_BOLD)
&& (eSearchWeight > rFSD.meWeight)
&& (pFoundData->mnTypeFaces & IMPL_DEVFONT_BOLD) )
rFSD.meWeight = eSearchWeight;
else if( (eSearchWeight < WEIGHT_NORMAL)
&& (eSearchWeight < rFSD.meWeight)
&& (eSearchWeight != WEIGHT_DONTKNOW)
&& (pFoundData->mnTypeFaces & IMPL_DEVFONT_LIGHT) )
rFSD.meWeight = eSearchWeight;
if( (nSearchType & IMPL_FONT_ATTR_ITALIC)
&& ((rFSD.meItalic == ITALIC_DONTKNOW) || (rFSD.meItalic == ITALIC_NONE))
&& (pFoundData->mnTypeFaces & IMPL_DEVFONT_ITALIC) )
rFSD.meItalic = ITALIC_NORMAL;
}
else
{
// if still needed fall back to default fonts
pFoundData = FindDefaultFont();
}
return pFoundData;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
ImplFontEntry* ImplFontCache::GetGlyphFallbackFont( ImplDevFontList* pFontList,
ImplFontSelectData& rFontSelData, int nFallbackLevel, rtl::OUString& rMissingCodes )
{
// get a candidate font for glyph fallback
// unless the previously selected font got a device specific substitution
// e.g. PsPrint Arial->Helvetica for udiaeresis when Helvetica doesn't support it
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
if( nFallbackLevel >= 1)
{
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
ImplDevFontListData* pFallbackData = pFontList->GetGlyphFallbackFont(
rFontSelData, rMissingCodes, nFallbackLevel-1 );
// escape when there are no font candidates
if( !pFallbackData )
return NULL;
// override the font name
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
rFontSelData.maName = pFallbackData->GetFamilyName();
// clear the cached normalized name
rFontSelData.maSearchName = String();
}
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
// get device font without doing device specific substitutions
ImplFontEntry* pFallbackFont = GetFontEntry( pFontList, rFontSelData, NULL );
return pFallbackFont;
}
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
void ImplFontCache::Release( ImplFontEntry* pEntry )
{
static const int FONTCACHE_MAX = 50;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
DBG_ASSERT( (pEntry->mnRefCount > 0), "ImplFontCache::Release() - font refcount underflow" );
if( --pEntry->mnRefCount > 0 )
return;
if( ++mnRef0Count < FONTCACHE_MAX )
return;
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// remove unused entries from font instance cache
FontInstanceList::iterator it_next = maFontInstanceList.begin();
while( it_next != maFontInstanceList.end() )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
FontInstanceList::iterator it = it_next++;
ImplFontEntry* pFontEntry = (*it).second;
if( pFontEntry->mnRefCount > 0 )
continue;
maFontInstanceList.erase( it );
delete pFontEntry;
--mnRef0Count;
DBG_ASSERT( (mnRef0Count>=0), "ImplFontCache::Release() - refcount0 underflow" );
if( mpFirstEntry == pFontEntry )
mpFirstEntry = NULL;
2000-09-18 16:07:07 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
DBG_ASSERT( (mnRef0Count==0), "ImplFontCache::Release() - refcount0 mismatch" );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
void ImplFontCache::Invalidate()
2000-09-18 16:07:07 +00:00
{
// delete unreferenced entries
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
FontInstanceList::iterator it = maFontInstanceList.begin();
for(; it != maFontInstanceList.end(); ++it )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplFontEntry* pFontEntry = (*it).second;
if( pFontEntry->mnRefCount > 0 )
continue;
delete pFontEntry;
--mnRef0Count;
2000-09-18 16:07:07 +00:00
}
// #112304# make sure the font cache is really clean
mpFirstEntry = NULL;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
maFontInstanceList.clear();
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
DBG_ASSERT( (mnRef0Count==0), "ImplFontCache::Invalidate() - mnRef0Count non-zero" );
#ifdef USE_BUILTIN_RASTERIZER
// TODO: eventually move into SalGraphics layer
GlyphCache::GetInstance().InvalidateAllGlyphs();
#endif
2000-09-18 16:07:07 +00:00
}
// =======================================================================
ImplMultiTextLineInfo::ImplMultiTextLineInfo()
{
mpLines = new PImplTextLineInfo[MULTITEXTLINEINFO_RESIZE];
mnLines = 0;
mnSize = MULTITEXTLINEINFO_RESIZE;
2000-09-18 16:07:07 +00:00
}
2002-04-23 06:40:42 +00:00
2000-09-18 16:07:07 +00:00
ImplMultiTextLineInfo::~ImplMultiTextLineInfo()
{
for ( xub_StrLen i = 0; i < mnLines; i++ )
delete mpLines[i];
2002-07-01 07:23:34 +00:00
delete [] mpLines;
2000-09-18 16:07:07 +00:00
}
void ImplMultiTextLineInfo::AddLine( ImplTextLineInfo* pLine )
{
if ( mnSize == mnLines )
{
mnSize += MULTITEXTLINEINFO_RESIZE;
PImplTextLineInfo* pNewLines = new PImplTextLineInfo[mnSize];
memcpy( pNewLines, mpLines, mnLines*sizeof(PImplTextLineInfo) );
mpLines = pNewLines;
}
mpLines[mnLines] = pLine;
mnLines++;
}
void ImplMultiTextLineInfo::Clear()
{
for ( xub_StrLen i = 0; i < mnLines; i++ )
delete mpLines[i];
mnLines = 0;
}
// =======================================================================
FontEmphasisMark OutputDevice::ImplGetEmphasisMarkStyle( const Font& rFont )
2001-02-23 15:13:58 +00:00
{
FontEmphasisMark nEmphasisMark = rFont.GetEmphasisMark();
// If no Position is set, then calculate the default position, which
// depends on the language
if ( !(nEmphasisMark & (EMPHASISMARK_POS_ABOVE | EMPHASISMARK_POS_BELOW)) )
{
LanguageType eLang = rFont.GetLanguage();
// In Chinese Simplified the EmphasisMarks are below/left
2001-02-23 17:17:44 +00:00
if ( (eLang == LANGUAGE_CHINESE_SIMPLIFIED) ||
2001-02-23 15:13:58 +00:00
(eLang == LANGUAGE_CHINESE_SINGAPORE) )
nEmphasisMark |= EMPHASISMARK_POS_BELOW;
else
{
eLang = rFont.GetCJKContextLanguage();
// In Chinese Simplified the EmphasisMarks are below/left
2001-02-23 17:17:44 +00:00
if ( (eLang == LANGUAGE_CHINESE_SIMPLIFIED) ||
2001-02-23 15:13:58 +00:00
(eLang == LANGUAGE_CHINESE_SINGAPORE) )
nEmphasisMark |= EMPHASISMARK_POS_BELOW;
else
nEmphasisMark |= EMPHASISMARK_POS_ABOVE;
}
}
return nEmphasisMark;
}
2001-02-23 17:17:44 +00:00
// -----------------------------------------------------------------------
BOOL OutputDevice::ImplIsUnderlineAbove( const Font& rFont )
2001-02-23 17:17:44 +00:00
{
if ( !rFont.IsVertical() )
return FALSE;
if( (LANGUAGE_JAPANESE == rFont.GetLanguage())
|| (LANGUAGE_JAPANESE == rFont.GetCJKContextLanguage()) )
// the underline is right for Japanese only
return TRUE;
2001-02-23 17:17:44 +00:00
return FALSE;
2001-02-23 17:17:44 +00:00
}
2001-02-23 15:13:58 +00:00
// =======================================================================
void OutputDevice::ImplInitFontList() const
{
if( ! mpFontList->Count() )
{
if( mpGraphics || ImplGetGraphics() )
{
RTL_LOGFILE_CONTEXT( aLog, "OutputDevice::ImplInitFontList()" );
mpGraphics->GetDevFontList( mpFontList );
}
}
if( meOutDevType == OUTDEV_WINDOW && ! mpFontList->Count() )
{
String aError( RTL_CONSTASCII_USTRINGPARAM( "Application error: no fonts and no vcl resource found on your system" ) );
ResMgr* pMgr = ImplGetResMgr();
if( pMgr )
{
String aResStr( ResId( SV_ACCESSERROR_NO_FONTS, *pMgr ) );
if( aResStr.Len() )
aError = aResStr;
}
Application::Abort( aError );
}
}
// =======================================================================
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
void OutputDevice::ImplInitFont() const
2000-09-18 16:07:07 +00:00
{
DBG_TESTSOLARMUTEX();
if ( mbInitFont )
{
if ( meOutDevType != OUTDEV_PRINTER )
{
// decide if antialiasing is appropriate
bool bNonAntialiased = (GetAntialiasing() & ANTIALIASING_DISABLE_TEXT) != 0;
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
bNonAntialiased |= ((rStyleSettings.GetDisplayOptions() & DISPLAY_OPTION_AA_DISABLE) != 0);
bNonAntialiased |= (int(rStyleSettings.GetAntialiasingMinPixelHeight()) > mpFontEntry->maFontSelData.mnHeight);
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mpFontEntry->maFontSelData.mbNonAntialiased = bNonAntialiased;
}
2001-02-27 14:38:55 +00:00
if( !mpPDFWriter || !mpPDFWriter->isBuiltinFont( mpFontEntry->maFontSelData.mpFontData ) )
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// select font in the device layers
mpFontEntry->mnSetFontFlags = mpGraphics->SetFont( &(mpFontEntry->maFontSelData), 0 );
2002-07-20 14:54:30 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mbInitFont = false;
2000-09-18 16:07:07 +00:00
}
}
// -----------------------------------------------------------------------
void OutputDevice::ImplInitTextColor()
{
DBG_TESTSOLARMUTEX();
if ( mbInitTextColor )
{
mpGraphics->SetTextColor( ImplColorToSal( GetTextColor() ) );
mbInitTextColor = FALSE;
}
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
bool OutputDevice::ImplNewFont() const
2000-09-18 16:07:07 +00:00
{
DBG_TESTSOLARMUTEX();
2002-07-20 14:54:30 +00:00
// get correct font list on the PDF writer if necessary
if( mpPDFWriter )
2002-07-20 14:54:30 +00:00
{
const ImplSVData* pSVData = ImplGetSVData();
if( mpFontList == pSVData->maGDIData.mpScreenFontList
|| mpFontCache == pSVData->maGDIData.mpScreenFontCache )
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
const_cast<OutputDevice&>(*this).ImplUpdateFontData( true );
2002-07-20 14:54:30 +00:00
}
2000-09-18 16:07:07 +00:00
if ( !mbNewFont )
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
return true;
2000-09-18 16:07:07 +00:00
// we need a graphics
if ( !mpGraphics && !ImplGetGraphics() )
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
return false;
2000-09-18 16:07:07 +00:00
SalGraphics* pGraphics = mpGraphics;
ImplInitFontList();
2000-09-18 16:07:07 +00:00
// convert to pixel height
// TODO: replace integer based aSize completely with subpixel accurate type
float fExactHeight = ImplFloatLogicHeightToDevicePixel( static_cast<float>(maFont.GetHeight()) );
2000-09-18 16:07:07 +00:00
Size aSize = ImplLogicToDevicePixel( maFont.GetSize() );
if ( !aSize.Height() )
{
// use default pixel height only when logical height is zero
2000-09-18 16:07:07 +00:00
if ( maFont.GetSize().Height() )
aSize.Height() = 1;
else
aSize.Height() = (12*mnDPIY)/72;
fExactHeight = static_cast<float>(aSize.Height());
2000-09-18 16:07:07 +00:00
}
// select the default width only when logical width is zero
if( (0 == aSize.Width()) && (0 != maFont.GetSize().Width()) )
aSize.Width() = 1;
// get font entry
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
ImplDirectFontSubstitution* pDevSpecificSubst = NULL;
if( mpOutDevData )
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
pDevSpecificSubst = &mpOutDevData->maDevFontSubst;
2000-09-18 16:07:07 +00:00
ImplFontEntry* pOldEntry = mpFontEntry;
mpFontEntry = mpFontCache->GetFontEntry( mpFontList, maFont, aSize, fExactHeight, pDevSpecificSubst );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( pOldEntry )
mpFontCache->Release( pOldEntry );
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplFontEntry* pFontEntry = mpFontEntry;
// mark when lower layers need to get involved
mbNewFont = FALSE;
if( pFontEntry != pOldEntry )
2000-09-18 16:07:07 +00:00
mbInitFont = TRUE;
// select font when it has not been initialized yet
2000-09-18 16:07:07 +00:00
if ( !pFontEntry->mbInit )
{
ImplInitFont();
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// get metric data from device layers
2000-09-18 16:07:07 +00:00
if ( pGraphics )
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
pFontEntry->mbInit = true;
2002-07-20 14:54:30 +00:00
pFontEntry->maMetric.mnOrientation = sal::static_int_cast<short>(pFontEntry->maFontSelData.mnOrientation);
2002-07-20 14:54:30 +00:00
if( mpPDFWriter && mpPDFWriter->isBuiltinFont( pFontEntry->maFontSelData.mpFontData ) )
mpPDFWriter->getFontMetric( &pFontEntry->maFontSelData, &(pFontEntry->maMetric) );
else
pGraphics->GetFontMetric( &(pFontEntry->maMetric) );
2000-09-18 16:07:07 +00:00
pFontEntry->maMetric.ImplInitTextLineSize( this );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
pFontEntry->maMetric.ImplInitAboveTextLineSize();
pFontEntry->mnLineHeight = pFontEntry->maMetric.mnAscent + pFontEntry->maMetric.mnDescent;
2000-09-18 16:07:07 +00:00
if( pFontEntry->maFontSelData.mnOrientation
&& !pFontEntry->maMetric.mnOrientation
&& (meOutDevType != OUTDEV_PRINTER) )
2000-09-18 16:07:07 +00:00
{
pFontEntry->mnOwnOrientation = sal::static_int_cast<short>(pFontEntry->maFontSelData.mnOrientation);
2000-09-18 16:07:07 +00:00
pFontEntry->mnOrientation = pFontEntry->mnOwnOrientation;
}
else
pFontEntry->mnOrientation = pFontEntry->maMetric.mnOrientation;
}
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// enable kerning array if requested
2001-03-23 10:45:44 +00:00
if ( maFont.GetKerning() & KERNING_FONTSPECIFIC )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// TODO: test if physical font supports kerning and disable if not
if( pFontEntry->maMetric.mbKernableFont )
mbKerning = true;
2000-09-18 16:07:07 +00:00
}
else
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mbKerning = false;
2001-03-23 10:45:44 +00:00
if ( maFont.GetKerning() & KERNING_ASIAN )
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mbKerning = true;
2000-09-18 16:07:07 +00:00
// calculate EmphasisArea
2001-02-23 15:13:58 +00:00
mnEmphasisAscent = 0;
mnEmphasisDescent = 0;
if ( maFont.GetEmphasisMark() & EMPHASISMARK_STYLE )
{
FontEmphasisMark nEmphasisMark = ImplGetEmphasisMarkStyle( maFont );
long nEmphasisHeight = (pFontEntry->mnLineHeight*250)/1000;
2001-02-23 15:13:58 +00:00
if ( nEmphasisHeight < 1 )
nEmphasisHeight = 1;
if ( nEmphasisMark & EMPHASISMARK_POS_BELOW )
mnEmphasisDescent = nEmphasisHeight;
else
mnEmphasisAscent = nEmphasisHeight;
}
// calculate text offset depending on TextAlignment
2000-09-18 16:07:07 +00:00
TextAlign eAlign = maFont.GetAlign();
if ( eAlign == ALIGN_BASELINE )
{
mnTextOffX = 0;
mnTextOffY = 0;
}
else if ( eAlign == ALIGN_TOP )
{
mnTextOffX = 0;
mnTextOffY = +pFontEntry->maMetric.mnAscent + mnEmphasisAscent;
if ( pFontEntry->mnOrientation )
ImplRotatePos( 0, 0, mnTextOffX, mnTextOffY, pFontEntry->mnOrientation );
2000-09-18 16:07:07 +00:00
}
else // eAlign == ALIGN_BOTTOM
{
mnTextOffX = 0;
mnTextOffY = -pFontEntry->maMetric.mnDescent + mnEmphasisDescent;
if ( pFontEntry->mnOrientation )
ImplRotatePos( 0, 0, mnTextOffX, mnTextOffY, pFontEntry->mnOrientation );
2000-09-18 16:07:07 +00:00
}
mbTextLines = ((maFont.GetUnderline() != UNDERLINE_NONE) && (maFont.GetUnderline() != UNDERLINE_DONTKNOW)) ||
((maFont.GetOverline() != UNDERLINE_NONE) && (maFont.GetOverline() != UNDERLINE_DONTKNOW)) ||
2000-09-18 16:07:07 +00:00
((maFont.GetStrikeout() != STRIKEOUT_NONE) && (maFont.GetStrikeout() != STRIKEOUT_DONTKNOW));
2001-02-23 15:13:58 +00:00
mbTextSpecial = maFont.IsShadow() || maFont.IsOutline() ||
(maFont.GetRelief() != RELIEF_NONE);
2000-09-18 16:07:07 +00:00
// #95414# fix for OLE objects which use scale factors very creatively
if( mbMap && !aSize.Width() )
{
int nOrigWidth = pFontEntry->maMetric.mnWidth;
float fStretch = (float)maMapRes.mnMapScNumX * maMapRes.mnMapScDenomY;
fStretch /= (float)maMapRes.mnMapScNumY * maMapRes.mnMapScDenomX;
int nNewWidth = (int)(nOrigWidth * fStretch + 0.5);
if( (nNewWidth != nOrigWidth) && (nNewWidth != 0) )
{
Size aOrigSize = maFont.GetSize();
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
const_cast<Font&>(maFont).SetSize( Size( nNewWidth, aSize.Height() ) );
mbMap = FALSE;
mbNewFont = TRUE;
ImplNewFont(); // recurse once using stretched width
mbMap = TRUE;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
const_cast<Font&>(maFont).SetSize( aOrigSize );
}
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
return true;
}
// -----------------------------------------------------------------------
long OutputDevice::ImplGetTextWidth( const SalLayout& rSalLayout ) const
2000-09-18 16:07:07 +00:00
{
2002-04-23 06:40:42 +00:00
long nWidth = rSalLayout.GetTextWidth();
nWidth /= rSalLayout.GetUnitsPerPixel();
2000-09-18 16:07:07 +00:00
return nWidth;
}
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawTextRect( long nBaseX, long nBaseY,
long nDistX, long nDistY, long nWidth, long nHeight )
2000-09-18 16:07:07 +00:00
{
long nX = nDistX;
long nY = nDistY;
short nOrientation = mpFontEntry->mnOrientation;
if ( nOrientation )
2000-09-18 16:07:07 +00:00
{
// Rotate rect without rounding problems for 90 degree rotations
if ( !(nOrientation % 900) )
2000-09-18 16:07:07 +00:00
{
if ( nOrientation == 900 )
{
long nTemp = nX;
nX = nY;
nY = -nTemp;
nTemp = nWidth;
nWidth = nHeight;
nHeight = nTemp;
nY -= nHeight;
}
else if ( nOrientation == 1800 )
{
nX = -nX;
nY = -nY;
nX -= nWidth;
nY -= nHeight;
}
else /* ( nOrientation == 2700 ) */
{
long nTemp = nX;
nX = -nY;
nY = nTemp;
nTemp = nWidth;
nWidth = nHeight;
nHeight = nTemp;
nX -= nWidth;
}
2000-09-18 16:07:07 +00:00
}
else
{
nX += nBaseX;
nY += nBaseY;
2002-04-23 06:40:42 +00:00
// inflate because polygons are drawn smaller
Rectangle aRect( Point( nX, nY ), Size( nWidth+1, nHeight+1 ) );
2000-09-18 16:07:07 +00:00
Polygon aPoly( aRect );
aPoly.Rotate( Point( nBaseX, nBaseY ), mpFontEntry->mnOrientation );
ImplDrawPolygon( aPoly );
return;
}
}
nX += nBaseX;
nY += nBaseY;
2002-08-29 14:42:38 +00:00
mpGraphics->DrawRect( nX, nY, nWidth, nHeight, this );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
2002-04-23 06:40:42 +00:00
void OutputDevice::ImplDrawTextBackground( const SalLayout& rSalLayout )
2000-09-18 16:07:07 +00:00
{
const long nWidth = rSalLayout.GetTextWidth() / rSalLayout.GetUnitsPerPixel();
const Point aBase = rSalLayout.DrawBase();
const long nX = aBase.X();
const long nY = aBase.Y();
2002-04-23 06:40:42 +00:00
2000-09-18 16:07:07 +00:00
if ( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
mbInitLineColor = TRUE;
}
mpGraphics->SetFillColor( ImplColorToSal( GetTextFillColor() ) );
mbInitFillColor = TRUE;
ImplDrawTextRect( nX, nY, 0, -(mpFontEntry->maMetric.mnAscent + mnEmphasisAscent),
2002-04-23 06:40:42 +00:00
nWidth,
2001-02-23 15:13:58 +00:00
mpFontEntry->mnLineHeight+mnEmphasisAscent+mnEmphasisDescent );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
2002-04-23 06:40:42 +00:00
Rectangle OutputDevice::ImplGetTextBoundRect( const SalLayout& rSalLayout )
2000-09-18 16:07:07 +00:00
{
2002-04-23 06:40:42 +00:00
Point aPoint = rSalLayout.GetDrawPosition();
long nX = aPoint.X();
long nY = aPoint.Y();
2000-09-18 16:07:07 +00:00
2002-04-23 06:40:42 +00:00
long nWidth = rSalLayout.GetTextWidth();
long nHeight = mpFontEntry->mnLineHeight + mnEmphasisAscent + mnEmphasisDescent;
2000-09-18 16:07:07 +00:00
2002-04-23 06:40:42 +00:00
nY -= mpFontEntry->maMetric.mnAscent + mnEmphasisAscent;
2000-09-18 16:07:07 +00:00
if ( mpFontEntry->mnOrientation )
{
long nBaseX = nX, nBaseY = nY;
2000-09-18 16:07:07 +00:00
if ( !(mpFontEntry->mnOrientation % 900) )
{
long nX2 = nX+nWidth;
long nY2 = nY+nHeight;
ImplRotatePos( nBaseX, nBaseY, nX, nY, mpFontEntry->mnOrientation );
ImplRotatePos( nBaseX, nBaseY, nX2, nY2, mpFontEntry->mnOrientation );
nWidth = nX2-nX;
nHeight = nY2-nY;
}
else
{
2002-04-23 06:40:42 +00:00
// inflate by +1+1 because polygons are drawn smaller
Rectangle aRect( Point( nX, nY ), Size( nWidth+1, nHeight+1 ) );
2000-09-18 16:07:07 +00:00
Polygon aPoly( aRect );
aPoly.Rotate( Point( nBaseX, nBaseY ), mpFontEntry->mnOrientation );
return aPoly.GetBoundRect();
}
}
return Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) );
}
// -----------------------------------------------------------------------
void OutputDevice::ImplInitTextLineSize()
{
mpFontEntry->maMetric.ImplInitTextLineSize( this );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
}
// -----------------------------------------------------------------------
void OutputDevice::ImplInitAboveTextLineSize()
{
mpFontEntry->maMetric.ImplInitAboveTextLineSize();
}
// -----------------------------------------------------------------------
ImplFontMetricData::ImplFontMetricData( const ImplFontSelectData& rFontSelData )
: ImplFontAttributes( rFontSelData )
{
// initialize the members provided by the font request
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mnWidth = rFontSelData.mnWidth;
mnOrientation = sal::static_int_cast<short>(rFontSelData.mnOrientation);
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// intialize the used font name
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( rFontSelData.mpFontData )
{
maName = rFontSelData.mpFontData->maName;
maStyleName= rFontSelData.mpFontData->maStyleName;
mbDevice = rFontSelData.mpFontData->mbDevice;
mbKernableFont = true;
}
else
{
xub_StrLen nTokenPos = 0;
maName = GetNextFontToken( rFontSelData.maName, nTokenPos );
maStyleName= rFontSelData.maStyleName;
mbDevice = false;
mbKernableFont = false;
}
// reset metrics that are usually measured for the font instance
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mnAscent = 0;
mnDescent = 0;
mnIntLeading = 0;
mnExtLeading = 0;
mnSlant = 0;
mnMinKashida = 0;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// reset metrics that are usually derived from the measurements
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mnUnderlineSize = 0;
mnUnderlineOffset = 0;
mnBUnderlineSize = 0;
mnBUnderlineOffset = 0;
mnDUnderlineSize = 0;
mnDUnderlineOffset1 = 0;
mnDUnderlineOffset2 = 0;
mnWUnderlineSize = 0;
mnWUnderlineOffset = 0;
mnAboveUnderlineSize = 0;
mnAboveUnderlineOffset = 0;
mnAboveBUnderlineSize = 0;
mnAboveBUnderlineOffset = 0;
mnAboveDUnderlineSize = 0;
mnAboveDUnderlineOffset1 = 0;
mnAboveDUnderlineOffset2 = 0;
mnAboveWUnderlineSize = 0;
mnAboveWUnderlineOffset = 0;
mnStrikeoutSize = 0;
mnStrikeoutOffset = 0;
mnBStrikeoutSize = 0;
mnBStrikeoutOffset = 0;
mnDStrikeoutSize = 0;
mnDStrikeoutOffset1 = 0;
mnDStrikeoutOffset2 = 0;
}
// -----------------------------------------------------------------------
void ImplFontMetricData::ImplInitTextLineSize( const OutputDevice* pDev )
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
{
long nDescent = mnDescent;
if ( nDescent <= 0 )
{
nDescent = mnAscent / 10;
if ( !nDescent )
nDescent = 1;
}
// #i55341# for some fonts it is not a good idea to calculate
// their text line metrics from the real font descent
// => work around this problem just for these fonts
if( 3*nDescent > mnAscent )
nDescent = mnAscent / 3;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
long nLineHeight = ((nDescent*25)+50) / 100;
2000-09-18 16:07:07 +00:00
if ( !nLineHeight )
nLineHeight = 1;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
long nLineHeight2 = nLineHeight / 2;
2000-09-18 16:07:07 +00:00
if ( !nLineHeight2 )
nLineHeight2 = 1;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
long nBLineHeight = ((nDescent*50)+50) / 100;
2000-09-18 16:07:07 +00:00
if ( nBLineHeight == nLineHeight )
nBLineHeight++;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
long nBLineHeight2 = nBLineHeight/2;
2000-09-18 16:07:07 +00:00
if ( !nBLineHeight2 )
nBLineHeight2 = 1;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
long n2LineHeight = ((nDescent*16)+50) / 100;
2000-09-18 16:07:07 +00:00
if ( !n2LineHeight )
n2LineHeight = 1;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
long n2LineDY = n2LineHeight;
/* #117909#
* add some pixels to minimum double line distance on higher resolution devices
*/
long nMin2LineDY = 1 + pDev->ImplGetDPIY()/150;
if ( n2LineDY < nMin2LineDY )
n2LineDY = nMin2LineDY;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
long n2LineDY2 = n2LineDY/2;
2000-09-18 16:07:07 +00:00
if ( !n2LineDY2 )
n2LineDY2 = 1;
long nUnderlineOffset = mnDescent/2 + 1;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
long nStrikeoutOffset = -((mnAscent - mnIntLeading) / 3);
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mnUnderlineSize = nLineHeight;
mnUnderlineOffset = nUnderlineOffset - nLineHeight2;
mnBUnderlineSize = nBLineHeight;
mnBUnderlineOffset = nUnderlineOffset - nBLineHeight2;
mnDUnderlineSize = n2LineHeight;
mnDUnderlineOffset1 = nUnderlineOffset - n2LineDY2 - n2LineHeight;
mnDUnderlineOffset2 = mnDUnderlineOffset1 + n2LineDY + n2LineHeight;
long nWCalcSize = mnDescent;
if ( nWCalcSize < 6 )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if ( (nWCalcSize == 1) || (nWCalcSize == 2) )
mnWUnderlineSize = nWCalcSize;
2000-09-18 16:07:07 +00:00
else
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mnWUnderlineSize = 3;
2000-09-18 16:07:07 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
else
mnWUnderlineSize = ((nWCalcSize*50)+50) / 100;
2001-02-23 17:17:44 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// #109280# the following line assures that wavelnes are never placed below the descent, however
// for most fonts the waveline then is drawn into the text, so we better keep the old solution
// pFontEntry->maMetric.mnWUnderlineOffset = pFontEntry->maMetric.mnDescent + 1 - pFontEntry->maMetric.mnWUnderlineSize;
mnWUnderlineOffset = nUnderlineOffset;
mnStrikeoutSize = nLineHeight;
mnStrikeoutOffset = nStrikeoutOffset - nLineHeight2;
mnBStrikeoutSize = nBLineHeight;
mnBStrikeoutOffset = nStrikeoutOffset - nBLineHeight2;
mnDStrikeoutSize = n2LineHeight;
mnDStrikeoutOffset1 = nStrikeoutOffset - n2LineDY2 - n2LineHeight;
mnDStrikeoutOffset2 = mnDStrikeoutOffset1 + n2LineDY + n2LineHeight;
2001-02-23 17:17:44 +00:00
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
void ImplFontMetricData::ImplInitAboveTextLineSize()
2001-02-23 17:17:44 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
long nIntLeading = mnIntLeading;
// TODO: assess usage of nLeading below (changed in extleading CWS)
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// if no leading is available, we assume 15% of the ascent
if ( nIntLeading <= 0 )
{
nIntLeading = mnAscent*15/100;
if ( !nIntLeading )
nIntLeading = 1;
}
2001-02-23 17:17:44 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
long nLineHeight = ((nIntLeading*25)+50) / 100;
2001-02-23 17:17:44 +00:00
if ( !nLineHeight )
nLineHeight = 1;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
long nBLineHeight = ((nIntLeading*50)+50) / 100;
2001-02-23 17:17:44 +00:00
if ( nBLineHeight == nLineHeight )
nBLineHeight++;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
long n2LineHeight = ((nIntLeading*16)+50) / 100;
2001-02-23 17:17:44 +00:00
if ( !n2LineHeight )
n2LineHeight = 1;
long nCeiling = -mnAscent;
2001-02-23 17:17:44 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mnAboveUnderlineSize = nLineHeight;
mnAboveUnderlineOffset = nCeiling + (nIntLeading - nLineHeight + 1) / 2;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mnAboveBUnderlineSize = nBLineHeight;
mnAboveBUnderlineOffset = nCeiling + (nIntLeading - nBLineHeight + 1) / 2;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mnAboveDUnderlineSize = n2LineHeight;
mnAboveDUnderlineOffset1 = nCeiling + (nIntLeading - 3*n2LineHeight + 1) / 2;
mnAboveDUnderlineOffset2 = nCeiling + (nIntLeading + n2LineHeight + 1) / 2;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
long nWCalcSize = nIntLeading;
if ( nWCalcSize < 6 )
2001-02-23 17:17:44 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if ( (nWCalcSize == 1) || (nWCalcSize == 2) )
mnAboveWUnderlineSize = nWCalcSize;
2001-02-23 17:17:44 +00:00
else
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mnAboveWUnderlineSize = 3;
2000-09-18 16:07:07 +00:00
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
else
mnAboveWUnderlineSize = ((nWCalcSize*50)+50) / 100;
mnAboveWUnderlineOffset = nCeiling + (nIntLeading + 1) / 2;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
static void ImplDrawWavePixel( long nOriginX, long nOriginY,
long nCurX, long nCurY,
short nOrientation,
SalGraphics* pGraphics,
2002-08-29 14:42:38 +00:00
OutputDevice* pOutDev,
2000-09-18 16:07:07 +00:00
BOOL bDrawPixAsRect,
2002-04-23 06:40:42 +00:00
2000-09-18 16:07:07 +00:00
long nPixWidth, long nPixHeight )
{
if ( nOrientation )
ImplRotatePos( nOriginX, nOriginY, nCurX, nCurY, nOrientation );
if ( bDrawPixAsRect )
{
2002-04-23 06:40:42 +00:00
2002-08-29 14:42:38 +00:00
pGraphics->DrawRect( nCurX, nCurY, nPixWidth, nPixHeight, pOutDev );
2000-09-18 16:07:07 +00:00
}
else
{
2002-08-29 14:42:38 +00:00
pGraphics->DrawPixel( nCurX, nCurY, pOutDev );
2000-09-18 16:07:07 +00:00
}
}
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
long nDistX, long nDistY,
2000-09-18 16:07:07 +00:00
long nWidth, long nHeight,
long nLineWidth, short nOrientation,
const Color& rColor )
{
if ( !nHeight )
return;
long nStartX = nBaseX + nDistX;
long nStartY = nBaseY + nDistY;
2000-09-18 16:07:07 +00:00
// Bei Hoehe von 1 Pixel reicht es, eine Linie auszugeben
if ( (nLineWidth == 1) && (nHeight == 1) )
{
mpGraphics->SetLineColor( ImplColorToSal( rColor ) );
mbInitLineColor = TRUE;
long nEndX = nStartX+nWidth;
long nEndY = nStartY;
if ( nOrientation )
{
ImplRotatePos( nBaseX, nBaseY, nStartX, nStartY, nOrientation );
ImplRotatePos( nBaseX, nBaseY, nEndX, nEndY, nOrientation );
}
2002-08-29 14:42:38 +00:00
mpGraphics->DrawLine( nStartX, nStartY, nEndX, nEndY, this );
2000-09-18 16:07:07 +00:00
}
else
{
long nCurX = nStartX;
long nCurY = nStartY;
long nDiffX = 2;
long nDiffY = nHeight-1;
long nCount = nWidth;
long nOffY = -1;
long nFreq;
long i;
long nPixWidth;
long nPixHeight;
BOOL bDrawPixAsRect;
// Auf Druckern die Pixel per DrawRect() ausgeben
if ( (GetOutDevType() == OUTDEV_PRINTER) || (nLineWidth > 1) )
{
if ( mbLineColor || mbInitLineColor )
{
mpGraphics->SetLineColor();
mbInitLineColor = TRUE;
}
mpGraphics->SetFillColor( ImplColorToSal( rColor ) );
mbInitFillColor = TRUE;
bDrawPixAsRect = TRUE;
nPixWidth = nLineWidth;
nPixHeight = ((nLineWidth*mnDPIX)+(mnDPIY/2))/mnDPIY;
}
else
{
mpGraphics->SetLineColor( ImplColorToSal( rColor ) );
mbInitLineColor = TRUE;
nPixWidth = 1;
nPixHeight = 1;
bDrawPixAsRect = FALSE;
}
if ( !nDiffY )
{
while ( nWidth )
{
ImplDrawWavePixel( nBaseX, nBaseY, nCurX, nCurY, nOrientation,
2002-08-29 14:42:38 +00:00
mpGraphics, this,
2000-09-18 16:07:07 +00:00
bDrawPixAsRect, nPixWidth, nPixHeight );
nCurX++;
nWidth--;
}
}
else
{
nCurY += nDiffY;
nFreq = nCount / (nDiffX+nDiffY);
while ( nFreq-- )
{
for( i = nDiffY; i; --i )
{
ImplDrawWavePixel( nBaseX, nBaseY, nCurX, nCurY, nOrientation,
2002-08-29 14:42:38 +00:00
mpGraphics, this,
2000-09-18 16:07:07 +00:00
bDrawPixAsRect, nPixWidth, nPixHeight );
nCurX++;
nCurY += nOffY;
}
for( i = nDiffX; i; --i )
{
ImplDrawWavePixel( nBaseX, nBaseY, nCurX, nCurY, nOrientation,
2002-08-29 14:42:38 +00:00
mpGraphics, this,
2000-09-18 16:07:07 +00:00
bDrawPixAsRect, nPixWidth, nPixHeight );
nCurX++;
}
nOffY = -nOffY;
}
nFreq = nCount % (nDiffX+nDiffY);
if ( nFreq )
{
for( i = nDiffY; i && nFreq; --i, --nFreq )
{
ImplDrawWavePixel( nBaseX, nBaseY, nCurX, nCurY, nOrientation,
2002-08-29 14:42:38 +00:00
mpGraphics, this,
2000-09-18 16:07:07 +00:00
bDrawPixAsRect, nPixWidth, nPixHeight );
nCurX++;
nCurY += nOffY;
2002-04-23 06:40:42 +00:00
2000-09-18 16:07:07 +00:00
}
for( i = nDiffX; i && nFreq; --i, --nFreq )
{
ImplDrawWavePixel( nBaseX, nBaseY, nCurX, nCurY, nOrientation,
2002-08-29 14:42:38 +00:00
mpGraphics, this,
2000-09-18 16:07:07 +00:00
bDrawPixAsRect, nPixWidth, nPixHeight );
nCurX++;
}
}
}
}
}
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawWaveTextLine( long nBaseX, long nBaseY,
long nDistX, long nDistY, long nWidth,
FontUnderline eTextLine,
Color aColor,
BOOL bIsAbove )
2000-09-18 16:07:07 +00:00
{
ImplFontEntry* pFontEntry = mpFontEntry;
long nLineHeight;
long nLinePos;
if ( bIsAbove )
2000-09-18 16:07:07 +00:00
{
nLineHeight = pFontEntry->maMetric.mnAboveWUnderlineSize;
nLinePos = pFontEntry->maMetric.mnAboveWUnderlineOffset;
2000-09-18 16:07:07 +00:00
}
else
2000-09-18 16:07:07 +00:00
{
nLineHeight = pFontEntry->maMetric.mnWUnderlineSize;
nLinePos = pFontEntry->maMetric.mnWUnderlineOffset;
}
if ( (eTextLine == UNDERLINE_SMALLWAVE) && (nLineHeight > 3) )
nLineHeight = 3;
long nLineWidth = (mnDPIX/300);
if ( !nLineWidth )
nLineWidth = 1;
if ( eTextLine == UNDERLINE_BOLDWAVE )
nLineWidth *= 2;
nLinePos += nDistY - (nLineHeight / 2);
long nLineWidthHeight = ((nLineWidth*mnDPIX)+(mnDPIY/2))/mnDPIY;
if ( eTextLine == UNDERLINE_DOUBLEWAVE )
{
long nOrgLineHeight = nLineHeight;
nLineHeight /= 3;
if ( nLineHeight < 2 )
2002-04-23 06:40:42 +00:00
{
if ( nOrgLineHeight > 1 )
nLineHeight = 2;
else
nLineHeight = 1;
}
long nLineDY = nOrgLineHeight-(nLineHeight*2);
if ( nLineDY < nLineWidthHeight )
nLineDY = nLineWidthHeight;
long nLineDY2 = nLineDY/2;
if ( !nLineDY2 )
nLineDY2 = 1;
nLinePos -= nLineWidthHeight-nLineDY2;
ImplDrawWaveLine( nBaseX, nBaseY, nDistX, nLinePos, nWidth, nLineHeight,
nLineWidth, mpFontEntry->mnOrientation, aColor );
nLinePos += nLineWidthHeight+nLineDY;
ImplDrawWaveLine( nBaseX, nBaseY, nDistX, nLinePos, nWidth, nLineHeight,
nLineWidth, mpFontEntry->mnOrientation, aColor );
}
else
{
nLinePos -= nLineWidthHeight/2;
ImplDrawWaveLine( nBaseX, nBaseY, nDistX, nLinePos, nWidth, nLineHeight,
nLineWidth, mpFontEntry->mnOrientation, aColor );
}
}
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY,
long nDistX, long nDistY, long nWidth,
FontUnderline eTextLine,
Color aColor,
BOOL bIsAbove )
{
ImplFontEntry* pFontEntry = mpFontEntry;
long nLineHeight = 0;
long nLinePos = 0;
long nLinePos2 = 0;
const long nY = nDistY;
if ( eTextLine > UNDERLINE_LAST )
eTextLine = UNDERLINE_SINGLE;
2000-09-18 16:07:07 +00:00
switch ( eTextLine )
2000-09-18 16:07:07 +00:00
{
case UNDERLINE_SINGLE:
case UNDERLINE_DOTTED:
case UNDERLINE_DASH:
case UNDERLINE_LONGDASH:
case UNDERLINE_DASHDOT:
case UNDERLINE_DASHDOTDOT:
if ( bIsAbove )
2001-02-23 17:17:44 +00:00
{
nLineHeight = pFontEntry->maMetric.mnAboveUnderlineSize;
nLinePos = nY + pFontEntry->maMetric.mnAboveUnderlineOffset;
}
else
{
nLineHeight = pFontEntry->maMetric.mnUnderlineSize;
nLinePos = nY + pFontEntry->maMetric.mnUnderlineOffset;
}
break;
case UNDERLINE_BOLD:
case UNDERLINE_BOLDDOTTED:
case UNDERLINE_BOLDDASH:
case UNDERLINE_BOLDLONGDASH:
case UNDERLINE_BOLDDASHDOT:
case UNDERLINE_BOLDDASHDOTDOT:
if ( bIsAbove )
2001-02-23 17:17:44 +00:00
{
nLineHeight = pFontEntry->maMetric.mnAboveBUnderlineSize;
nLinePos = nY + pFontEntry->maMetric.mnAboveBUnderlineOffset;
}
else
{
nLineHeight = pFontEntry->maMetric.mnBUnderlineSize;
nLinePos = nY + pFontEntry->maMetric.mnBUnderlineOffset;
}
break;
case UNDERLINE_DOUBLE:
if ( bIsAbove )
2001-02-23 17:17:44 +00:00
{
nLineHeight = pFontEntry->maMetric.mnAboveDUnderlineSize;
nLinePos = nY + pFontEntry->maMetric.mnAboveDUnderlineOffset1;
nLinePos2 = nY + pFontEntry->maMetric.mnAboveDUnderlineOffset2;
}
else
{
nLineHeight = pFontEntry->maMetric.mnDUnderlineSize;
nLinePos = nY + pFontEntry->maMetric.mnDUnderlineOffset1;
nLinePos2 = nY + pFontEntry->maMetric.mnDUnderlineOffset2;
}
break;
default:
break;
}
2000-09-18 16:07:07 +00:00
if ( nLineHeight )
{
if ( mbLineColor || mbInitLineColor )
2000-09-18 16:07:07 +00:00
{
mpGraphics->SetLineColor();
mbInitLineColor = TRUE;
}
mpGraphics->SetFillColor( ImplColorToSal( aColor ) );
mbInitFillColor = TRUE;
long nLeft = nDistX;
2000-09-18 16:07:07 +00:00
switch ( eTextLine )
{
case UNDERLINE_SINGLE:
case UNDERLINE_BOLD:
2000-09-18 16:07:07 +00:00
ImplDrawTextRect( nBaseX, nBaseY, nLeft, nLinePos, nWidth, nLineHeight );
break;
case UNDERLINE_DOUBLE:
ImplDrawTextRect( nBaseX, nBaseY, nLeft, nLinePos, nWidth, nLineHeight );
2000-09-18 16:07:07 +00:00
ImplDrawTextRect( nBaseX, nBaseY, nLeft, nLinePos2, nWidth, nLineHeight );
break;
case UNDERLINE_DOTTED:
case UNDERLINE_BOLDDOTTED:
2000-09-18 16:07:07 +00:00
{
long nDotWidth = nLineHeight*mnDPIY;
nDotWidth += mnDPIY/2;
nDotWidth /= mnDPIY;
long nTempWidth = nDotWidth;
long nEnd = nLeft+nWidth;
while ( nLeft < nEnd )
{
if ( nLeft+nTempWidth > nEnd )
nTempWidth = nEnd-nLeft;
ImplDrawTextRect( nBaseX, nBaseY, nLeft, nLinePos, nTempWidth, nLineHeight );
nLeft += nDotWidth*2;
}
2000-09-18 16:07:07 +00:00
}
break;
case UNDERLINE_DASH:
case UNDERLINE_LONGDASH:
case UNDERLINE_BOLDDASH:
case UNDERLINE_BOLDLONGDASH:
2000-09-18 16:07:07 +00:00
{
long nDotWidth = nLineHeight*mnDPIY;
nDotWidth += mnDPIY/2;
nDotWidth /= mnDPIY;
long nMinDashWidth;
long nMinSpaceWidth;
long nSpaceWidth;
long nDashWidth;
if ( (eTextLine == UNDERLINE_LONGDASH) ||
(eTextLine == UNDERLINE_BOLDLONGDASH) )
{
nMinDashWidth = nDotWidth*6;
nMinSpaceWidth = nDotWidth*2;
nDashWidth = 200;
nSpaceWidth = 100;
}
else
{
nMinDashWidth = nDotWidth*4;
nMinSpaceWidth = (nDotWidth*150)/100;
nDashWidth = 100;
nSpaceWidth = 50;
}
nDashWidth = ((nDashWidth*mnDPIX)+1270)/2540;
nSpaceWidth = ((nSpaceWidth*mnDPIX)+1270)/2540;
// DashWidth wird gegebenenfalls verbreitert, wenn
// die dicke der Linie im Verhaeltnis zur Laenge
// zu dick wird
if ( nDashWidth < nMinDashWidth )
nDashWidth = nMinDashWidth;
if ( nSpaceWidth < nMinSpaceWidth )
nSpaceWidth = nMinSpaceWidth;
long nTempWidth = nDashWidth;
long nEnd = nLeft+nWidth;
while ( nLeft < nEnd )
{
if ( nLeft+nTempWidth > nEnd )
nTempWidth = nEnd-nLeft;
ImplDrawTextRect( nBaseX, nBaseY, nLeft, nLinePos, nTempWidth, nLineHeight );
nLeft += nDashWidth+nSpaceWidth;
}
2000-09-18 16:07:07 +00:00
}
break;
case UNDERLINE_DASHDOT:
case UNDERLINE_BOLDDASHDOT:
2000-09-18 16:07:07 +00:00
{
long nDotWidth = nLineHeight*mnDPIY;
nDotWidth += mnDPIY/2;
nDotWidth /= mnDPIY;
long nDashWidth = ((100*mnDPIX)+1270)/2540;
long nMinDashWidth = nDotWidth*4;
// DashWidth wird gegebenenfalls verbreitert, wenn
// die dicke der Linie im Verhaeltnis zur Laenge
// zu dick wird
if ( nDashWidth < nMinDashWidth )
nDashWidth = nMinDashWidth;
long nTempDotWidth = nDotWidth;
long nTempDashWidth = nDashWidth;
long nEnd = nLeft+nWidth;
while ( nLeft < nEnd )
{
if ( nLeft+nTempDotWidth > nEnd )
nTempDotWidth = nEnd-nLeft;
ImplDrawTextRect( nBaseX, nBaseY, nLeft, nLinePos, nTempDotWidth, nLineHeight );
nLeft += nDotWidth*2;
if ( nLeft > nEnd )
break;
if ( nLeft+nTempDashWidth > nEnd )
nTempDashWidth = nEnd-nLeft;
ImplDrawTextRect( nBaseX, nBaseY, nLeft, nLinePos, nTempDashWidth, nLineHeight );
nLeft += nDashWidth+nDotWidth;
}
2000-09-18 16:07:07 +00:00
}
break;
case UNDERLINE_DASHDOTDOT:
case UNDERLINE_BOLDDASHDOTDOT:
2000-09-18 16:07:07 +00:00
{
long nDotWidth = nLineHeight*mnDPIY;
nDotWidth += mnDPIY/2;
nDotWidth /= mnDPIY;
long nDashWidth = ((100*mnDPIX)+1270)/2540;
long nMinDashWidth = nDotWidth*4;
// DashWidth wird gegebenenfalls verbreitert, wenn
// die dicke der Linie im Verhaeltnis zur Laenge
// zu dick wird
if ( nDashWidth < nMinDashWidth )
nDashWidth = nMinDashWidth;
long nTempDotWidth = nDotWidth;
long nTempDashWidth = nDashWidth;
long nEnd = nLeft+nWidth;
while ( nLeft < nEnd )
{
if ( nLeft+nTempDotWidth > nEnd )
nTempDotWidth = nEnd-nLeft;
ImplDrawTextRect( nBaseX, nBaseY, nLeft, nLinePos, nTempDotWidth, nLineHeight );
nLeft += nDotWidth*2;
if ( nLeft > nEnd )
break;
if ( nLeft+nTempDotWidth > nEnd )
nTempDotWidth = nEnd-nLeft;
ImplDrawTextRect( nBaseX, nBaseY, nLeft, nLinePos, nTempDotWidth, nLineHeight );
nLeft += nDotWidth*2;
if ( nLeft > nEnd )
break;
if ( nLeft+nTempDashWidth > nEnd )
nTempDashWidth = nEnd-nLeft;
ImplDrawTextRect( nBaseX, nBaseY, nLeft, nLinePos, nTempDashWidth, nLineHeight );
nLeft += nDashWidth+nDotWidth;
}
2000-09-18 16:07:07 +00:00
}
break;
default:
break;
2000-09-18 16:07:07 +00:00
}
}
}
2000-09-18 16:07:07 +00:00
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY,
long nDistX, long nDistY, long nWidth,
FontStrikeout eStrikeout,
Color aColor )
{
ImplFontEntry* pFontEntry = mpFontEntry;
long nLineHeight = 0;
long nLinePos = 0;
long nLinePos2 = 0;
long nY = nDistY;
if ( eStrikeout > STRIKEOUT_LAST )
eStrikeout = STRIKEOUT_SINGLE;
switch ( eStrikeout )
{
case STRIKEOUT_SINGLE:
2000-09-18 16:07:07 +00:00
nLineHeight = pFontEntry->maMetric.mnStrikeoutSize;
nLinePos = nY + pFontEntry->maMetric.mnStrikeoutOffset;
break;
case STRIKEOUT_BOLD:
2000-09-18 16:07:07 +00:00
nLineHeight = pFontEntry->maMetric.mnBStrikeoutSize;
nLinePos = nY + pFontEntry->maMetric.mnBStrikeoutOffset;
break;
case STRIKEOUT_DOUBLE:
2000-09-18 16:07:07 +00:00
nLineHeight = pFontEntry->maMetric.mnDStrikeoutSize;
nLinePos = nY + pFontEntry->maMetric.mnDStrikeoutOffset1;
nLinePos2 = nY + pFontEntry->maMetric.mnDStrikeoutOffset2;
break;
default:
break;
}
2000-09-18 16:07:07 +00:00
if ( nLineHeight )
{
if ( mbLineColor || mbInitLineColor )
2000-09-18 16:07:07 +00:00
{
mpGraphics->SetLineColor();
mbInitLineColor = TRUE;
}
mpGraphics->SetFillColor( ImplColorToSal( aColor ) );
mbInitFillColor = TRUE;
const long& nLeft = nDistX;
2000-09-18 16:07:07 +00:00
switch ( eStrikeout )
{
case STRIKEOUT_SINGLE:
case STRIKEOUT_BOLD:
2000-09-18 16:07:07 +00:00
ImplDrawTextRect( nBaseX, nBaseY, nLeft, nLinePos, nWidth, nLineHeight );
break;
case STRIKEOUT_DOUBLE:
2000-09-18 16:07:07 +00:00
ImplDrawTextRect( nBaseX, nBaseY, nLeft, nLinePos, nWidth, nLineHeight );
ImplDrawTextRect( nBaseX, nBaseY, nLeft, nLinePos2, nWidth, nLineHeight );
break;
default:
break;
}
}
}
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
long nDistX, long nDistY, long nWidth,
FontStrikeout eStrikeout,
Color aColor )
{
2009-09-08 10:44:42 +00:00
// PDF-export does its own strikeout drawing... why again?
if( mpPDFWriter && mpPDFWriter->isBuiltinFont(mpFontEntry->maFontSelData.mpFontData) )
return;
2009-09-08 10:44:42 +00:00
// prepare string for strikeout measurement
static char cStrikeoutChar;
if ( eStrikeout == STRIKEOUT_SLASH )
2009-09-08 10:44:42 +00:00
cStrikeoutChar = '/';
else // ( eStrikeout == STRIKEOUT_X )
2009-09-08 10:44:42 +00:00
cStrikeoutChar = 'X';
static const int nTestStrLen = 4;
static const int nMaxStrikeStrLen = 2048;
xub_Unicode aChars[ nMaxStrikeStrLen +1]; // +1 for valgrind...
for( int i = 0; i < nTestStrLen; ++i)
aChars[i] = cStrikeoutChar;
const String aStrikeoutTest( aChars, nTestStrLen );
// calculate approximation of strikeout atom size
long nStrikeoutWidth = nWidth;
2009-09-08 10:44:42 +00:00
SalLayout* pLayout = ImplLayout( aStrikeoutTest, 0, nTestStrLen );
if( pLayout )
{
2009-09-08 10:44:42 +00:00
nStrikeoutWidth = (pLayout->GetTextWidth() +nTestStrLen/2) / (nTestStrLen * pLayout->GetUnitsPerPixel());
pLayout->Release();
}
2009-09-08 10:44:42 +00:00
if( nStrikeoutWidth <= 0 ) // sanity check
return;
// calculate acceptable strikeout length
// allow the strikeout to be one pixel larger than the text it strikes out
long nMaxWidth = nStrikeoutWidth * 3 / 4;
if ( nMaxWidth < 2 )
nMaxWidth = 2;
nMaxWidth += nWidth + 1;
int nStrikeStrLen = (nMaxWidth - 1) / nStrikeoutWidth;
// if the text width is smaller than the strikeout text, then do not
// strike out at all. This case requires user interaction, e.g. adding
// a space to the text
2009-09-08 10:44:42 +00:00
if( nStrikeStrLen <= 0 )
return;
if( nStrikeStrLen > nMaxStrikeStrLen )
nStrikeStrLen = nMaxStrikeStrLen;
2009-09-08 10:44:42 +00:00
// build the strikeout string
for( int i = nTestStrLen; i < nStrikeStrLen; ++i)
aChars[i] = cStrikeoutChar;
const String aStrikeoutText( aChars, xub_StrLen(nStrikeStrLen) );
2009-09-08 10:44:42 +00:00
if( mpFontEntry->mnOrientation )
ImplRotatePos( 0, 0, nDistX, nDistY, mpFontEntry->mnOrientation );
nBaseX += nDistX;
nBaseY += nDistY;
2009-09-08 10:44:42 +00:00
// strikeout text has to be left aligned
ULONG nOrigTLM = mnTextLayoutMode;
mnTextLayoutMode = TEXT_LAYOUT_BIDI_STRONG | TEXT_LAYOUT_COMPLEX_DISABLED;
pLayout = ImplLayout( aStrikeoutText, 0, STRING_LEN );
mnTextLayoutMode = nOrigTLM;
if( !pLayout )
return;
// draw the strikeout text
const Color aOldColor = GetTextColor();
SetTextColor( aColor );
ImplInitTextColor();
pLayout->DrawBase() = Point( nBaseX+mnTextOffX, nBaseY+mnTextOffY );
2009-09-08 10:44:42 +00:00
pLayout->DrawText( *mpGraphics );
pLayout->Release();
SetTextColor( aOldColor );
ImplInitTextColor();
}
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawTextLine( long nX, long nY,
long nDistX, long nWidth,
FontStrikeout eStrikeout,
FontUnderline eUnderline,
FontUnderline eOverline,
BOOL bUnderlineAbove )
{
if ( !nWidth )
return;
Color aStrikeoutColor = GetTextColor();
Color aUnderlineColor = GetTextLineColor();
Color aOverlineColor = GetOverlineColor();
BOOL bStrikeoutDone = FALSE;
BOOL bUnderlineDone = FALSE;
BOOL bOverlineDone = FALSE;
if ( IsRTLEnabled() )
{
// --- RTL --- mirror at basex
long nXAdd = nWidth - nDistX;
if( mpFontEntry->mnOrientation )
nXAdd = FRound( nXAdd * cos( mpFontEntry->mnOrientation * F_PI1800 ) );
nX += nXAdd - 1;
}
if ( !IsTextLineColor() )
aUnderlineColor = GetTextColor();
if ( !IsOverlineColor() )
aOverlineColor = GetTextColor();
if ( (eUnderline == UNDERLINE_SMALLWAVE) ||
(eUnderline == UNDERLINE_WAVE) ||
(eUnderline == UNDERLINE_DOUBLEWAVE) ||
(eUnderline == UNDERLINE_BOLDWAVE) )
{
ImplDrawWaveTextLine( nX, nY, nDistX, 0, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
bUnderlineDone = TRUE;
}
if ( (eOverline == UNDERLINE_SMALLWAVE) ||
(eOverline == UNDERLINE_WAVE) ||
(eOverline == UNDERLINE_DOUBLEWAVE) ||
(eOverline == UNDERLINE_BOLDWAVE) )
{
ImplDrawWaveTextLine( nX, nY, nDistX, 0, nWidth, eOverline, aOverlineColor, TRUE );
bOverlineDone = TRUE;
}
2000-09-18 16:07:07 +00:00
if ( (eStrikeout == STRIKEOUT_SLASH) ||
(eStrikeout == STRIKEOUT_X) )
{
ImplDrawStrikeoutChar( nX, nY, nDistX, 0, nWidth, eStrikeout, aStrikeoutColor );
bStrikeoutDone = TRUE;
2000-09-18 16:07:07 +00:00
}
if ( !bUnderlineDone )
ImplDrawStraightTextLine( nX, nY, nDistX, 0, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
if ( !bOverlineDone )
ImplDrawStraightTextLine( nX, nY, nDistX, 0, nWidth, eOverline, aOverlineColor, TRUE );
if ( !bStrikeoutDone )
ImplDrawStrikeoutLine( nX, nY, nDistX, 0, nWidth, eStrikeout, aStrikeoutColor );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
2002-04-23 06:40:42 +00:00
void OutputDevice::ImplDrawTextLines( SalLayout& rSalLayout,
FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, BOOL bWordLine, BOOL bUnderlineAbove )
2000-09-18 16:07:07 +00:00
{
2002-04-23 06:40:42 +00:00
if( bWordLine )
2000-09-18 16:07:07 +00:00
{
// draw everything relative to the layout base point
const Point aStartPt = rSalLayout.DrawBase();
// calculate distance of each word from the base point
Point aPos;
sal_Int32 nDist = 0, nWidth = 0, nAdvance=0;
for( int nStart = 0;;)
{
// iterate through the layouted glyphs
sal_GlyphId nGlyphIndex;
if( !rSalLayout.GetNextGlyphs( 1, &nGlyphIndex, aPos, nStart, &nAdvance ) )
break;
2000-09-18 16:07:07 +00:00
// calculate the boundaries of each word
if( !rSalLayout.IsSpacingGlyph( nGlyphIndex ) )
{
if( !nWidth )
{
// get the distance to the base point (as projected to baseline)
nDist = aPos.X() - aStartPt.X();
if( mpFontEntry->mnOrientation )
{
const long nDY = aPos.Y() - aStartPt.Y();
const double fRad = mpFontEntry->mnOrientation * F_PI1800;
nDist = FRound( nDist*cos(fRad) - nDY*sin(fRad) );
}
}
// update the length of the textline
nWidth += nAdvance;
}
else if( nWidth > 0 )
{
// draw the textline for each word
ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), nDist, nWidth,
eStrikeout, eUnderline, eOverline, bUnderlineAbove );
nWidth = 0;
}
}
// draw textline for the last word
if( nWidth > 0 )
2000-09-18 16:07:07 +00:00
{
ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), nDist, nWidth,
eStrikeout, eUnderline, eOverline, bUnderlineAbove );
2000-09-18 16:07:07 +00:00
}
}
else
2002-04-23 06:40:42 +00:00
{
Point aStartPt = rSalLayout.GetDrawPosition();
int nWidth = rSalLayout.GetTextWidth() / rSalLayout.GetUnitsPerPixel();
ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), 0, nWidth,
eStrikeout, eUnderline, eOverline, bUnderlineAbove );
2002-04-23 06:40:42 +00:00
}
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawMnemonicLine( long nX, long nY, long nWidth )
2000-09-18 16:07:07 +00:00
{
long nBaseX = nX;
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
if( /*ImplHasMirroredGraphics() &&*/ IsRTLEnabled() )
{
// --- RTL ---
// add some strange offset
nX += 2;
// revert the hack that will be done later in ImplDrawTextLine
nX = nBaseX - nWidth - (nX - nBaseX - 1);
}
ImplDrawTextLine( nX, nY, 0, nWidth, STRIKEOUT_NONE, UNDERLINE_SINGLE, UNDERLINE_NONE, FALSE );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
2001-02-23 15:13:58 +00:00
void OutputDevice::ImplGetEmphasisMark( PolyPolygon& rPolyPoly, BOOL& rPolyLine,
Rectangle& rRect1, Rectangle& rRect2,
long& rYOff, long& rWidth,
FontEmphasisMark eEmphasis,
long nHeight, short /*nOrient*/ )
2001-02-23 15:13:58 +00:00
{
static const BYTE aAccentPolyFlags[24] =
{
0, 2, 2, 0, 2, 2, 0, 2, 2, 0, 2, 2, 0, 2, 2, 0, 2, 2, 0, 0, 2, 0, 2, 2
};
static const long aAccentPos[48] =
{
78, 0,
348, 79,
599, 235,
843, 469,
938, 574,
990, 669,
990, 773,
990, 843,
964, 895,
921, 947,
886, 982,
860, 999,
825, 999,
764, 999,
721, 964,
686, 895,
625, 791,
556, 660,
469, 504,
400, 400,
261, 252,
61, 61,
0, 27,
9, 0
};
rWidth = 0;
rYOff = 0;
rPolyLine = FALSE;
if ( !nHeight )
return;
FontEmphasisMark nEmphasisStyle = eEmphasis & EMPHASISMARK_STYLE;
long nDotSize = 0;
switch ( nEmphasisStyle )
{
case EMPHASISMARK_DOT:
// Dot has 55% of the height
nDotSize = (nHeight*550)/1000;
2001-02-23 15:13:58 +00:00
if ( !nDotSize )
nDotSize = 1;
if ( nDotSize <= 2 )
rRect1 = Rectangle( Point(), Size( nDotSize, nDotSize ) );
else
{
long nRad = nDotSize/2;
Polygon aPoly( Point( nRad, nRad ), nRad, nRad );
rPolyPoly.Insert( aPoly );
}
rYOff = ((nHeight*250)/1000)/2; // Center to the anthoer EmphasisMarks
rWidth = nDotSize;
break;
case EMPHASISMARK_CIRCLE:
// Dot has 80% of the height
nDotSize = (nHeight*800)/1000;
2001-02-23 15:13:58 +00:00
if ( !nDotSize )
nDotSize = 1;
if ( nDotSize <= 2 )
rRect1 = Rectangle( Point(), Size( nDotSize, nDotSize ) );
else
{
long nRad = nDotSize/2;
Polygon aPoly( Point( nRad, nRad ), nRad, nRad );
rPolyPoly.Insert( aPoly );
// BorderWidth is 15%
long nBorder = (nDotSize*150)/1000;
if ( nBorder <= 1 )
rPolyLine = TRUE;
else
{
Polygon aPoly2( Point( nRad, nRad ),
nRad-nBorder, nRad-nBorder );
rPolyPoly.Insert( aPoly2 );
}
}
rWidth = nDotSize;
break;
case EMPHASISMARK_DISC:
// Dot has 80% of the height
nDotSize = (nHeight*800)/1000;
2001-02-23 15:13:58 +00:00
if ( !nDotSize )
nDotSize = 1;
if ( nDotSize <= 2 )
rRect1 = Rectangle( Point(), Size( nDotSize, nDotSize ) );
else
{
long nRad = nDotSize/2;
Polygon aPoly( Point( nRad, nRad ), nRad, nRad );
rPolyPoly.Insert( aPoly );
}
rWidth = nDotSize;
break;
case EMPHASISMARK_ACCENT:
// Dot has 80% of the height
nDotSize = (nHeight*800)/1000;
2001-02-23 15:13:58 +00:00
if ( !nDotSize )
nDotSize = 1;
if ( nDotSize <= 2 )
{
if ( nDotSize == 1 )
{
rRect1 = Rectangle( Point(), Size( nDotSize, nDotSize ) );
rWidth = nDotSize;
}
else
{
rRect1 = Rectangle( Point(), Size( 1, 1 ) );
rRect2 = Rectangle( Point( 1, 1 ), Size( 1, 1 ) );
}
}
else
{
Polygon aPoly( sizeof( aAccentPos ) / sizeof( long ) / 2,
(const Point*)aAccentPos,
aAccentPolyFlags );
2001-02-23 15:13:58 +00:00
double dScale = ((double)nDotSize)/1000.0;
aPoly.Scale( dScale, dScale );
Polygon aTemp;
CWS-TOOLING: integrate CWS impress178 2009-10-16 19:54:41 +0200 sj r276995 : removed warning 2009-10-16 17:46:12 +0200 sj r276993 : #i103757# applied patch (fixed crash if model changes) 2009-10-16 16:06:07 +0200 sj r276985 : CWS-TOOLING: rebase CWS impress178 to branches/OOO320@276942 (milestone: OOO320:m2) 2009-10-08 13:51:23 +0200 sj r276790 : #i105654# fixed closing of line geometry 2009-10-07 17:26:56 +0200 sj r276762 : #i105606# fixed object shadow 2009-10-07 17:25:39 +0200 sj r276761 : minor improvements 2009-10-07 11:48:26 +0200 af r276745 : #i103047# Prevent context menu of LayoutMenu from being shown when user clicks on background. 2009-10-07 11:33:59 +0200 af r276743 : #i99866# Set position of the design control manually. 2009-10-06 17:18:23 +0200 sj r276721 : minor improvements 2009-10-05 18:34:23 +0200 sj r276692 : #105606# fixed fontsize problem 2009-10-05 17:26:21 +0200 af r276691 : #i105354# Never process more than one request in a row. 2009-10-02 13:24:25 +0200 af r276639 : #i94242# Taking insertion position of slide sorter correctly into account. 2009-10-01 13:46:47 +0200 aw r276602 : #i102224# some Polygon/PolyPolygon usages in SVMConverter ignored the possible curve status of tools::Polygon; added at least an AdaptiveSubdivide 2009-10-01 12:33:56 +0200 aw r276588 : #i102224# ImplWritePolyPolygon killed the curve information at the PolyPolygon by NOT copying the flags 2009-09-30 17:48:56 +0200 aw r276567 : #i102224# removed GetSimple() from Polygon and PolyPolygon, replaced completely with AdaptiveSubdivide 2009-09-30 15:45:46 +0200 aw r276559 : #i102048# secured primitive creation for dimension lines with linestyle none 2009-09-30 14:56:41 +0200 af r276556 : #i105471# Reordered statements in ~SdModule. 2009-09-30 14:47:12 +0200 aw r276555 : #i105373# corrected curve ignoring places in MetaFile export
2009-10-27 15:01:25 +00:00
aPoly.AdaptiveSubdivide( aTemp );
Rectangle aBoundRect = aTemp.GetBoundRect();
2001-02-23 15:13:58 +00:00
rWidth = aBoundRect.GetWidth();
nDotSize = aBoundRect.GetHeight();
rPolyPoly.Insert( aTemp );
2001-02-23 15:13:58 +00:00
}
break;
}
// calculate position
long nOffY = 1+(mnDPIY/300); // one visible pixel space
2001-02-23 15:13:58 +00:00
long nSpaceY = nHeight-nDotSize;
if ( nSpaceY >= nOffY*2 )
rYOff += nOffY;
if ( !(eEmphasis & EMPHASISMARK_POS_BELOW) )
rYOff += nDotSize;
}
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawEmphasisMark( long nBaseX, long nX, long nY,
2001-02-23 15:13:58 +00:00
const PolyPolygon& rPolyPoly, BOOL bPolyLine,
const Rectangle& rRect1, const Rectangle& rRect2 )
{
// TODO: pass nWidth as width of this mark
long nWidth = 0;
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
if( IsRTLEnabled() )
// --- RTL --- mirror at basex
nX = nBaseX - nWidth - (nX - nBaseX - 1);
nX -= mnOutOffX;
nY -= mnOutOffY;
2001-02-23 15:13:58 +00:00
if ( rPolyPoly.Count() )
{
if ( bPolyLine )
{
Polygon aPoly = rPolyPoly.GetObject( 0 );
aPoly.Move( nX, nY );
DrawPolyLine( aPoly );
}
else
{
PolyPolygon aPolyPoly = rPolyPoly;
aPolyPoly.Move( nX, nY );
DrawPolyPolygon( aPolyPoly );
}
}
if ( !rRect1.IsEmpty() )
{
Rectangle aRect( Point( nX+rRect1.Left(),
nY+rRect1.Top() ), rRect1.GetSize() );
DrawRect( aRect );
}
if ( !rRect2.IsEmpty() )
{
Rectangle aRect( Point( nX+rRect2.Left(),
nY+rRect2.Top() ), rRect2.GetSize() );
2002-04-23 06:40:42 +00:00
2001-02-23 15:13:58 +00:00
DrawRect( aRect );
}
}
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawEmphasisMarks( SalLayout& rSalLayout )
2001-02-23 15:13:58 +00:00
{
Color aOldColor = GetTextColor();
Color aOldLineColor = GetLineColor();
Color aOldFillColor = GetFillColor();
BOOL bOldMap = mbMap;
GDIMetaFile* pOldMetaFile = mpMetaFile;
mpMetaFile = NULL;
EnableMapMode( FALSE );
2001-02-23 15:13:58 +00:00
FontEmphasisMark nEmphasisMark = ImplGetEmphasisMarkStyle( maFont );
PolyPolygon aPolyPoly;
Rectangle aRect1;
Rectangle aRect2;
long nEmphasisYOff;
long nEmphasisWidth;
long nEmphasisHeight;
BOOL bPolyLine;
if ( nEmphasisMark & EMPHASISMARK_POS_BELOW )
nEmphasisHeight = mnEmphasisDescent;
else
nEmphasisHeight = mnEmphasisAscent;
ImplGetEmphasisMark( aPolyPoly, bPolyLine,
aRect1, aRect2,
nEmphasisYOff, nEmphasisWidth,
nEmphasisMark,
nEmphasisHeight, mpFontEntry->mnOrientation );
if ( bPolyLine )
{
SetLineColor( GetTextColor() );
SetFillColor();
}
else
{
SetLineColor();
SetFillColor( GetTextColor() );
}
Point aOffset = Point(0,0);
2002-04-23 06:40:42 +00:00
if ( nEmphasisMark & EMPHASISMARK_POS_BELOW )
aOffset.Y() += mpFontEntry->maMetric.mnDescent + nEmphasisYOff;
2001-02-23 15:13:58 +00:00
else
aOffset.Y() -= mpFontEntry->maMetric.mnAscent + nEmphasisYOff;
long nEmphasisWidth2 = nEmphasisWidth / 2;
long nEmphasisHeight2 = nEmphasisHeight / 2;
aOffset += Point( nEmphasisWidth2, nEmphasisHeight2 );
Point aOutPoint;
Rectangle aRectangle;
for( int nStart = 0;;)
2001-02-23 15:13:58 +00:00
{
sal_GlyphId nGlyphIndex;
if( !rSalLayout.GetNextGlyphs( 1, &nGlyphIndex, aOutPoint, nStart ) )
break;
if( !mpGraphics->GetGlyphBoundRect( nGlyphIndex, aRectangle ) )
continue;
if( !rSalLayout.IsSpacingGlyph( nGlyphIndex ) )
2001-02-23 15:13:58 +00:00
{
Point aAdjPoint = aOffset;
aAdjPoint.X() += aRectangle.Left() + (aRectangle.GetWidth() - nEmphasisWidth) / 2;
2001-02-23 15:13:58 +00:00
if ( mpFontEntry->mnOrientation )
ImplRotatePos( 0, 0, aAdjPoint.X(), aAdjPoint.Y(), mpFontEntry->mnOrientation );
aOutPoint += aAdjPoint;
aOutPoint -= Point( nEmphasisWidth2, nEmphasisHeight2 );
ImplDrawEmphasisMark( rSalLayout.DrawBase().X(),
aOutPoint.X(), aOutPoint.Y(),
aPolyPoly, bPolyLine, aRect1, aRect2 );
2001-02-23 15:13:58 +00:00
}
}
SetLineColor( aOldLineColor );
SetFillColor( aOldFillColor );
EnableMapMode( bOldMap );
2001-02-23 15:13:58 +00:00
mpMetaFile = pOldMetaFile;
}
// -----------------------------------------------------------------------
2002-04-23 06:40:42 +00:00
bool OutputDevice::ImplDrawRotateText( SalLayout& rSalLayout )
2000-09-18 16:07:07 +00:00
{
int nX = rSalLayout.DrawBase().X();
int nY = rSalLayout.DrawBase().Y();
Rectangle aBoundRect;
rSalLayout.DrawBase() = Point( 0, 0 );
rSalLayout.DrawOffset() = Point( 0, 0 );
if( !rSalLayout.GetBoundRect( *mpGraphics, aBoundRect ) )
{
// guess vertical text extents if GetBoundRect failed
int nRight = rSalLayout.GetTextWidth();
int nTop = mpFontEntry->maMetric.mnAscent + mnEmphasisAscent;
long nHeight = mpFontEntry->mnLineHeight + mnEmphasisAscent + mnEmphasisDescent;
aBoundRect = Rectangle( 0, -nTop, nRight, nHeight - nTop );
}
// cache virtual device for rotation
2002-04-23 06:40:42 +00:00
if ( !mpOutDevData )
ImplInitOutDevData();
if ( !mpOutDevData->mpRotateDev )
mpOutDevData->mpRotateDev = new VirtualDevice( *this, 1 );
VirtualDevice* pVDev = mpOutDevData->mpRotateDev;
2002-04-23 06:40:42 +00:00
// size it accordingly
if( !pVDev->SetOutputSizePixel( aBoundRect.GetSize() ) )
return false;
2002-04-23 06:40:42 +00:00
Font aFont( GetFont() );
aFont.SetOrientation( 0 );
aFont.SetSize( Size( mpFontEntry->maFontSelData.mnWidth, mpFontEntry->maFontSelData.mnHeight ) );
pVDev->SetFont( aFont );
pVDev->SetTextColor( Color( COL_BLACK ) );
pVDev->SetTextFillColor();
pVDev->ImplNewFont();
pVDev->ImplInitFont();
pVDev->ImplInitTextColor();
// draw text into upper left corner
rSalLayout.DrawBase() -= aBoundRect.TopLeft();
rSalLayout.DrawText( *((OutputDevice*)pVDev)->mpGraphics );
Bitmap aBmp = pVDev->GetBitmap( Point(), aBoundRect.GetSize() );
if ( !aBmp || !aBmp.Rotate( mpFontEntry->mnOwnOrientation, COL_WHITE ) )
return false;
// calculate rotation offset
Polygon aPoly( aBoundRect );
aPoly.Rotate( Point(), mpFontEntry->mnOwnOrientation );
Point aPoint = aPoly.GetBoundRect().TopLeft();
aPoint += Point( nX, nY );
// mask output with text colored bitmap
GDIMetaFile* pOldMetaFile = mpMetaFile;
long nOldOffX = mnOutOffX;
long nOldOffY = mnOutOffY;
BOOL bOldMap = mbMap;
mnOutOffX = 0L;
mnOutOffY = 0L;
mpMetaFile = NULL;
EnableMapMode( FALSE );
DrawMask( aPoint, aBmp, GetTextColor() );
EnableMapMode( bOldMap );
mnOutOffX = nOldOffX;
mnOutOffY = nOldOffY;
mpMetaFile = pOldMetaFile;
return true;
2002-04-23 06:40:42 +00:00
}
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawTextDirect( SalLayout& rSalLayout, BOOL bTextLines )
{
if( mpFontEntry->mnOwnOrientation )
if( ImplDrawRotateText( rSalLayout ) )
return;
long nOldX = rSalLayout.DrawBase().X();
2002-07-20 14:54:30 +00:00
if( ! (mpPDFWriter && mpPDFWriter->isBuiltinFont(mpFontEntry->maFontSelData.mpFontData) ) )
{
if( ImplHasMirroredGraphics() )
{
long w = meOutDevType == OUTDEV_VIRDEV ? mnOutWidth : mpGraphics->GetGraphicsWidth();
long x = rSalLayout.DrawBase().X();
rSalLayout.DrawBase().X() = w - 1 - x;
if( !IsRTLEnabled() )
{
OutputDevice *pOutDevRef = (OutputDevice *)this;
// mirror this window back
long devX = w-pOutDevRef->mnOutWidth-pOutDevRef->mnOutOffX; // re-mirrored mnOutOffX
rSalLayout.DrawBase().X() = devX + ( pOutDevRef->mnOutWidth - 1 - (rSalLayout.DrawBase().X() - devX) ) ;
}
}
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
else if( IsRTLEnabled() )
{
//long w = meOutDevType == OUTDEV_VIRDEV ? mnOutWidth : mpGraphics->GetGraphicsWidth();
//long x = rSalLayout.DrawBase().X();
OutputDevice *pOutDevRef = (OutputDevice *)this;
// mirror this window back
long devX = pOutDevRef->mnOutOffX; // re-mirrored mnOutOffX
rSalLayout.DrawBase().X() = pOutDevRef->mnOutWidth - 1 - (rSalLayout.DrawBase().X() - devX) + devX;
}
rSalLayout.DrawText( *mpGraphics );
}
2002-04-23 06:40:42 +00:00
rSalLayout.DrawBase().X() = nOldX;
2002-04-23 06:40:42 +00:00
if( bTextLines )
ImplDrawTextLines( rSalLayout,
maFont.GetStrikeout(), maFont.GetUnderline(), maFont.GetOverline(),
2002-04-23 06:40:42 +00:00
maFont.IsWordLineMode(), ImplIsUnderlineAbove( maFont ) );
// emphasis marks
if( maFont.GetEmphasisMark() & EMPHASISMARK_STYLE )
ImplDrawEmphasisMarks( rSalLayout );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
2002-04-23 06:40:42 +00:00
void OutputDevice::ImplDrawSpecialText( SalLayout& rSalLayout )
2000-09-18 16:07:07 +00:00
{
2001-02-23 15:13:58 +00:00
Color aOldColor = GetTextColor();
Color aOldTextLineColor = GetTextLineColor();
Color aOldOverlineColor = GetOverlineColor();
2001-02-23 15:13:58 +00:00
FontRelief eRelief = maFont.GetRelief();
2000-09-18 16:07:07 +00:00
Point aOrigPos = rSalLayout.DrawBase();
2001-02-23 15:13:58 +00:00
if ( eRelief != RELIEF_NONE )
2000-09-18 16:07:07 +00:00
{
2001-02-23 15:13:58 +00:00
Color aReliefColor( COL_LIGHTGRAY );
Color aTextColor( aOldColor );
2002-04-23 06:40:42 +00:00
2001-02-23 15:13:58 +00:00
Color aTextLineColor( aOldTextLineColor );
Color aOverlineColor( aOldOverlineColor );
2001-02-23 15:13:58 +00:00
2002-04-23 06:40:42 +00:00
// we don't have a automatic color, so black is always drawn on white
2001-02-23 15:13:58 +00:00
if ( aTextColor.GetColor() == COL_BLACK )
aTextColor = Color( COL_WHITE );
if ( aTextLineColor.GetColor() == COL_BLACK )
aTextLineColor = Color( COL_WHITE );
if ( aOverlineColor.GetColor() == COL_BLACK )
aOverlineColor = Color( COL_WHITE );
2001-02-23 15:13:58 +00:00
2002-04-23 06:40:42 +00:00
// relief-color is black for white text, in all other cases
2001-02-23 15:13:58 +00:00
// we set this to LightGray
if ( aTextColor.GetColor() == COL_WHITE )
aReliefColor = Color( COL_BLACK );
SetTextLineColor( aReliefColor );
SetOverlineColor( aReliefColor );
2001-02-23 15:13:58 +00:00
SetTextColor( aReliefColor );
2000-09-18 16:07:07 +00:00
ImplInitTextColor();
2002-04-23 06:40:42 +00:00
// calculate offset - for high resolution printers the offset
2001-02-23 15:13:58 +00:00
// should be greater so that the effect is visible
long nOff = 1;
nOff += mnDPIX/300;
2000-09-18 16:07:07 +00:00
2001-02-23 15:13:58 +00:00
if ( eRelief == RELIEF_ENGRAVED )
nOff = -nOff;
rSalLayout.DrawOffset() += Point( nOff, nOff);
2002-04-23 06:40:42 +00:00
ImplDrawTextDirect( rSalLayout, mbTextLines );
rSalLayout.DrawOffset() -= Point( nOff, nOff);
2000-09-18 16:07:07 +00:00
2001-02-23 15:13:58 +00:00
SetTextLineColor( aTextLineColor );
SetOverlineColor( aOverlineColor );
2001-02-23 15:13:58 +00:00
SetTextColor( aTextColor );
2000-09-18 16:07:07 +00:00
ImplInitTextColor();
2002-04-23 06:40:42 +00:00
ImplDrawTextDirect( rSalLayout, mbTextLines );
2001-02-23 15:13:58 +00:00
2000-09-18 16:07:07 +00:00
SetTextLineColor( aOldTextLineColor );
SetOverlineColor( aOldOverlineColor );
2002-04-23 06:40:42 +00:00
2001-02-23 15:13:58 +00:00
if ( aTextColor != aOldColor )
{
SetTextColor( aOldColor );
ImplInitTextColor();
}
}
else
{
if ( maFont.IsShadow() )
{
long nOff = 1 + ((mpFontEntry->mnLineHeight-24)/24);
if ( maFont.IsOutline() )
nOff++;
SetTextLineColor();
SetOverlineColor();
if ( (GetTextColor().GetColor() == COL_BLACK)
|| (GetTextColor().GetLuminance() < 8) )
2001-02-23 15:13:58 +00:00
SetTextColor( Color( COL_LIGHTGRAY ) );
else
2001-04-27 13:29:53 +00:00
SetTextColor( Color( COL_BLACK ) );
2001-02-23 15:13:58 +00:00
ImplInitTextColor();
rSalLayout.DrawBase() += Point( nOff, nOff );
2002-04-23 06:40:42 +00:00
ImplDrawTextDirect( rSalLayout, mbTextLines );
rSalLayout.DrawBase() -= Point( nOff, nOff );
2001-02-23 15:13:58 +00:00
SetTextColor( aOldColor );
SetTextLineColor( aOldTextLineColor );
SetOverlineColor( aOldOverlineColor );
2001-02-23 15:13:58 +00:00
ImplInitTextColor();
if ( !maFont.IsOutline() )
2002-04-23 06:40:42 +00:00
ImplDrawTextDirect( rSalLayout, mbTextLines );
2001-02-23 15:13:58 +00:00
}
if ( maFont.IsOutline() )
{
rSalLayout.DrawBase() = aOrigPos + Point(-1,-1);
2002-04-23 06:40:42 +00:00
ImplDrawTextDirect( rSalLayout, mbTextLines );
rSalLayout.DrawBase() = aOrigPos + Point(+1,+1);
2002-04-23 06:40:42 +00:00
ImplDrawTextDirect( rSalLayout, mbTextLines );
rSalLayout.DrawBase() = aOrigPos + Point(-1,+0);
2002-04-23 06:40:42 +00:00
ImplDrawTextDirect( rSalLayout, mbTextLines );
rSalLayout.DrawBase() = aOrigPos + Point(-1,+1);
2002-04-23 06:40:42 +00:00
ImplDrawTextDirect( rSalLayout, mbTextLines );
rSalLayout.DrawBase() = aOrigPos + Point(+0,+1);
2002-04-23 06:40:42 +00:00
ImplDrawTextDirect( rSalLayout, mbTextLines );
rSalLayout.DrawBase() = aOrigPos + Point(+0,-1);
2002-04-23 06:40:42 +00:00
ImplDrawTextDirect( rSalLayout, mbTextLines );
rSalLayout.DrawBase() = aOrigPos + Point(+1,-1);
2002-04-23 06:40:42 +00:00
ImplDrawTextDirect( rSalLayout, mbTextLines );
rSalLayout.DrawBase() = aOrigPos + Point(+1,+0);
2002-04-23 06:40:42 +00:00
ImplDrawTextDirect( rSalLayout, mbTextLines );
rSalLayout.DrawBase() = aOrigPos;
2001-02-23 15:13:58 +00:00
SetTextColor( Color( COL_WHITE ) );
SetTextLineColor( Color( COL_WHITE ) );
SetOverlineColor( Color( COL_WHITE ) );
2001-02-23 15:13:58 +00:00
ImplInitTextColor();
2002-04-23 06:40:42 +00:00
ImplDrawTextDirect( rSalLayout, mbTextLines );
2001-02-23 15:13:58 +00:00
SetTextColor( aOldColor );
SetTextLineColor( aOldTextLineColor );
SetOverlineColor( aOldOverlineColor );
2001-02-23 15:13:58 +00:00
ImplInitTextColor();
}
2000-09-18 16:07:07 +00:00
}
}
// -----------------------------------------------------------------------
2002-04-23 06:40:42 +00:00
void OutputDevice::ImplDrawText( SalLayout& rSalLayout )
2000-09-18 16:07:07 +00:00
{
2002-04-23 06:40:42 +00:00
if( mbInitClipRegion )
ImplInitClipRegion();
if( mbOutputClipped )
return;
if( mbInitTextColor )
ImplInitTextColor();
2000-09-18 16:07:07 +00:00
rSalLayout.DrawBase() += Point( mnTextOffX, mnTextOffY );
2000-09-18 16:07:07 +00:00
2002-04-23 06:40:42 +00:00
if( IsTextFillColor() )
ImplDrawTextBackground( rSalLayout );
if( mbTextSpecial )
ImplDrawSpecialText( rSalLayout );
2000-09-18 16:07:07 +00:00
else
2002-04-23 06:40:42 +00:00
ImplDrawTextDirect( rSalLayout, mbTextLines );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
long nWidth, const XubString& rStr,
USHORT nStyle, const ::vcl::ITextLayout& _rLayout )
2000-09-18 16:07:07 +00:00
{
DBG_ASSERTWARNING( nWidth >= 0, "ImplGetTextLines: nWidth <= 0!" );
if ( nWidth <= 0 )
nWidth = 1;
2000-09-18 16:07:07 +00:00
long nMaxLineWidth = 0;
rLineInfo.Clear();
if ( rStr.Len() && (nWidth > 0) )
2000-09-18 16:07:07 +00:00
{
::rtl::OUString aText( rStr );
uno::Reference < i18n::XBreakIterator > xBI;
// get service provider
uno::Reference< lang::XMultiServiceFactory > xSMgr( unohelper::GetMultiServiceFactory() );
2000-11-06 19:48:36 +00:00
uno::Reference< linguistic2::XHyphenator > xHyph;
if( xSMgr.is() )
{
uno::Reference< linguistic2::XLinguServiceManager> xLinguMgr(xSMgr->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.LinguServiceManager"))),uno::UNO_QUERY);
if ( xLinguMgr.is() )
{
xHyph = xLinguMgr->getHyphenator();
}
}
2001-03-28 09:25:24 +00:00
i18n::LineBreakHyphenationOptions aHyphOptions( xHyph, uno::Sequence <beans::PropertyValue>(), 1 );
i18n::LineBreakUserOptions aUserOptions;
2000-09-18 16:07:07 +00:00
xub_StrLen nPos = 0;
xub_StrLen nLen = rStr.Len();
2000-09-18 16:07:07 +00:00
while ( nPos < nLen )
{
xub_StrLen nBreakPos = nPos;
2002-04-23 06:40:42 +00:00
2000-09-18 16:07:07 +00:00
while ( ( nBreakPos < nLen ) && ( rStr.GetChar( nBreakPos ) != _CR ) && ( rStr.GetChar( nBreakPos ) != _LF ) )
nBreakPos++;
long nLineWidth = _rLayout.GetTextWidth( rStr, nPos, nBreakPos-nPos );
2000-09-18 16:07:07 +00:00
if ( ( nLineWidth > nWidth ) && ( nStyle & TEXT_DRAW_WORDBREAK ) )
{
if ( !xBI.is() )
xBI = vcl::unohelper::CreateBreakIterator();
if ( xBI.is() )
{
CWS-TOOLING: integrate CWS vcl98 2009-01-16 15:17:38 +0100 pl r266422 : #i93515# add fix for compiz (thanks cmc) 2009-01-15 10:55:36 +0100 thb r266352 : #i97399# start==end angle means no arc at all 2009-01-14 18:54:37 +0100 pl r266327 : #i96536# #i96396# add: pagescroll for wheel events (thanks mod) 2009-01-14 18:21:06 +0100 pl r266325 : #i96536# #i96396# add: gestures, bracket matching (thanks mod) 2009-01-13 12:03:29 +0100 hdu r266206 : #i98024# preserve glyph zero-advance for artificial bold and vertical layout (thanks CMC!) 2009-01-12 16:32:20 +0100 hdu r266167 : #i97991# fix rotated text: temporary workaround for #i87686# 2009-01-08 17:16:17 +0100 hdu r266028 : #159054# ignore empty ATSULayout 2009-01-08 16:59:05 +0100 hdu r266026 : #159054# prevent invalid ATSUStyle 2009-01-07 19:04:06 +0100 pl r265976 : #158288# add extraction of fonts and individual object streams to pdfunzip 2009-01-07 14:42:17 +0100 pl r265969 : #i93011# workaround our ancient accelerator mechanisms to have deeper child window hirearchies working 2009-01-07 14:39:15 +0100 pl r265967 : #i93011# workaround our ancient accelerator mechanisms to have deeper child window hirearchies working 2009-01-07 11:10:58 +0100 hdu r265956 : #i97522# getPixel() returns COL_BLACK on printers or when out of bounds 2009-01-06 18:41:48 +0100 pl r265938 : #i97696# do not force user password to owner password after all 2009-01-06 18:00:52 +0100 pl r265934 : #i97157# fix a snafu 2009-01-06 13:23:38 +0100 pl r265914 : #i93515# support for _NET_WM_USER_TIME (thanks cmc) 2009-01-06 12:50:37 +0100 hdu r265912 : #i97538# get rid of compiler warnings for complex logical expressions 2009-01-06 12:49:09 +0100 hdu r265911 : #i97538# get rid of compiler warnings for complex logical expressions 2009-01-06 12:14:07 +0100 hdu r265906 : #i97522# implemented AquaSalGraphics::getPixel() 2008-12-18 16:46:59 +0100 pl r265706 : #i96343# reset quick job flag 2008-12-18 16:44:22 +0100 pl r265705 : #i96343# reset quick job flag 2008-12-18 14:08:22 +0100 pl r265688 : #i93241# fix bit field query 2008-12-18 12:41:52 +0100 pl r265682 : #i93241# eliminate useless static locale variable 2008-12-17 19:23:07 +0100 pl r265654 : #i97064# set language to OOo user configured UI language (thanks cmc) 2008-12-17 17:44:38 +0100 hdu r265651 : #i97326# debug-helper: print cairo version 2008-12-17 17:43:15 +0100 hdu r265650 : #i97326# ignore cairo changing the transformation of our FT_FACE 2008-12-17 14:44:32 +0100 pl r265604 : #i93631# refine control positioning 2008-12-17 12:40:39 +0100 hdu r265596 : #i97167# update VCL.xcu for MacOSX for Japanese (thanks maho!) 2008-12-17 11:59:51 +0100 hdu r265592 : #i97317# code movement to prevent needless and expensive construction/destruction in error path 2008-12-17 11:54:43 +0100 hdu r265590 : #i97317# workaround QUARTZ bug with drawing small polygons 2008-12-16 17:57:02 +0100 pl r265567 : #i97138# select num copies when grabbing focus 2008-12-16 17:15:11 +0100 pl r265561 : #i93173# lazy deletion of toolbars 2008-12-16 16:33:51 +0100 pl r265558 : #i93173# lazy deletion of toolbars: reparent floating DockingWindows in doLazyDelete 2008-12-16 13:23:17 +0100 pl r265536 : #i97196# ensure style engine has been loaded (thanks cmc)
2009-02-11 10:53:35 +00:00
const com::sun::star::lang::Locale& rDefLocale(Application::GetSettings().GetUILocale());
xub_StrLen nSoftBreak = _rLayout.GetTextBreak( rStr, nWidth, nPos, nBreakPos - nPos );
DBG_ASSERT( nSoftBreak < nBreakPos, "Break?!" );
//aHyphOptions.hyphenIndex = nSoftBreak;
CWS-TOOLING: integrate CWS vcl98 2009-01-16 15:17:38 +0100 pl r266422 : #i93515# add fix for compiz (thanks cmc) 2009-01-15 10:55:36 +0100 thb r266352 : #i97399# start==end angle means no arc at all 2009-01-14 18:54:37 +0100 pl r266327 : #i96536# #i96396# add: pagescroll for wheel events (thanks mod) 2009-01-14 18:21:06 +0100 pl r266325 : #i96536# #i96396# add: gestures, bracket matching (thanks mod) 2009-01-13 12:03:29 +0100 hdu r266206 : #i98024# preserve glyph zero-advance for artificial bold and vertical layout (thanks CMC!) 2009-01-12 16:32:20 +0100 hdu r266167 : #i97991# fix rotated text: temporary workaround for #i87686# 2009-01-08 17:16:17 +0100 hdu r266028 : #159054# ignore empty ATSULayout 2009-01-08 16:59:05 +0100 hdu r266026 : #159054# prevent invalid ATSUStyle 2009-01-07 19:04:06 +0100 pl r265976 : #158288# add extraction of fonts and individual object streams to pdfunzip 2009-01-07 14:42:17 +0100 pl r265969 : #i93011# workaround our ancient accelerator mechanisms to have deeper child window hirearchies working 2009-01-07 14:39:15 +0100 pl r265967 : #i93011# workaround our ancient accelerator mechanisms to have deeper child window hirearchies working 2009-01-07 11:10:58 +0100 hdu r265956 : #i97522# getPixel() returns COL_BLACK on printers or when out of bounds 2009-01-06 18:41:48 +0100 pl r265938 : #i97696# do not force user password to owner password after all 2009-01-06 18:00:52 +0100 pl r265934 : #i97157# fix a snafu 2009-01-06 13:23:38 +0100 pl r265914 : #i93515# support for _NET_WM_USER_TIME (thanks cmc) 2009-01-06 12:50:37 +0100 hdu r265912 : #i97538# get rid of compiler warnings for complex logical expressions 2009-01-06 12:49:09 +0100 hdu r265911 : #i97538# get rid of compiler warnings for complex logical expressions 2009-01-06 12:14:07 +0100 hdu r265906 : #i97522# implemented AquaSalGraphics::getPixel() 2008-12-18 16:46:59 +0100 pl r265706 : #i96343# reset quick job flag 2008-12-18 16:44:22 +0100 pl r265705 : #i96343# reset quick job flag 2008-12-18 14:08:22 +0100 pl r265688 : #i93241# fix bit field query 2008-12-18 12:41:52 +0100 pl r265682 : #i93241# eliminate useless static locale variable 2008-12-17 19:23:07 +0100 pl r265654 : #i97064# set language to OOo user configured UI language (thanks cmc) 2008-12-17 17:44:38 +0100 hdu r265651 : #i97326# debug-helper: print cairo version 2008-12-17 17:43:15 +0100 hdu r265650 : #i97326# ignore cairo changing the transformation of our FT_FACE 2008-12-17 14:44:32 +0100 pl r265604 : #i93631# refine control positioning 2008-12-17 12:40:39 +0100 hdu r265596 : #i97167# update VCL.xcu for MacOSX for Japanese (thanks maho!) 2008-12-17 11:59:51 +0100 hdu r265592 : #i97317# code movement to prevent needless and expensive construction/destruction in error path 2008-12-17 11:54:43 +0100 hdu r265590 : #i97317# workaround QUARTZ bug with drawing small polygons 2008-12-16 17:57:02 +0100 pl r265567 : #i97138# select num copies when grabbing focus 2008-12-16 17:15:11 +0100 pl r265561 : #i93173# lazy deletion of toolbars 2008-12-16 16:33:51 +0100 pl r265558 : #i93173# lazy deletion of toolbars: reparent floating DockingWindows in doLazyDelete 2008-12-16 13:23:17 +0100 pl r265536 : #i97196# ensure style engine has been loaded (thanks cmc)
2009-02-11 10:53:35 +00:00
i18n::LineBreakResults aLBR = xBI->getLineBreak( aText, nSoftBreak, rDefLocale, nPos, aHyphOptions, aUserOptions );
nBreakPos = (xub_StrLen)aLBR.breakIndex;
if ( nBreakPos <= nPos )
nBreakPos = nSoftBreak;
CWS-TOOLING: integrate CWS vcl98 2009-01-16 15:17:38 +0100 pl r266422 : #i93515# add fix for compiz (thanks cmc) 2009-01-15 10:55:36 +0100 thb r266352 : #i97399# start==end angle means no arc at all 2009-01-14 18:54:37 +0100 pl r266327 : #i96536# #i96396# add: pagescroll for wheel events (thanks mod) 2009-01-14 18:21:06 +0100 pl r266325 : #i96536# #i96396# add: gestures, bracket matching (thanks mod) 2009-01-13 12:03:29 +0100 hdu r266206 : #i98024# preserve glyph zero-advance for artificial bold and vertical layout (thanks CMC!) 2009-01-12 16:32:20 +0100 hdu r266167 : #i97991# fix rotated text: temporary workaround for #i87686# 2009-01-08 17:16:17 +0100 hdu r266028 : #159054# ignore empty ATSULayout 2009-01-08 16:59:05 +0100 hdu r266026 : #159054# prevent invalid ATSUStyle 2009-01-07 19:04:06 +0100 pl r265976 : #158288# add extraction of fonts and individual object streams to pdfunzip 2009-01-07 14:42:17 +0100 pl r265969 : #i93011# workaround our ancient accelerator mechanisms to have deeper child window hirearchies working 2009-01-07 14:39:15 +0100 pl r265967 : #i93011# workaround our ancient accelerator mechanisms to have deeper child window hirearchies working 2009-01-07 11:10:58 +0100 hdu r265956 : #i97522# getPixel() returns COL_BLACK on printers or when out of bounds 2009-01-06 18:41:48 +0100 pl r265938 : #i97696# do not force user password to owner password after all 2009-01-06 18:00:52 +0100 pl r265934 : #i97157# fix a snafu 2009-01-06 13:23:38 +0100 pl r265914 : #i93515# support for _NET_WM_USER_TIME (thanks cmc) 2009-01-06 12:50:37 +0100 hdu r265912 : #i97538# get rid of compiler warnings for complex logical expressions 2009-01-06 12:49:09 +0100 hdu r265911 : #i97538# get rid of compiler warnings for complex logical expressions 2009-01-06 12:14:07 +0100 hdu r265906 : #i97522# implemented AquaSalGraphics::getPixel() 2008-12-18 16:46:59 +0100 pl r265706 : #i96343# reset quick job flag 2008-12-18 16:44:22 +0100 pl r265705 : #i96343# reset quick job flag 2008-12-18 14:08:22 +0100 pl r265688 : #i93241# fix bit field query 2008-12-18 12:41:52 +0100 pl r265682 : #i93241# eliminate useless static locale variable 2008-12-17 19:23:07 +0100 pl r265654 : #i97064# set language to OOo user configured UI language (thanks cmc) 2008-12-17 17:44:38 +0100 hdu r265651 : #i97326# debug-helper: print cairo version 2008-12-17 17:43:15 +0100 hdu r265650 : #i97326# ignore cairo changing the transformation of our FT_FACE 2008-12-17 14:44:32 +0100 pl r265604 : #i93631# refine control positioning 2008-12-17 12:40:39 +0100 hdu r265596 : #i97167# update VCL.xcu for MacOSX for Japanese (thanks maho!) 2008-12-17 11:59:51 +0100 hdu r265592 : #i97317# code movement to prevent needless and expensive construction/destruction in error path 2008-12-17 11:54:43 +0100 hdu r265590 : #i97317# workaround QUARTZ bug with drawing small polygons 2008-12-16 17:57:02 +0100 pl r265567 : #i97138# select num copies when grabbing focus 2008-12-16 17:15:11 +0100 pl r265561 : #i93173# lazy deletion of toolbars 2008-12-16 16:33:51 +0100 pl r265558 : #i93173# lazy deletion of toolbars: reparent floating DockingWindows in doLazyDelete 2008-12-16 13:23:17 +0100 pl r265536 : #i97196# ensure style engine has been loaded (thanks cmc)
2009-02-11 10:53:35 +00:00
if ( (nStyle & TEXT_DRAW_WORDBREAK_HYPHENATION) == TEXT_DRAW_WORDBREAK_HYPHENATION )
{
// Egal ob Trenner oder nicht: Das Wort nach dem Trenner durch
// die Silbentrennung jagen...
// nMaxBreakPos ist das letzte Zeichen was in die Zeile passt,
// nBreakPos ist der Wort-Anfang
// Ein Problem gibt es, wenn das Dok so schmal ist, dass ein Wort
// auf mehr als Zwei Zeilen gebrochen wird...
if ( xHyph.is() )
{
sal_Unicode cAlternateReplChar = 0;
sal_Unicode cAlternateExtraChar = 0;
CWS-TOOLING: integrate CWS vcl98 2009-01-16 15:17:38 +0100 pl r266422 : #i93515# add fix for compiz (thanks cmc) 2009-01-15 10:55:36 +0100 thb r266352 : #i97399# start==end angle means no arc at all 2009-01-14 18:54:37 +0100 pl r266327 : #i96536# #i96396# add: pagescroll for wheel events (thanks mod) 2009-01-14 18:21:06 +0100 pl r266325 : #i96536# #i96396# add: gestures, bracket matching (thanks mod) 2009-01-13 12:03:29 +0100 hdu r266206 : #i98024# preserve glyph zero-advance for artificial bold and vertical layout (thanks CMC!) 2009-01-12 16:32:20 +0100 hdu r266167 : #i97991# fix rotated text: temporary workaround for #i87686# 2009-01-08 17:16:17 +0100 hdu r266028 : #159054# ignore empty ATSULayout 2009-01-08 16:59:05 +0100 hdu r266026 : #159054# prevent invalid ATSUStyle 2009-01-07 19:04:06 +0100 pl r265976 : #158288# add extraction of fonts and individual object streams to pdfunzip 2009-01-07 14:42:17 +0100 pl r265969 : #i93011# workaround our ancient accelerator mechanisms to have deeper child window hirearchies working 2009-01-07 14:39:15 +0100 pl r265967 : #i93011# workaround our ancient accelerator mechanisms to have deeper child window hirearchies working 2009-01-07 11:10:58 +0100 hdu r265956 : #i97522# getPixel() returns COL_BLACK on printers or when out of bounds 2009-01-06 18:41:48 +0100 pl r265938 : #i97696# do not force user password to owner password after all 2009-01-06 18:00:52 +0100 pl r265934 : #i97157# fix a snafu 2009-01-06 13:23:38 +0100 pl r265914 : #i93515# support for _NET_WM_USER_TIME (thanks cmc) 2009-01-06 12:50:37 +0100 hdu r265912 : #i97538# get rid of compiler warnings for complex logical expressions 2009-01-06 12:49:09 +0100 hdu r265911 : #i97538# get rid of compiler warnings for complex logical expressions 2009-01-06 12:14:07 +0100 hdu r265906 : #i97522# implemented AquaSalGraphics::getPixel() 2008-12-18 16:46:59 +0100 pl r265706 : #i96343# reset quick job flag 2008-12-18 16:44:22 +0100 pl r265705 : #i96343# reset quick job flag 2008-12-18 14:08:22 +0100 pl r265688 : #i93241# fix bit field query 2008-12-18 12:41:52 +0100 pl r265682 : #i93241# eliminate useless static locale variable 2008-12-17 19:23:07 +0100 pl r265654 : #i97064# set language to OOo user configured UI language (thanks cmc) 2008-12-17 17:44:38 +0100 hdu r265651 : #i97326# debug-helper: print cairo version 2008-12-17 17:43:15 +0100 hdu r265650 : #i97326# ignore cairo changing the transformation of our FT_FACE 2008-12-17 14:44:32 +0100 pl r265604 : #i93631# refine control positioning 2008-12-17 12:40:39 +0100 hdu r265596 : #i97167# update VCL.xcu for MacOSX for Japanese (thanks maho!) 2008-12-17 11:59:51 +0100 hdu r265592 : #i97317# code movement to prevent needless and expensive construction/destruction in error path 2008-12-17 11:54:43 +0100 hdu r265590 : #i97317# workaround QUARTZ bug with drawing small polygons 2008-12-16 17:57:02 +0100 pl r265567 : #i97138# select num copies when grabbing focus 2008-12-16 17:15:11 +0100 pl r265561 : #i93173# lazy deletion of toolbars 2008-12-16 16:33:51 +0100 pl r265558 : #i93173# lazy deletion of toolbars: reparent floating DockingWindows in doLazyDelete 2008-12-16 13:23:17 +0100 pl r265536 : #i97196# ensure style engine has been loaded (thanks cmc)
2009-02-11 10:53:35 +00:00
i18n::Boundary aBoundary = xBI->getWordBoundary( aText, nBreakPos, rDefLocale, ::com::sun::star::i18n::WordType::DICTIONARY_WORD, sal_True );
// sal_uInt16 nWordStart = nBreakPos;
// sal_uInt16 nBreakPos_OLD = nBreakPos;
sal_uInt16 nWordStart = nPos;
sal_uInt16 nWordEnd = (USHORT) aBoundary.endPos;
DBG_ASSERT( nWordEnd > nWordStart, "ImpBreakLine: Start >= End?" );
USHORT nWordLen = nWordEnd - nWordStart;
if ( ( nWordEnd >= nSoftBreak ) && ( nWordLen > 3 ) )
{
// #104415# May happen, because getLineBreak may differ from getWordBoudary with DICTIONARY_WORD
// DBG_ASSERT( nWordEnd >= nMaxBreakPos, "Hyph: Break?" );
String aWord( aText, nWordStart, nWordLen );
sal_uInt16 nMinTrail = static_cast<sal_uInt16>(nWordEnd-nSoftBreak+1); //+1: Vor dem angeknacksten Buchstaben
uno::Reference< linguistic2::XHyphenatedWord > xHyphWord;
if (xHyph.is())
CWS-TOOLING: integrate CWS vcl98 2009-01-16 15:17:38 +0100 pl r266422 : #i93515# add fix for compiz (thanks cmc) 2009-01-15 10:55:36 +0100 thb r266352 : #i97399# start==end angle means no arc at all 2009-01-14 18:54:37 +0100 pl r266327 : #i96536# #i96396# add: pagescroll for wheel events (thanks mod) 2009-01-14 18:21:06 +0100 pl r266325 : #i96536# #i96396# add: gestures, bracket matching (thanks mod) 2009-01-13 12:03:29 +0100 hdu r266206 : #i98024# preserve glyph zero-advance for artificial bold and vertical layout (thanks CMC!) 2009-01-12 16:32:20 +0100 hdu r266167 : #i97991# fix rotated text: temporary workaround for #i87686# 2009-01-08 17:16:17 +0100 hdu r266028 : #159054# ignore empty ATSULayout 2009-01-08 16:59:05 +0100 hdu r266026 : #159054# prevent invalid ATSUStyle 2009-01-07 19:04:06 +0100 pl r265976 : #158288# add extraction of fonts and individual object streams to pdfunzip 2009-01-07 14:42:17 +0100 pl r265969 : #i93011# workaround our ancient accelerator mechanisms to have deeper child window hirearchies working 2009-01-07 14:39:15 +0100 pl r265967 : #i93011# workaround our ancient accelerator mechanisms to have deeper child window hirearchies working 2009-01-07 11:10:58 +0100 hdu r265956 : #i97522# getPixel() returns COL_BLACK on printers or when out of bounds 2009-01-06 18:41:48 +0100 pl r265938 : #i97696# do not force user password to owner password after all 2009-01-06 18:00:52 +0100 pl r265934 : #i97157# fix a snafu 2009-01-06 13:23:38 +0100 pl r265914 : #i93515# support for _NET_WM_USER_TIME (thanks cmc) 2009-01-06 12:50:37 +0100 hdu r265912 : #i97538# get rid of compiler warnings for complex logical expressions 2009-01-06 12:49:09 +0100 hdu r265911 : #i97538# get rid of compiler warnings for complex logical expressions 2009-01-06 12:14:07 +0100 hdu r265906 : #i97522# implemented AquaSalGraphics::getPixel() 2008-12-18 16:46:59 +0100 pl r265706 : #i96343# reset quick job flag 2008-12-18 16:44:22 +0100 pl r265705 : #i96343# reset quick job flag 2008-12-18 14:08:22 +0100 pl r265688 : #i93241# fix bit field query 2008-12-18 12:41:52 +0100 pl r265682 : #i93241# eliminate useless static locale variable 2008-12-17 19:23:07 +0100 pl r265654 : #i97064# set language to OOo user configured UI language (thanks cmc) 2008-12-17 17:44:38 +0100 hdu r265651 : #i97326# debug-helper: print cairo version 2008-12-17 17:43:15 +0100 hdu r265650 : #i97326# ignore cairo changing the transformation of our FT_FACE 2008-12-17 14:44:32 +0100 pl r265604 : #i93631# refine control positioning 2008-12-17 12:40:39 +0100 hdu r265596 : #i97167# update VCL.xcu for MacOSX for Japanese (thanks maho!) 2008-12-17 11:59:51 +0100 hdu r265592 : #i97317# code movement to prevent needless and expensive construction/destruction in error path 2008-12-17 11:54:43 +0100 hdu r265590 : #i97317# workaround QUARTZ bug with drawing small polygons 2008-12-16 17:57:02 +0100 pl r265567 : #i97138# select num copies when grabbing focus 2008-12-16 17:15:11 +0100 pl r265561 : #i93173# lazy deletion of toolbars 2008-12-16 16:33:51 +0100 pl r265558 : #i93173# lazy deletion of toolbars: reparent floating DockingWindows in doLazyDelete 2008-12-16 13:23:17 +0100 pl r265536 : #i97196# ensure style engine has been loaded (thanks cmc)
2009-02-11 10:53:35 +00:00
xHyphWord = xHyph->hyphenate( aWord, rDefLocale, aWord.Len() - nMinTrail, uno::Sequence< beans::PropertyValue >() );
if (xHyphWord.is())
{
sal_Bool bAlternate = xHyphWord->isAlternativeSpelling();
sal_uInt16 _nWordLen = 1 + xHyphWord->getHyphenPos();
if ( ( _nWordLen >= 2 ) && ( (nWordStart+_nWordLen) >= ( 2 ) ) )
{
if ( !bAlternate )
{
nBreakPos = nWordStart + _nWordLen;
}
else
{
String aAlt( xHyphWord->getHyphenatedWord() );
// Wir gehen von zwei Faellen aus, die nun
// vorliegen koennen:
// 1) packen wird zu pak-ken
// 2) Schiffahrt wird zu Schiff-fahrt
// In Fall 1 muss ein Zeichen ersetzt werden,
// in Fall 2 wird ein Zeichen hinzugefuegt.
// Die Identifikation wird erschwert durch Worte wie
// "Schiffahrtsbrennesseln", da der Hyphenator alle
// Position des Wortes auftrennt und "Schifffahrtsbrennnesseln"
// ermittelt. Wir koennen also eigentlich nicht unmittelbar vom
// Index des AlternativWord auf aWord schliessen.
// Das ganze geraffel wird durch eine Funktion am
// Hyphenator vereinfacht werden, sobald AMA sie einbaut...
sal_uInt16 nAltStart = _nWordLen - 1;
sal_uInt16 nTxtStart = nAltStart - (aAlt.Len() - aWord.Len());
sal_uInt16 nTxtEnd = nTxtStart;
sal_uInt16 nAltEnd = nAltStart;
// Die Bereiche zwischen den nStart und nEnd ist
// die Differenz zwischen Alternativ- und OriginalString.
while( nTxtEnd < aWord.Len() && nAltEnd < aAlt.Len() &&
aWord.GetChar(nTxtEnd) != aAlt.GetChar(nAltEnd) )
{
++nTxtEnd;
++nAltEnd;
}
// Wenn ein Zeichen hinzugekommen ist, dann bemerken wir es jetzt:
if( nAltEnd > nTxtEnd && nAltStart == nAltEnd &&
aWord.GetChar( nTxtEnd ) == aAlt.GetChar(nAltEnd) )
{
++nAltEnd;
++nTxtStart;
++nTxtEnd;
}
DBG_ASSERT( ( nAltEnd - nAltStart ) == 1, "Alternate: Falsche Annahme!" );
if ( nTxtEnd > nTxtStart )
cAlternateReplChar = aAlt.GetChar( nAltStart );
else
cAlternateExtraChar = aAlt.GetChar( nAltStart );
nBreakPos = nWordStart + nTxtStart;
if ( cAlternateReplChar )
nBreakPos++;
}
} // if (xHyphWord.is())
} // if ( ( nWordEnd >= nSoftBreak ) && ( nWordLen > 3 ) )
} // if ( xHyph.is() )
CWS-TOOLING: integrate CWS vcl98 2009-01-16 15:17:38 +0100 pl r266422 : #i93515# add fix for compiz (thanks cmc) 2009-01-15 10:55:36 +0100 thb r266352 : #i97399# start==end angle means no arc at all 2009-01-14 18:54:37 +0100 pl r266327 : #i96536# #i96396# add: pagescroll for wheel events (thanks mod) 2009-01-14 18:21:06 +0100 pl r266325 : #i96536# #i96396# add: gestures, bracket matching (thanks mod) 2009-01-13 12:03:29 +0100 hdu r266206 : #i98024# preserve glyph zero-advance for artificial bold and vertical layout (thanks CMC!) 2009-01-12 16:32:20 +0100 hdu r266167 : #i97991# fix rotated text: temporary workaround for #i87686# 2009-01-08 17:16:17 +0100 hdu r266028 : #159054# ignore empty ATSULayout 2009-01-08 16:59:05 +0100 hdu r266026 : #159054# prevent invalid ATSUStyle 2009-01-07 19:04:06 +0100 pl r265976 : #158288# add extraction of fonts and individual object streams to pdfunzip 2009-01-07 14:42:17 +0100 pl r265969 : #i93011# workaround our ancient accelerator mechanisms to have deeper child window hirearchies working 2009-01-07 14:39:15 +0100 pl r265967 : #i93011# workaround our ancient accelerator mechanisms to have deeper child window hirearchies working 2009-01-07 11:10:58 +0100 hdu r265956 : #i97522# getPixel() returns COL_BLACK on printers or when out of bounds 2009-01-06 18:41:48 +0100 pl r265938 : #i97696# do not force user password to owner password after all 2009-01-06 18:00:52 +0100 pl r265934 : #i97157# fix a snafu 2009-01-06 13:23:38 +0100 pl r265914 : #i93515# support for _NET_WM_USER_TIME (thanks cmc) 2009-01-06 12:50:37 +0100 hdu r265912 : #i97538# get rid of compiler warnings for complex logical expressions 2009-01-06 12:49:09 +0100 hdu r265911 : #i97538# get rid of compiler warnings for complex logical expressions 2009-01-06 12:14:07 +0100 hdu r265906 : #i97522# implemented AquaSalGraphics::getPixel() 2008-12-18 16:46:59 +0100 pl r265706 : #i96343# reset quick job flag 2008-12-18 16:44:22 +0100 pl r265705 : #i96343# reset quick job flag 2008-12-18 14:08:22 +0100 pl r265688 : #i93241# fix bit field query 2008-12-18 12:41:52 +0100 pl r265682 : #i93241# eliminate useless static locale variable 2008-12-17 19:23:07 +0100 pl r265654 : #i97064# set language to OOo user configured UI language (thanks cmc) 2008-12-17 17:44:38 +0100 hdu r265651 : #i97326# debug-helper: print cairo version 2008-12-17 17:43:15 +0100 hdu r265650 : #i97326# ignore cairo changing the transformation of our FT_FACE 2008-12-17 14:44:32 +0100 pl r265604 : #i93631# refine control positioning 2008-12-17 12:40:39 +0100 hdu r265596 : #i97167# update VCL.xcu for MacOSX for Japanese (thanks maho!) 2008-12-17 11:59:51 +0100 hdu r265592 : #i97317# code movement to prevent needless and expensive construction/destruction in error path 2008-12-17 11:54:43 +0100 hdu r265590 : #i97317# workaround QUARTZ bug with drawing small polygons 2008-12-16 17:57:02 +0100 pl r265567 : #i97138# select num copies when grabbing focus 2008-12-16 17:15:11 +0100 pl r265561 : #i93173# lazy deletion of toolbars 2008-12-16 16:33:51 +0100 pl r265558 : #i93173# lazy deletion of toolbars: reparent floating DockingWindows in doLazyDelete 2008-12-16 13:23:17 +0100 pl r265536 : #i97196# ensure style engine has been loaded (thanks cmc)
2009-02-11 10:53:35 +00:00
} // if ( (nStyle & TEXT_DRAW_WORDBREAK_HYPHENATION) == TEXT_DRAW_WORDBREAK_HYPHENATION )
}
nLineWidth = _rLayout.GetTextWidth( rStr, nPos, nBreakPos-nPos );
}
else
{
// fallback to something really simple
USHORT nSpacePos = STRING_LEN;
long nW = 0;
do
{
nSpacePos = rStr.SearchBackward( sal_Unicode(' '), nSpacePos );
if( nSpacePos != STRING_NOTFOUND )
{
if( nSpacePos > nPos )
nSpacePos--;
nW = _rLayout.GetTextWidth( rStr, nPos, nSpacePos-nPos );
}
} while( nW > nWidth );
if( nSpacePos != STRING_NOTFOUND )
{
nBreakPos = nSpacePos;
nLineWidth = _rLayout.GetTextWidth( rStr, nPos, nBreakPos-nPos );
if( nBreakPos < rStr.Len()-1 )
nBreakPos++;
}
}
2000-09-18 16:07:07 +00:00
}
if ( nLineWidth > nMaxLineWidth )
nMaxLineWidth = nLineWidth;
rLineInfo.AddLine( new ImplTextLineInfo( nLineWidth, nPos, nBreakPos-nPos ) );
if ( nBreakPos == nPos )
nBreakPos++;
2000-09-18 16:07:07 +00:00
nPos = nBreakPos;
if ( ( rStr.GetChar( nPos ) == _CR ) || ( rStr.GetChar( nPos ) == _LF ) )
{
nPos++;
// CR/LF?
if ( ( nPos < nLen ) && ( rStr.GetChar( nPos ) == _LF ) && ( rStr.GetChar( nPos-1 ) == _CR ) )
nPos++;
}
2000-09-18 16:07:07 +00:00
}
}
2001-03-07 12:23:33 +00:00
#ifdef DBG_UTIL
for ( USHORT nL = 0; nL < rLineInfo.Count(); nL++ )
{
ImplTextLineInfo* pLine = rLineInfo.GetLine( nL );
String aLine( rStr, pLine->GetIndex(), pLine->GetLen() );
DBG_ASSERT( aLine.Search( _CR ) == STRING_NOTFOUND, "ImplGetTextLines - Found CR!" );
DBG_ASSERT( aLine.Search( _LF ) == STRING_NOTFOUND, "ImplGetTextLines - Found LF!" );
}
#endif
2000-09-18 16:07:07 +00:00
return nMaxLineWidth;
}
// =======================================================================
2001-02-23 15:13:58 +00:00
void OutputDevice::SetAntialiasing( USHORT nMode )
{
2001-02-27 14:38:55 +00:00
if ( mnAntialiasing != nMode )
{
mnAntialiasing = nMode;
mbInitFont = TRUE;
CWS-TOOLING: integrate CWS aw059 2008-12-16 16:15:40 +0100 aw r265557 : #i95645# avoid expensive tries to stream in graphic data when stream is at end anyways 2008-12-15 16:49:58 +0100 wg r265512 : i97278 2008-12-12 16:02:15 +0100 aw r265427 : #i95645# new formulation was wrong in two places; thanks go to THB. Thanks! 2008-12-12 15:49:06 +0100 aw r265425 : #i95645# refined formulation of AA on/off constraints for VCLCanvas 2008-12-12 14:51:26 +0100 aw r265420 : #i95645# workaround for DrawTransparent of button hilighting when remote displayed; somehow GDI+ does bad dithering in that case 2008-12-12 13:23:00 +0100 aw r265414 : removed temporary build hack; it made it's way in using the rebase; with SVN the rebase is not based on pure checkouts, but uses local changes. 2008-12-11 19:35:59 +0100 aw r265352 : #i95645# need to switch off AA for WNT and UNX, the VCLCanvas is currently not able to handle AA correctly 2008-12-11 16:05:17 +0100 thb r265327 : #i95645# Changed defaults to on; as for the while svx dialog is not changed 2008-12-10 13:40:38 +0100 aw r265180 : #i95645# changed pixel snap to basegfx::fround 2008-12-10 13:25:45 +0100 aw r265177 : corrected linux warning 2008-12-10 12:28:02 +0100 aw r265167 : #i95645# added support for pixel snap/linux resp. no AA for mac (also pixel snap) when AA is switched off to the basegfx::B2DPolyPolygon painting VCL methods; needed for e.g. selection in SC and SW 2008-12-09 18:44:39 +0100 aw r265136 : #i95645# corrected filled path construction 2008-12-09 18:12:40 +0100 aw r265133 : #i95645# added support for non-AAd transparent paints 2008-12-09 18:11:58 +0100 aw r265132 : #i95645# forced selection without AA 2008-12-09 18:11:29 +0100 aw r265131 : #i88893# smoothed/corrected SW selection rects for transparent selection, forced selection without AA 2008-12-09 15:21:39 +0100 aw r265094 : #i95645# corrected FormControl full drag 2008-12-09 15:11:26 +0100 aw r265093 : #i95645# make gdiplus usages more safe when no line or fill color is selected 2008-12-09 14:30:09 +0100 aw r265085 : #i95645# added GDIPlus support 2008-12-09 13:41:06 +0100 aw r265081 : #i95645# added simple AA using GDIPlis to VCL 2008-12-09 13:40:46 +0100 aw r265080 : #i95645# added simple AA using GDIPlis to VCL 2008-12-09 13:40:29 +0100 aw r265079 : #i95645# added simple AA using GDIPlis to VCL 2008-12-09 13:33:16 +0100 aw r265078 : #i95645# changes to requirements, discussed with FPE 2008-12-08 14:11:39 +0100 aw r264995 : #i95646# added missing extra-wireframe for SdrDragObjOwn implementations when object has no border 2008-12-08 14:11:00 +0100 aw r264994 : #i95646# corrected RenderMarkerArrayPrimitive2D OutDev usage in VclProcessor2D 2008-12-08 12:15:10 +0100 ufi r264987 : aw059 2008-12-08 12:14:40 +0100 ufi r264986 : aw059 2008-12-05 13:16:18 +0100 aw r264905 : CWS-TOOLING: rebase CWS aw059 to trunk@264807 (milestone: DEV300:m37) 2008-12-04 11:29:48 +0100 aw r264827 : #i95645# corrected warning 2008-12-03 14:43:39 +0100 aw r264783 : #i95645# simplified overlay manager and objects to stl vector; added stuff to render some more overlay to primitive renderer to get AA support for WIN32 2008-12-03 14:42:43 +0100 aw r264782 : #i95645# added test for WIN32 for AA if cairo canvas is available 2008-12-03 14:42:13 +0100 aw r264781 : #i95645# removed unused options for writer selection overlay 2008-12-03 14:41:51 +0100 aw r264780 : #i95645# removed unused options for calc overlay 2008-12-03 14:41:21 +0100 aw r264779 : #i95645# small corrections in canvas renderer 2008-12-02 18:32:31 +0100 aw r264730 : #i95646# merged cairo version from THB's CWS cairosource01 2008-12-02 15:25:45 +0100 aw r264705 : #i95645# added helpers for the MarkerArrayPrimitive2D change which support buffered creation of the most used markers 2008-12-02 12:50:01 +0100 aw r264690 : #i95645# added a non-saved method IsAAPossibleOnThisSystem to SvtOptionsDrawinglayer to quickly test if AA can be offered on the system, added buffering of that check. 2008-12-02 12:48:51 +0100 aw r264689 : #i95645# unified MarkerArrayPrimitive2D to work bitmap-orientated, adapted usages. Added buffered preparation for needed markers. Minor adaptions for AA 2008-12-02 12:47:53 +0100 aw r264688 : #i95645# unified MarkerArrayPrimitive2D to no longer work on a enum and types of markers, but to use a BitmapEx (or any other Bitmap object) which will be displayed centerd and in discrete coordinates at positions. Adapted decomposition and all usages. Corrected minor stuff with grid primitive 2008-11-28 17:11:12 +0100 thb r264565 : #i95645# Added two more lists to config; to be able to differentiate canvas capabilities 2008-11-28 17:03:27 +0100 thb r264563 : #i95645# Added two more lists to config; to be able to differentiate canvas capabilities 2008-11-28 17:00:07 +0100 thb r264562 : #i95645# Added two more lists to config; to be able to differentiate canvas capabilities 2008-11-28 16:59:51 +0100 thb r264561 : #i95645# Added two more lists to config; to be able to differentiate canvas capabilities 2008-11-27 19:13:42 +0100 aw r264519 : #i95646# optimized getLength() a little bit 2008-11-27 19:12:50 +0100 aw r264518 : #i95646# corrected AA expansion of invalidate frame; buffered discrete distance at OM 2008-11-27 18:50:05 +0100 aw r264516 : #i95646# corrected fit to frame texts for WIN32 2008-11-27 15:32:15 +0100 aw r264496 : #i95646# helplines corrected 2008-11-27 15:32:05 +0100 aw r264495 : #i95646# helplines corrected 2008-11-27 15:01:30 +0100 aw r264492 : #i95646# enable AA support for old polygons, especially to get support for MetaFile output 2008-11-27 14:33:28 +0100 aw r264489 : #i95646# AA support for wireframe overlays 2008-11-27 13:40:54 +0100 aw r264485 : #i95646# added full repaint when AA option changes 2008-11-27 13:29:19 +0100 aw r264482 : #i95646# corrected handling of bSolidDragging config entries 2008-11-27 13:29:08 +0100 aw r264481 : #i95646# corrected handling of bSolidDragging config entries 2008-11-27 11:30:12 +0100 aw r264469 : #i95646# corrected IsAAPossibleOnThisSystem implementation 2008-11-26 16:33:04 +0100 aw r264420 : #i95646# adapted OfaViewTabPage to use disable mechanism for AA and HWAccel 2008-11-26 15:49:19 +0100 aw r264406 : #i95646# added DlgEdObj::getFullDragClone() to create specialized simple SdrUnoObj clones for solid dragging 2008-11-26 15:48:11 +0100 aw r264405 : #i95646# changed derivation of ViewObjectContactOfUnoControl to get a valid isPrimitiveVisible() implementation 2008-11-26 14:11:37 +0100 aw r264385 : #i88893# added new look for selection in sw 2008-11-26 11:32:33 +0100 aw r264360 : corrected compiler warning 2008-11-25 18:46:29 +0100 aw r264328 : #i95646# snapshot with FullDrag clones 2008-11-25 18:46:07 +0100 aw r264327 : #i95646# snapshot with FullDrag clones 2008-11-25 18:45:43 +0100 aw r264326 : #i95646# snapshot with FullDrag clones 2008-11-25 18:19:04 +0100 thb r264324 : #i96585# Added missing inline specifier 2008-11-25 13:16:25 +0100 aw r264285 : #i95646# next snapshot 2008-11-25 13:15:33 +0100 aw r264284 : #i95646# next snapshot 2008-11-25 13:15:12 +0100 aw r264283 : #i95646# next snapshot 2008-11-25 13:14:51 +0100 aw r264282 : #i95646# next snapshot 2008-11-20 13:40:49 +0100 aw r264045 : #i95646# stable snapshot 2008-11-20 13:40:29 +0100 aw r264044 : #i95646# stable snapshot 2008-11-20 13:40:06 +0100 aw r264043 : #i95646# stable snapshot 2008-11-20 13:39:45 +0100 aw r264042 : #i95646# stable snapshot 2008-11-18 11:53:39 +0100 aw r263758 : #i95646# snapshot for linux test build 2008-11-18 11:52:54 +0100 aw r263757 : #i95646# snapshot for linux test build 2008-11-18 11:52:02 +0100 aw r263756 : #i95646# snapshot for linux test build 2008-11-14 18:17:49 +0100 aw r263692 : #i95646# snapshot with most stuff working 2008-11-14 18:14:26 +0100 aw r263691 : #i95646# snapshot with most stuff working 2008-11-14 18:12:50 +0100 aw r263690 : #i95646# snapshot with most stuff working 2008-11-14 18:12:16 +0100 aw r263689 : #i95646# snapshot with most stuff working 2008-11-14 18:11:41 +0100 aw r263688 : #i95646# snapshot with most stuff working 2008-11-07 18:44:22 +0100 aw r263479 : #i95968# better support PrefMapMode; special for MAP_PIXEL was missing 2008-11-05 17:39:15 +0100 aw r263356 : #i95644# #i95645# #i95646# bigger change done, saving for another experiment 2008-11-05 17:39:02 +0100 aw r263355 : #i95644# #i95645# #i95646# bigger change done, saving for another experiment 2008-11-05 12:28:32 +0100 aw r263350 : #i95644# #i95645# #i95646# in-between state before bigger change 2008-11-05 12:27:51 +0100 aw r263349 : #i95644# #i95645# #i95646# in-between state before bigger change 2008-11-05 12:26:58 +0100 aw r263348 : #i95644# #i95645# #i95646# in-between state before bigger change 2008-11-05 12:26:17 +0100 aw r263347 : #i95644# #i95645# #i95646# in-between state before bigger change 2008-11-05 12:25:55 +0100 aw r263346 : #i95644# #i95645# #i95646# in-between state before bigger change
2009-01-05 13:44:12 +00:00
if(mpGraphics)
{
mpGraphics->setAntiAliasB2DDraw(mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW);
}
2001-02-27 14:38:55 +00:00
}
if( mpAlphaVDev )
mpAlphaVDev->SetAntialiasing( nMode );
2001-02-23 15:13:58 +00:00
}
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
void OutputDevice::SetFont( const Font& rNewFont )
{
DBG_TRACE( "OutputDevice::SetFont()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_CHKOBJ( &rNewFont, Font, NULL );
Font aFont( rNewFont );
CWS-TOOLING: integrate CWS graphite01 2009-08-06 11:09:01 +0200 hdu r274708 : #i10000# fix build breaker for SYSTEM_GRAPHITE=NO 2009-07-21 12:01:52 +0200 hdu r274174 : #i93645# fix include files for EXT_USE_STLPORT 2009-07-21 11:51:07 +0200 hdu r274173 : #i93645# convert line-endings of files to be patched 2009-07-21 10:49:01 +0200 hdu r274170 : #i93645# adjust makefile.vc8 for HH-RelEng env (thanks ause) 2009-07-20 05:21:32 +0200 kstribley r274105 : attempt to fix Windows build error caused by NULL variable in nmake file 2009-07-16 10:22:36 +0200 hdu r274032 : #i69129# also use solar minor version to find graphite lib 2009-07-16 05:36:06 +0200 kstribley r274029 : allow windows build to have Graphite disabled with SAL_DISABLE_GRAPHITE 2009-07-15 13:59:22 +0200 hdu r274011 : #i69129# default to ENABLE_GRAPHITE=TRUE 2009-07-15 13:19:54 +0200 hdu r274008 : #i93645# ignore compile warnings for graphite 2009-07-15 13:18:25 +0200 hdu r274006 : #i93645# stlport needs libmath, use solar minor version to find matching libs 2009-07-15 09:21:13 +0200 hdu r273989 : #i100000# avoid compile warning 2009-07-14 12:19:08 +0200 hdu r273963 : CWS-TOOLING: rebase CWS graphite01 to trunk@273858 (milestone: DEV300:m52) 2009-07-13 06:54:56 +0200 kstribley r273912 : change to use standard file headers 2009-07-13 05:39:14 +0200 kstribley r273911 : Remove unnecessary change to configure.in as reported by Rene 2009-07-10 16:58:44 +0200 hdu r273902 : #i100000# fix compile for precompiled-header support 2009-07-02 13:48:26 +0200 kstribley r273647 : #69129# fix a graphite bug which could crash with fonts containing obscure GDL positioning rules 2009-07-02 01:44:02 +0200 rene r273616 : #i10000# we need to link with -licuuc 2009-07-01 04:02:20 +0200 kstribley r273540 : restore missing sdf files from base 2009-07-01 04:01:40 +0200 kstribley r273539 : restore missing sdf files from base 2009-07-01 04:01:12 +0200 kstribley r273538 : restore missing sdf files from base 2009-07-01 03:59:41 +0200 kstribley r273537 : restore missing sdf files from base 2009-06-29 10:16:51 +0200 kstribley r273456 : #i69129# fixes a bug which caused occasional incorrect linebreaking when graphite is asked to render a part of a cluster not containing a base 2009-06-27 10:43:58 +0200 kstribley r273445 : #i69129# added kashida support for justified RTL text 2009-06-01 12:57:06 +0200 kstribley r272476 : CWS-TOOLING: rebase CWS graphite01 to trunk@272291 (milestone: DEV300:m49) 2009-05-26 10:50:06 +0200 kstribley r272286 : #i69129# fixes a build error when NDEBUG is not defined 2009-05-25 13:14:06 +0200 kstribley r272237 : #i69129# enable debugging by fixing compile warnings 2009-05-25 13:07:47 +0200 kstribley r272234 : #i69129# added env variable to disable GRAPHITE at run time on linux and fixed a bug with a rare attachment sequence 2009-04-20 17:39:25 +0200 kstribley r271001 : CWS-TOOLING: rebase CWS graphite01 to trunk@270723 (milestone: DEV300:m46) 2009-04-18 07:11:33 +0200 kstribley r270957 : #i101178# attempt to fix buildbot builds by reordering configure.in 2009-04-14 17:37:07 +0200 kstribley r270801 : #i93645# tweak configure to enable graphite by default on windows and linux to assist testing with tinderbox build 2009-04-14 16:33:17 +0200 kstribley r270796 : #i96925# another fix for rtl fallback and add optional debug info in MultiSalLayout 2009-04-08 13:27:55 +0200 kstribley r270641 : #i69129# fix features after a bad merge 2009-04-08 13:26:34 +0200 kstribley r270640 : #i69129# add a patch for WinFont 2009-03-24 12:37:54 +0100 kstribley r269937 : #i69129# fix build error due to locale being included in method for features 2009-03-24 12:36:10 +0100 kstribley r269936 : #i93645# change patch variable and fix configure 2009-03-20 04:18:56 +0100 kstribley r269776 : CWS-TOOLING: rebase CWS graphite01 to trunk@269297 (milestone: DEV300:m43) 2009-03-01 13:10:59 +0100 kstribley r268622 : added a patch to improve handling of a font with bad graphite language feature tables #i93645# 2009-02-12 04:50:51 +0100 kstribley r267631 : #i93645# fix windows build for graphite 2.3.1 and remove unnecessary patch 2009-02-10 04:48:50 +0100 kstribley r267535 : #i93645# fix a build error with stlport on Ubuntu 8.10 x86 2009-02-10 03:51:10 +0100 kstribley r267534 : #i69129# remove legacy config_office 2009-02-07 19:12:54 +0100 kstribley r267482 : #i93645# upgrade to using silgraphite-2.3.1 2009-02-02 18:17:57 +0100 kstribley r267290 : #i69129# backout unwanted checkin 2009-02-02 17:44:03 +0100 kstribley r267281 : #i69129# backout erroneous update to aclocal.m4 2009-02-01 10:05:03 +0100 kstribley r267236 : #i69129# fix build error due to locale being added to set font attributes 2009-02-01 06:02:52 +0100 kstribley r267235 : #i69129# fix erroneous merge 2009-01-31 16:24:56 +0100 kstribley r267234 : #i69129# update configure.in solenv.in in their new locations with enable graphite 2009-01-31 10:53:18 +0100 kstribley r267232 : CWS-TOOLING: rebase CWS graphite01 to trunk@267171 (milestone: DEV300:m41) 2008-12-17 04:17:33 +0100 kstribley r265577 : #i93645# remove superfluous autoreconf check and autoconf patch 2008-12-16 10:07:20 +0100 rene r265529 : fix aclocal.m4 breakage 2008-12-16 05:13:29 +0100 kstribley r265520 : #i93645# change to autoconf && configure 2008-12-16 04:39:48 +0100 kstribley r265519 : #i93645# modified LD_FLAGS so that system graphite isn't pulled in by accident and fixed autoconf problem 2008-12-15 14:16:25 +0100 rene r265497 : check for working STL 2008-12-15 12:53:39 +0100 rene r265473 : revert broken check 2008-12-15 11:59:21 +0100 kstribley r265472 : #i93645# added check for system STL, since this is a requirement for system graphite to work correctly and moved the position of the check further down 2008-12-15 11:55:34 +0100 kstribley r265471 : #i93645# remove references to gr3ooo to allow system graphite to be used 2008-12-12 18:48:18 +0100 rene r265437 : fix link for system-graphite 2008-12-12 18:46:45 +0100 rene r265436 : the tarball is in graphite, remove obsolete check 2008-12-12 18:22:22 +0100 rene r265433 : typo; re-autoconf 2008-12-12 17:35:26 +0100 rene r265432 : actually implement SYSTEM_GRAPHIT checks (as already checked for in makefile.mks) but remove the checks in graphit itself and move to BUILD_TYPE 2008-12-12 08:08:33 +0100 kstribley r265387 : #i69129# 2 of the patched files need windows line endings so patch works on linux as well as windows 2008-12-12 08:04:41 +0100 kstribley r265386 : #i69129# rtl fallback fix which prevents caching of segments with fallback 2008-12-08 04:28:12 +0100 kstribley r264969 : results of running autoconf with graphite config changes #i69129# 2008-12-05 08:12:47 +0100 kstribley r264886 : backout unintential change at r264884 2008-12-05 06:26:33 +0100 kstribley r264884 : #i96925# fixes for uniscribe fallback 2008-12-05 06:11:37 +0100 kstribley r264883 : #i69129# improvements to windows graphite code, including caching of sila table lookup 2008-12-02 13:28:51 +0100 kstribley r264694 : #i93645# add graphite library and append to patch 2008-11-27 06:47:10 +0100 kstribley r264445 : #69129# fix rtl loop bug and rtl caching problem 2008-11-27 06:42:20 +0100 kstribley r264444 : add caching for GraphiteFontAdaptor 2008-11-14 15:57:03 +0100 kstribley r263681 : #69129# add graphite addtional files from cvs 2008-11-14 15:54:47 +0100 kstribley r263680 : #69129# fix for modified resolution api 2008-11-13 16:24:09 +0100 kstribley r263652 : #69129# add skeleton to build graphite module library 2008-11-13 16:22:19 +0100 kstribley r263651 : #69129# add skeleton to build graphite module library 2008-11-13 16:16:10 +0100 kstribley r263650 : #69129# migrate from cvs 2008-11-13 15:26:54 +0100 kstribley r263646 : #69129# add a module for the graphite library
2009-08-17 14:12:14 +00:00
aFont.SetLanguage(rNewFont.GetLanguage());
2002-03-04 16:07:59 +00:00
if ( mnDrawMode & (DRAWMODE_BLACKTEXT | DRAWMODE_WHITETEXT | DRAWMODE_GRAYTEXT | DRAWMODE_GHOSTEDTEXT | DRAWMODE_SETTINGSTEXT |
2000-09-18 16:07:07 +00:00
DRAWMODE_BLACKFILL | DRAWMODE_WHITEFILL | DRAWMODE_GRAYFILL | DRAWMODE_NOFILL |
2002-03-04 16:07:59 +00:00
DRAWMODE_GHOSTEDFILL | DRAWMODE_SETTINGSFILL ) )
2000-09-18 16:07:07 +00:00
{
Color aTextColor( aFont.GetColor() );
2002-03-04 16:07:59 +00:00
2000-09-18 16:07:07 +00:00
if ( mnDrawMode & DRAWMODE_BLACKTEXT )
aTextColor = Color( COL_BLACK );
else if ( mnDrawMode & DRAWMODE_WHITETEXT )
aTextColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
{
const UINT8 cLum = aTextColor.GetLuminance();
aTextColor = Color( cLum, cLum, cLum );
}
2002-03-04 16:07:59 +00:00
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
aTextColor = GetSettings().GetStyleSettings().GetFontColor();
2002-03-04 16:07:59 +00:00
2000-09-18 16:07:07 +00:00
if ( mnDrawMode & DRAWMODE_GHOSTEDTEXT )
{
aTextColor = Color( (aTextColor.GetRed() >> 1 ) | 0x80,
(aTextColor.GetGreen() >> 1 ) | 0x80,
(aTextColor.GetBlue() >> 1 ) | 0x80 );
}
2002-03-04 16:07:59 +00:00
2000-09-18 16:07:07 +00:00
aFont.SetColor( aTextColor );
BOOL bTransFill = aFont.IsTransparent();
if ( !bTransFill )
{
Color aTextFillColor( aFont.GetFillColor() );
2002-03-04 16:07:59 +00:00
2000-09-18 16:07:07 +00:00
if ( mnDrawMode & DRAWMODE_BLACKFILL )
aTextFillColor = Color( COL_BLACK );
else if ( mnDrawMode & DRAWMODE_WHITEFILL )
aTextFillColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYFILL )
{
const UINT8 cLum = aTextFillColor.GetLuminance();
aTextFillColor = Color( cLum, cLum, cLum );
}
2002-03-04 16:07:59 +00:00
else if( mnDrawMode & DRAWMODE_SETTINGSFILL )
aTextFillColor = GetSettings().GetStyleSettings().GetWindowColor();
2000-09-18 16:07:07 +00:00
else if ( mnDrawMode & DRAWMODE_NOFILL )
{
aTextFillColor = Color( COL_TRANSPARENT );
bTransFill = TRUE;
}
2002-03-04 16:07:59 +00:00
2000-09-18 16:07:07 +00:00
if ( !bTransFill && (mnDrawMode & DRAWMODE_GHOSTEDFILL) )
{
aTextFillColor = Color( (aTextFillColor.GetRed() >> 1) | 0x80,
(aTextFillColor.GetGreen() >> 1) | 0x80,
(aTextFillColor.GetBlue() >> 1) | 0x80 );
}
2002-03-04 16:07:59 +00:00
2000-09-18 16:07:07 +00:00
aFont.SetFillColor( aTextFillColor );
}
}
if ( mpMetaFile )
{
mpMetaFile->AddAction( new MetaFontAction( aFont ) );
// the color and alignment actions don't belong here
// TODO: get rid of them without breaking anything...
2000-09-18 16:07:07 +00:00
mpMetaFile->AddAction( new MetaTextAlignAction( aFont.GetAlign() ) );
mpMetaFile->AddAction( new MetaTextFillColorAction( aFont.GetFillColor(), !aFont.IsTransparent() ) );
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
#if (OSL_DEBUG_LEVEL > 2) || defined (HDU_DEBUG)
fprintf( stderr, " OutputDevice::SetFont( name=\"%s\", h=%ld)\n",
OUStringToOString( aFont.GetName(), RTL_TEXTENCODING_UTF8 ).getStr(),
aFont.GetSize().Height() );
#endif
2000-09-18 16:07:07 +00:00
if ( !maFont.IsSameInstance( aFont ) )
{
// Optimization MT/HDU: COL_TRANSPARENT means SetFont should ignore the font color,
// because SetTextColor() is used for this.
// #i28759# maTextColor might have been changed behind our back, commit then, too.
if( aFont.GetColor() != COL_TRANSPARENT
&& (aFont.GetColor() != maFont.GetColor() || aFont.GetColor() != maTextColor ) )
{
maTextColor = aFont.GetColor();
2000-09-18 16:07:07 +00:00
mbInitTextColor = TRUE;
if( mpMetaFile )
mpMetaFile->AddAction( new MetaTextColorAction( aFont.GetColor() ) );
}
2000-09-18 16:07:07 +00:00
maFont = aFont;
mbNewFont = TRUE;
if( mpAlphaVDev )
{
// #i30463#
// Since SetFont might change the text color, apply that only
// selectively to alpha vdev (which normally paints opaque text
// with COL_BLACK)
if( aFont.GetColor() != COL_TRANSPARENT )
{
mpAlphaVDev->SetTextColor( COL_BLACK );
aFont.SetColor( COL_TRANSPARENT );
}
mpAlphaVDev->SetFont( aFont );
}
}
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void OutputDevice::SetLayoutMode( ULONG nTextLayoutMode )
2002-04-12 10:44:06 +00:00
{
DBG_TRACE( "OutputDevice::SetTextLayoutMode()" );
2002-04-23 06:40:42 +00:00
if( mpMetaFile )
mpMetaFile->AddAction( new MetaLayoutModeAction( nTextLayoutMode ) );
2002-04-23 06:40:42 +00:00
mnTextLayoutMode = nTextLayoutMode;
if( mpAlphaVDev )
mpAlphaVDev->SetLayoutMode( nTextLayoutMode );
2002-04-12 10:44:06 +00:00
}
// -----------------------------------------------------------------------
void OutputDevice::SetDigitLanguage( LanguageType eTextLanguage )
{
DBG_TRACE( "OutputDevice::SetTextLanguage()" );
if( mpMetaFile )
mpMetaFile->AddAction( new MetaTextLanguageAction( eTextLanguage ) );
meTextLanguage = eTextLanguage;
if( mpAlphaVDev )
mpAlphaVDev->SetDigitLanguage( eTextLanguage );
}
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
void OutputDevice::SetTextColor( const Color& rColor )
{
DBG_TRACE( "OutputDevice::SetTextColor()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Color aColor( rColor );
if ( mnDrawMode & ( DRAWMODE_BLACKTEXT | DRAWMODE_WHITETEXT |
2002-03-04 16:07:59 +00:00
DRAWMODE_GRAYTEXT | DRAWMODE_GHOSTEDTEXT |
DRAWMODE_SETTINGSTEXT ) )
2000-09-18 16:07:07 +00:00
{
if ( mnDrawMode & DRAWMODE_BLACKTEXT )
aColor = Color( COL_BLACK );
else if ( mnDrawMode & DRAWMODE_WHITETEXT )
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
{
const UINT8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
2002-03-04 16:07:59 +00:00
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
aColor = GetSettings().GetStyleSettings().GetFontColor();
2000-09-18 16:07:07 +00:00
if ( mnDrawMode & DRAWMODE_GHOSTEDTEXT )
{
aColor = Color( (aColor.GetRed() >> 1) | 0x80,
(aColor.GetGreen() >> 1) | 0x80,
(aColor.GetBlue() >> 1) | 0x80 );
}
}
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaTextColorAction( aColor ) );
if ( maTextColor != aColor )
2000-09-18 16:07:07 +00:00
{
maTextColor = aColor;
2000-09-18 16:07:07 +00:00
mbInitTextColor = TRUE;
}
if( mpAlphaVDev )
mpAlphaVDev->SetTextColor( COL_BLACK );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void OutputDevice::SetTextFillColor()
{
DBG_TRACE( "OutputDevice::SetTextFillColor()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaTextFillColorAction( Color(), FALSE ) );
if ( maFont.GetColor() != Color( COL_TRANSPARENT ) )
maFont.SetFillColor( Color( COL_TRANSPARENT ) );
if ( !maFont.IsTransparent() )
maFont.SetTransparent( TRUE );
if( mpAlphaVDev )
mpAlphaVDev->SetTextFillColor();
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void OutputDevice::SetTextFillColor( const Color& rColor )
{
DBG_TRACE( "OutputDevice::SetTextFillColor()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Color aColor( rColor );
BOOL bTransFill = ImplIsColorTransparent( aColor ) ? TRUE : FALSE;
2000-09-18 16:07:07 +00:00
if ( !bTransFill )
{
if ( mnDrawMode & ( DRAWMODE_BLACKFILL | DRAWMODE_WHITEFILL |
DRAWMODE_GRAYFILL | DRAWMODE_NOFILL |
2002-03-04 16:07:59 +00:00
DRAWMODE_GHOSTEDFILL | DRAWMODE_SETTINGSFILL ) )
2000-09-18 16:07:07 +00:00
{
if ( mnDrawMode & DRAWMODE_BLACKFILL )
aColor = Color( COL_BLACK );
else if ( mnDrawMode & DRAWMODE_WHITEFILL )
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYFILL )
{
const UINT8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
2002-03-04 16:07:59 +00:00
else if( mnDrawMode & DRAWMODE_SETTINGSFILL )
aColor = GetSettings().GetStyleSettings().GetWindowColor();
2000-09-18 16:07:07 +00:00
else if ( mnDrawMode & DRAWMODE_NOFILL )
{
aColor = Color( COL_TRANSPARENT );
bTransFill = TRUE;
}
2002-03-04 16:07:59 +00:00
2000-09-18 16:07:07 +00:00
if ( !bTransFill && (mnDrawMode & DRAWMODE_GHOSTEDFILL) )
{
aColor = Color( (aColor.GetRed() >> 1) | 0x80,
(aColor.GetGreen() >> 1) | 0x80,
(aColor.GetBlue() >> 1) | 0x80 );
}
}
}
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaTextFillColorAction( aColor, TRUE ) );
if ( maFont.GetFillColor() != aColor )
maFont.SetFillColor( aColor );
if ( maFont.IsTransparent() != bTransFill )
maFont.SetTransparent( bTransFill );
if( mpAlphaVDev )
mpAlphaVDev->SetTextFillColor( COL_BLACK );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
Color OutputDevice::GetTextFillColor() const
{
if ( maFont.IsTransparent() )
return Color( COL_TRANSPARENT );
else
return maFont.GetFillColor();
}
// -----------------------------------------------------------------------
void OutputDevice::SetTextLineColor()
{
DBG_TRACE( "OutputDevice::SetTextLineColor()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaTextLineColorAction( Color(), FALSE ) );
maTextLineColor = Color( COL_TRANSPARENT );
if( mpAlphaVDev )
mpAlphaVDev->SetTextLineColor();
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void OutputDevice::SetTextLineColor( const Color& rColor )
{
DBG_TRACE( "OutputDevice::SetTextLineColor()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Color aColor( rColor );
if ( mnDrawMode & ( DRAWMODE_BLACKTEXT | DRAWMODE_WHITETEXT |
2002-03-04 16:07:59 +00:00
DRAWMODE_GRAYTEXT | DRAWMODE_GHOSTEDTEXT |
DRAWMODE_SETTINGSTEXT ) )
2000-09-18 16:07:07 +00:00
{
if ( mnDrawMode & DRAWMODE_BLACKTEXT )
aColor = Color( COL_BLACK );
else if ( mnDrawMode & DRAWMODE_WHITETEXT )
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
{
const UINT8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
2002-03-04 16:07:59 +00:00
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
aColor = GetSettings().GetStyleSettings().GetFontColor();
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( (mnDrawMode & DRAWMODE_GHOSTEDTEXT)
&& (aColor.GetColor() != COL_TRANSPARENT) )
2000-09-18 16:07:07 +00:00
{
aColor = Color( (aColor.GetRed() >> 1) | 0x80,
(aColor.GetGreen() >> 1) | 0x80,
(aColor.GetBlue() >> 1) | 0x80 );
}
}
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaTextLineColorAction( aColor, TRUE ) );
maTextLineColor = aColor;
if( mpAlphaVDev )
mpAlphaVDev->SetTextLineColor( COL_BLACK );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void OutputDevice::SetOverlineColor()
{
DBG_TRACE( "OutputDevice::SetOverlineColor()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaOverlineColorAction( Color(), FALSE ) );
maOverlineColor = Color( COL_TRANSPARENT );
if( mpAlphaVDev )
mpAlphaVDev->SetOverlineColor();
}
// -----------------------------------------------------------------------
void OutputDevice::SetOverlineColor( const Color& rColor )
{
DBG_TRACE( "OutputDevice::SetOverlineColor()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Color aColor( rColor );
if ( mnDrawMode & ( DRAWMODE_BLACKTEXT | DRAWMODE_WHITETEXT |
DRAWMODE_GRAYTEXT | DRAWMODE_GHOSTEDTEXT |
DRAWMODE_SETTINGSTEXT ) )
{
if ( mnDrawMode & DRAWMODE_BLACKTEXT )
aColor = Color( COL_BLACK );
else if ( mnDrawMode & DRAWMODE_WHITETEXT )
aColor = Color( COL_WHITE );
else if ( mnDrawMode & DRAWMODE_GRAYTEXT )
{
const UINT8 cLum = aColor.GetLuminance();
aColor = Color( cLum, cLum, cLum );
}
else if ( mnDrawMode & DRAWMODE_SETTINGSTEXT )
aColor = GetSettings().GetStyleSettings().GetFontColor();
if( (mnDrawMode & DRAWMODE_GHOSTEDTEXT)
&& (aColor.GetColor() != COL_TRANSPARENT) )
{
aColor = Color( (aColor.GetRed() >> 1) | 0x80,
(aColor.GetGreen() >> 1) | 0x80,
(aColor.GetBlue() >> 1) | 0x80 );
}
}
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaOverlineColorAction( aColor, TRUE ) );
maOverlineColor = aColor;
if( mpAlphaVDev )
mpAlphaVDev->SetOverlineColor( COL_BLACK );
}
// -----------------------------------------------------------------------
2002-04-23 06:40:42 +00:00
2000-09-18 16:07:07 +00:00
void OutputDevice::SetTextAlign( TextAlign eAlign )
{
DBG_TRACE( "OutputDevice::SetTextAlign()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaTextAlignAction( eAlign ) );
if ( maFont.GetAlign() != eAlign )
{
maFont.SetAlign( eAlign );
mbNewFont = TRUE;
}
if( mpAlphaVDev )
mpAlphaVDev->SetTextAlign( eAlign );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void OutputDevice::DrawTextLine( const Point& rPos, long nWidth,
FontStrikeout eStrikeout,
2001-02-23 17:17:44 +00:00
FontUnderline eUnderline,
FontUnderline eOverline,
2001-02-23 17:17:44 +00:00
BOOL bUnderlineAbove )
2000-09-18 16:07:07 +00:00
{
DBG_TRACE( "OutputDevice::DrawTextLine()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaTextLineAction( rPos, nWidth, eStrikeout, eUnderline, eOverline ) );
2000-09-18 16:07:07 +00:00
if ( ((eUnderline == UNDERLINE_NONE) || (eUnderline == UNDERLINE_DONTKNOW)) &&
((eOverline == UNDERLINE_NONE) || (eOverline == UNDERLINE_DONTKNOW)) &&
2000-09-18 16:07:07 +00:00
((eStrikeout == STRIKEOUT_NONE) || (eStrikeout == STRIKEOUT_DONTKNOW)) )
return;
if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
2000-09-18 16:07:07 +00:00
return;
// we need a graphics
if( !mpGraphics && !ImplGetGraphics() )
return;
if( mbInitClipRegion )
2000-09-18 16:07:07 +00:00
ImplInitClipRegion();
if( mbOutputClipped )
2000-09-18 16:07:07 +00:00
return;
// initialize font if needed to get text offsets
// TODO: only needed for mnTextOff!=(0,0)
if( mbNewFont )
if( !ImplNewFont() )
return;
if( mbInitFont )
ImplInitFont();
2000-09-18 16:07:07 +00:00
Point aPos = ImplLogicToDevicePixel( rPos );
nWidth = ImplLogicWidthToDevicePixel( nWidth );
aPos += Point( mnTextOffX, mnTextOffY );
ImplDrawTextLine( aPos.X(), aPos.X(), 0, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
if( mpAlphaVDev )
mpAlphaVDev->DrawTextLine( rPos, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
2001-02-23 17:17:44 +00:00
}
// ------------------------------------------------------------------------
BOOL OutputDevice::IsTextUnderlineAbove( const Font& rFont )
{
return ImplIsUnderlineAbove( rFont );
2000-09-18 16:07:07 +00:00
}
// ------------------------------------------------------------------------
void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
USHORT nStyle )
{
DBG_TRACE( "OutputDevice::DrawWaveLine()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
2000-09-18 16:07:07 +00:00
return;
// we need a graphics
2002-04-23 06:40:42 +00:00
if( !mpGraphics )
if( !ImplGetGraphics() )
2000-09-18 16:07:07 +00:00
return;
if ( mbInitClipRegion )
ImplInitClipRegion();
if ( mbOutputClipped )
return;
if( mbNewFont )
if( !ImplNewFont() )
return;
2000-09-18 16:07:07 +00:00
Point aStartPt = ImplLogicToDevicePixel( rStartPos );
Point aEndPt = ImplLogicToDevicePixel( rEndPos );
long nStartX = aStartPt.X();
long nStartY = aStartPt.Y();
long nEndX = aEndPt.X();
long nEndY = aEndPt.Y();
short nOrientation = 0;
2002-04-23 06:40:42 +00:00
// when rotated
2000-09-18 16:07:07 +00:00
if ( (nStartY != nEndY) || (nStartX > nEndX) )
{
long nDX = nEndX - nStartX;
double nO = atan2( -nEndY + nStartY, ((nDX == 0L) ? 0.000000001 : nDX) );
nO /= F_PI1800;
nOrientation = (short)nO;
ImplRotatePos( nStartX, nStartY, nEndX, nEndY, -nOrientation );
}
long nWaveHeight;
if ( nStyle == WAVE_NORMAL )
{
nWaveHeight = 3;
nStartY++;
nEndY++;
}
else if( nStyle == WAVE_SMALL )
{
nWaveHeight = 2;
nStartY++;
nEndY++;
}
else // WAVE_FLAT
nWaveHeight = 1;
// #109280# make sure the waveline does not exceed the descent to avoid paint problems
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplFontEntry* pFontEntry = mpFontEntry;
if( nWaveHeight > pFontEntry->maMetric.mnWUnderlineSize )
nWaveHeight = pFontEntry->maMetric.mnWUnderlineSize;
ImplDrawWaveLine( nStartX, nStartY, 0, 0,
2000-09-18 16:07:07 +00:00
nEndX-nStartX, nWaveHeight, 1,
nOrientation, GetLineColor() );
if( mpAlphaVDev )
mpAlphaVDev->DrawWaveLine( rStartPos, rEndPos, nStyle );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void OutputDevice::DrawText( const Point& rStartPt, const String& rStr,
xub_StrLen nIndex, xub_StrLen nLen,
MetricVector* pVector, String* pDisplayText
)
2000-09-18 16:07:07 +00:00
{
if( mpOutDevData && mpOutDevData->mpRecordLayout )
{
pVector = &mpOutDevData->mpRecordLayout->m_aUnicodeBoundRects;
pDisplayText = &mpOutDevData->mpRecordLayout->m_aDisplayText;
}
2000-09-18 16:07:07 +00:00
DBG_TRACE( "OutputDevice::DrawText()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
#if OSL_DEBUG_LEVEL > 2
fprintf( stderr, " OutputDevice::DrawText(\"%s\")\n",
OUStringToOString( rStr, RTL_TEXTENCODING_UTF8 ).getStr() );
#endif
2000-09-18 16:07:07 +00:00
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaTextAction( rStartPt, rStr, nIndex, nLen ) );
if( pVector )
{
Region aClip( GetClipRegion() );
if( meOutDevType == OUTDEV_WINDOW )
aClip.Intersect( Rectangle( Point(), GetOutputSize() ) );
if( mpOutDevData && mpOutDevData->mpRecordLayout )
{
mpOutDevData->mpRecordLayout->m_aLineIndices.push_back( mpOutDevData->mpRecordLayout->m_aDisplayText.Len() );
aClip.Intersect( mpOutDevData->maRecordRect );
}
if( ! aClip.IsNull() )
{
MetricVector aTmp;
GetGlyphBoundRects( rStartPt, rStr, nIndex, nLen, nIndex, aTmp );
2000-09-18 16:07:07 +00:00
bool bInserted = false;
for( MetricVector::const_iterator it = aTmp.begin(); it != aTmp.end(); ++it, nIndex++ )
{
bool bAppend = false;
if( aClip.IsOver( *it ) )
bAppend = true;
else if( rStr.GetChar( nIndex ) == ' ' && bInserted )
{
MetricVector::const_iterator next = it;
++next;
if( next != aTmp.end() && aClip.IsOver( *next ) )
bAppend = true;
}
if( bAppend )
{
pVector->push_back( *it );
if( pDisplayText )
pDisplayText->Append( rStr.GetChar( nIndex ) );
bInserted = true;
}
}
}
else
{
GetGlyphBoundRects( rStartPt, rStr, nIndex, nLen, nIndex, *pVector );
if( pDisplayText )
pDisplayText->Append( rStr.Copy( nIndex, nLen ) );
}
}
if ( !IsDeviceOutputNecessary() || pVector )
2000-09-18 16:07:07 +00:00
return;
SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen, rStartPt, 0, NULL, true );
2002-04-23 06:40:42 +00:00
if( pSalLayout )
2000-09-18 16:07:07 +00:00
{
2002-04-23 06:40:42 +00:00
ImplDrawText( *pSalLayout );
pSalLayout->Release();
2000-09-18 16:07:07 +00:00
}
if( mpAlphaVDev )
mpAlphaVDev->DrawText( rStartPt, rStr, nIndex, nLen, pVector, pDisplayText );
2002-04-23 06:40:42 +00:00
}
2000-09-18 16:07:07 +00:00
2002-04-23 06:40:42 +00:00
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
long OutputDevice::GetTextWidth( const String& rStr,
2000-09-18 16:07:07 +00:00
xub_StrLen nIndex, xub_StrLen nLen ) const
{
DBG_TRACE( "OutputDevice::GetTextWidth()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
long nWidth = GetTextArray( rStr, NULL, nIndex, nLen );
2000-09-18 16:07:07 +00:00
return nWidth;
}
// -----------------------------------------------------------------------
long OutputDevice::GetTextHeight() const
{
DBG_TRACE( "OutputDevice::GetTextHeight()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
2002-04-23 06:40:42 +00:00
if( mbNewFont )
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( !ImplNewFont() )
2000-09-18 16:07:07 +00:00
return 0;
if( mbInitFont )
if( !ImplNewFont() )
return 0;
2000-09-18 16:07:07 +00:00
2002-04-23 06:40:42 +00:00
long nHeight = mpFontEntry->mnLineHeight + mnEmphasisAscent + mnEmphasisDescent;
2000-09-18 16:07:07 +00:00
if ( mbMap )
nHeight = ImplDevicePixelToLogicHeight( nHeight );
return nHeight;
}
// -----------------------------------------------------------------------
void OutputDevice::DrawTextArray( const Point& rStartPt, const String& rStr,
const sal_Int32* pDXAry,
2000-09-18 16:07:07 +00:00
xub_StrLen nIndex, xub_StrLen nLen )
{
DBG_TRACE( "OutputDevice::DrawTextArray()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaTextArrayAction( rStartPt, rStr, pDXAry, nIndex, nLen ) );
2000-09-18 16:07:07 +00:00
if ( !IsDeviceOutputNecessary() )
return;
if( !mpGraphics && !ImplGetGraphics() )
return;
if( mbInitClipRegion )
ImplInitClipRegion();
if( mbOutputClipped )
return;
2000-09-18 16:07:07 +00:00
SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen, rStartPt, 0, pDXAry, true );
2002-04-23 06:40:42 +00:00
if( pSalLayout )
2000-09-18 16:07:07 +00:00
{
2002-04-23 06:40:42 +00:00
ImplDrawText( *pSalLayout );
pSalLayout->Release();
2000-09-18 16:07:07 +00:00
}
if( mpAlphaVDev )
mpAlphaVDev->DrawTextArray( rStartPt, rStr, pDXAry, nIndex, nLen );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
long OutputDevice::GetTextArray( const String& rStr, sal_Int32* pDXAry,
2000-09-18 16:07:07 +00:00
xub_StrLen nIndex, xub_StrLen nLen ) const
{
DBG_TRACE( "OutputDevice::GetTextArray()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if( nIndex >= rStr.Len() )
2000-09-18 16:07:07 +00:00
return 0;
if( (ULONG)nIndex+nLen >= rStr.Len() )
nLen = rStr.Len() - nIndex;
2000-09-18 16:07:07 +00:00
2002-04-23 06:40:42 +00:00
// do layout
SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen );
2002-04-23 06:40:42 +00:00
if( !pSalLayout )
return 0;
2002-04-23 06:40:42 +00:00
long nWidth = pSalLayout->FillDXArray( pDXAry );
int nWidthFactor = pSalLayout->GetUnitsPerPixel();
2002-04-23 06:40:42 +00:00
pSalLayout->Release();
2000-09-18 16:07:07 +00:00
// convert virtual char widths to virtual absolute positions
if( pDXAry )
for( int i = 1; i < nLen; ++i )
pDXAry[ i ] += pDXAry[ i-1 ];
2002-04-23 06:40:42 +00:00
// convert from font units to logical units
if( mbMap )
2000-09-18 16:07:07 +00:00
{
2002-04-23 06:40:42 +00:00
if( pDXAry )
for( int i = 0; i < nLen; ++i )
pDXAry[i] = ImplDevicePixelToLogicWidth( pDXAry[i] );
nWidth = ImplDevicePixelToLogicWidth( nWidth );
2000-09-18 16:07:07 +00:00
}
if( nWidthFactor > 1 )
2000-09-18 16:07:07 +00:00
{
2002-04-23 06:40:42 +00:00
if( pDXAry )
for( int i = 0; i < nLen; ++i )
pDXAry[i] /= nWidthFactor;
nWidth /= nWidthFactor;
2000-09-18 16:07:07 +00:00
}
return nWidth;
}
// -----------------------------------------------------------------------
bool OutputDevice::GetCaretPositions( const XubString& rStr, sal_Int32* pCaretXArray,
xub_StrLen nIndex, xub_StrLen nLen,
sal_Int32* pDXAry, long nLayoutWidth,
BOOL bCellBreaking ) const
{
DBG_TRACE( "OutputDevice::GetCaretPositions()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if( nIndex >= rStr.Len() )
return false;
if( (ULONG)nIndex+nLen >= rStr.Len() )
nLen = rStr.Len() - nIndex;
// layout complex text
SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen,
Point(0,0), nLayoutWidth, pDXAry );
if( !pSalLayout )
return false;
int nWidthFactor = pSalLayout->GetUnitsPerPixel();
pSalLayout->GetCaretPositions( 2*nLen, pCaretXArray );
2002-09-25 16:13:57 +00:00
long nWidth = pSalLayout->GetTextWidth();
pSalLayout->Release();
// fixup unknown caret positions
int i;
for( i = 0; i < 2 * nLen; ++i )
if( pCaretXArray[ i ] >= 0 )
break;
long nXPos = pCaretXArray[ i ];
for( i = 0; i < 2 * nLen; ++i )
{
if( pCaretXArray[ i ] >= 0 )
nXPos = pCaretXArray[ i ];
else
pCaretXArray[ i ] = nXPos;
}
// handle window mirroring
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
if( IsRTLEnabled() )
2002-09-25 16:13:57 +00:00
{
for( i = 0; i < 2 * nLen; ++i )
2002-09-25 16:13:57 +00:00
pCaretXArray[i] = nWidth - pCaretXArray[i] - 1;
}
// convert from font units to logical units
if( mbMap )
{
for( i = 0; i < 2*nLen; ++i )
pCaretXArray[i] = ImplDevicePixelToLogicWidth( pCaretXArray[i] );
}
if( nWidthFactor != 1 )
{
for( i = 0; i < 2*nLen; ++i )
pCaretXArray[i] /= nWidthFactor;
}
// if requested move caret position to cell limits
if( bCellBreaking )
{
; // TODO
}
return true;
}
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
void OutputDevice::DrawStretchText( const Point& rStartPt, ULONG nWidth,
const String& rStr,
2000-09-18 16:07:07 +00:00
xub_StrLen nIndex, xub_StrLen nLen )
{
DBG_TRACE( "OutputDevice::DrawStretchText()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( mpMetaFile )
mpMetaFile->AddAction( new MetaStretchTextAction( rStartPt, nWidth, rStr, nIndex, nLen ) );
2000-09-18 16:07:07 +00:00
if ( !IsDeviceOutputNecessary() )
return;
SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen, rStartPt, nWidth, NULL, true );
2002-04-23 06:40:42 +00:00
if( pSalLayout )
2000-09-18 16:07:07 +00:00
{
2002-04-23 06:40:42 +00:00
ImplDrawText( *pSalLayout );
pSalLayout->Release();
2000-09-18 16:07:07 +00:00
}
if( mpAlphaVDev )
mpAlphaVDev->DrawStretchText( rStartPt, nWidth, rStr, nIndex, nLen );
2002-04-23 06:40:42 +00:00
}
2000-09-18 16:07:07 +00:00
2002-04-23 06:40:42 +00:00
// -----------------------------------------------------------------------
ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( String& rStr,
xub_StrLen nMinIndex, xub_StrLen nLen,
long nPixelWidth, const sal_Int32* pDXArray ) const
2002-04-23 06:40:42 +00:00
{
// get string length for calculating extents
xub_StrLen nEndIndex = rStr.Len();
if( (ULONG)nMinIndex + nLen < nEndIndex )
nEndIndex = nMinIndex + nLen;
2002-04-23 06:40:42 +00:00
// don't bother if there is nothing to do
if( nEndIndex < nMinIndex )
nEndIndex = nMinIndex;
2000-09-18 16:07:07 +00:00
2002-04-23 06:40:42 +00:00
int nLayoutFlags = 0;
if( mnTextLayoutMode & TEXT_LAYOUT_BIDI_RTL )
2002-04-23 06:40:42 +00:00
nLayoutFlags |= SAL_LAYOUT_BIDI_RTL;
if( mnTextLayoutMode & TEXT_LAYOUT_BIDI_STRONG )
2002-04-23 06:40:42 +00:00
nLayoutFlags |= SAL_LAYOUT_BIDI_STRONG;
else if( 0 == (mnTextLayoutMode & TEXT_LAYOUT_BIDI_RTL) )
{
// disable Bidi if no RTL hint and no RTL codes used
const xub_Unicode* pStr = rStr.GetBuffer() + nMinIndex;
const xub_Unicode* pEnd = rStr.GetBuffer() + nEndIndex;
for( ; pStr < pEnd; ++pStr )
if( ((*pStr >= 0x0580) && (*pStr < 0x0800)) // middle eastern scripts
|| ((*pStr >= 0xFB18) && (*pStr < 0xFE00)) // hebrew + arabic A presentation forms
|| ((*pStr >= 0xFE70) && (*pStr < 0xFEFF)) ) // arabic presentation forms B
break;
if( pStr >= pEnd )
nLayoutFlags |= SAL_LAYOUT_BIDI_STRONG;
}
2002-04-23 06:40:42 +00:00
if( mbKerning )
nLayoutFlags |= SAL_LAYOUT_KERNING_PAIRS;
if( maFont.GetKerning() & KERNING_ASIAN )
nLayoutFlags |= SAL_LAYOUT_KERNING_ASIAN;
if( maFont.IsVertical() )
nLayoutFlags |= SAL_LAYOUT_VERTICAL;
if( mnTextLayoutMode & TEXT_LAYOUT_ENABLE_LIGATURES )
nLayoutFlags |= SAL_LAYOUT_ENABLE_LIGATURES;
else if( mnTextLayoutMode & TEXT_LAYOUT_COMPLEX_DISABLED )
nLayoutFlags |= SAL_LAYOUT_COMPLEX_DISABLED;
else
{
// disable CTL for non-CTL text
const sal_Unicode* pStr = rStr.GetBuffer() + nMinIndex;
const sal_Unicode* pEnd = rStr.GetBuffer() + nEndIndex;
for( ; pStr < pEnd; ++pStr )
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( ((*pStr >= 0x0300) && (*pStr < 0x0370)) // diacritical marks
|| ((*pStr >= 0x0590) && (*pStr < 0x10A0)) // many CTL scripts
|| ((*pStr >= 0x1100) && (*pStr < 0x1200)) // hangul jamo
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
|| ((*pStr >= 0x1700) && (*pStr < 0x1900)) // many CTL scripts
|| ((*pStr >= 0xFB1D) && (*pStr < 0xFE00)) // middle east presentation
|| ((*pStr >= 0xFE70) && (*pStr < 0xFEFF)) ) // arabic presentation B
break;
if( pStr >= pEnd )
nLayoutFlags |= SAL_LAYOUT_COMPLEX_DISABLED;
}
if( meTextLanguage ) //TODO: (mnTextLayoutMode & TEXT_LAYOUT_SUBSTITUTE_DIGITS)
{
// disable character localization when no digits used
const sal_Unicode* pBase = rStr.GetBuffer();
const sal_Unicode* pStr = pBase + nMinIndex;
const sal_Unicode* pEnd = pBase + nEndIndex;
for( ; pStr < pEnd; ++pStr )
{
// TODO: are there non-digit localizations?
if( (*pStr >= '0') && (*pStr <= '9') )
{
// translate characters to local preference
sal_UCS4 cChar = GetLocalizedChar( *pStr, meTextLanguage );
if( cChar != *pStr )
// TODO: are the localized digit surrogates?
rStr.SetChar( static_cast<USHORT>(pStr - pBase),
static_cast<sal_Unicode>(cChar) );
}
}
}
// right align for RTL text, DRAWPOS_REVERSED, RTL window style
bool bRightAlign = ((mnTextLayoutMode & TEXT_LAYOUT_BIDI_RTL) != 0);
if( mnTextLayoutMode & TEXT_LAYOUT_TEXTORIGIN_LEFT )
bRightAlign = false;
else if ( mnTextLayoutMode & TEXT_LAYOUT_TEXTORIGIN_RIGHT )
bRightAlign = true;
// SSA: hack for western office, ie text get right aligned
// for debugging purposes of mirrored UI
//static const char* pEnv = getenv( "SAL_RTL_MIRRORTEXT" );
CWS-TOOLING: integrate CWS rtlcontrols 2008-12-11 21:08:49 +0100 fs r265367 : CONTEXT_WRITING_MODE is transient 2008-12-11 21:08:00 +0100 fs r265365 : REGISTER_PROP_3 2008-12-11 20:53:44 +0100 fs r265362 : ContextWritingMode is not MAYBEVOID 2008-12-11 15:29:08 +0100 fs r265315 : prevent a deadlock during complex.dbaccess.DatabaseDocument test 2008-12-11 15:01:13 +0100 fs r265304 : manual RESYNC to m37 2008-12-10 20:04:38 +0100 pl r265230 : #i30631# fix a snafu in mirroring 2008-12-10 19:14:45 +0100 pl r265229 : #i30631# rework PaintToDevice for RTL controls 2008-12-05 10:19:13 +0100 fs r264893 : #i10000# ImplInitSettings => ImplInitWindow (ImplInitSettings clashed with base classes ImplInitSettings on unxsols4) 2008-12-03 12:55:24 +0100 fs r264768 : #i100000# 2008-12-03 07:11:48 +0100 fs r264741 : #i10000# 2008-12-02 10:37:51 +0100 fs r264670 : CWS-TOOLING: rebase CWS rtlcontrols to trunk@264325 (milestone: DEV300:m36) 2008-12-02 09:27:50 +0100 fs r264660 : merge from trunk 2008-11-25 10:28:36 +0100 ama r264277 : Fix #i94572# 2008-11-24 11:46:48 +0100 fs r264218 : #i30631# proper context writing mode 2008-11-24 09:38:04 +0100 fs r264204 : #i30631# (approved by PL) 2008-11-24 09:35:47 +0100 fs r264203 : #i30631# Context/WritingMode 2008-11-24 09:33:36 +0100 fs r264202 : #i30631# Context/WritingMode 2008-11-24 09:31:53 +0100 fs r264200 : #i30631# RTL 2008-11-19 08:51:48 +0100 fs r263963 : #i10000# 2008-11-18 20:58:11 +0100 fs r263878 : #i10000# 2008-11-18 15:30:44 +0100 fs r263778 : migrate the CWS from CVS to SVN the CVS changes contained in this change set are the ones between the following two CVS tags: CWS_DEV300_RTLCONTROLS_ANCHOR CWS_DEV300_RTLCONTROLS_PRE_MIGRATION 2008-11-18 12:29:04 +0100 ama r263762 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:25:50 +0100 ama r263761 : Fix #i94572#: Context direction for drawing objects 2008-11-18 12:02:30 +0100 ama r263759 : Fix #i94572#: Context direction for drawing objects
2008-12-16 13:30:53 +00:00
bool bRTLWindow = IsRTLEnabled();
bRightAlign ^= bRTLWindow;
if( bRightAlign )
nLayoutFlags |= SAL_LAYOUT_RIGHT_ALIGN;
2000-09-18 16:07:07 +00:00
// set layout options
ImplLayoutArgs aLayoutArgs( rStr.GetBuffer(), rStr.Len(), nMinIndex, nEndIndex, nLayoutFlags );
2000-09-18 16:07:07 +00:00
2002-04-23 06:40:42 +00:00
int nOrientation = mpFontEntry ? mpFontEntry->mnOrientation : 0;
aLayoutArgs.SetOrientation( nOrientation );
2000-09-18 16:07:07 +00:00
aLayoutArgs.SetLayoutWidth( nPixelWidth );
aLayoutArgs.SetDXArray( pDXArray );
return aLayoutArgs;
}
// -----------------------------------------------------------------------
SalLayout* OutputDevice::ImplLayout( const String& rOrigStr,
xub_StrLen nMinIndex,
xub_StrLen nLen,
const Point& rLogicalPos,
long nLogicalWidth,
const sal_Int32* pDXArray,
bool bFilter ) const
{
// we need a graphics
if( !mpGraphics )
if( !ImplGetGraphics() )
return NULL;
// initialize font if needed
if( mbNewFont )
if( !ImplNewFont() )
return NULL;
if( mbInitFont )
ImplInitFont();
// check string index and length
if( (unsigned)nMinIndex + nLen > rOrigStr.Len() )
{
const int nNewLen = (int)rOrigStr.Len() - nMinIndex;
if( nNewLen <= 0 )
return NULL;
nLen = static_cast<xub_StrLen>(nNewLen);
}
String aStr = rOrigStr;
// filter out special markers
if( bFilter )
2000-09-18 16:07:07 +00:00
{
xub_StrLen nCutStart, nCutStop, nOrgLen = nLen;
bool bFiltered = mpGraphics->filterText( rOrigStr, aStr, nMinIndex, nLen, nCutStart, nCutStop );
if( !nLen )
return NULL;
if( bFiltered && nCutStop != nCutStart && pDXArray )
{
if( !nLen )
pDXArray = NULL;
else
{
sal_Int32* pAry = (sal_Int32*)alloca(sizeof(sal_Int32)*nLen);
if( nCutStart > nMinIndex )
memcpy( pAry, pDXArray, sizeof(sal_Int32)*(nCutStart-nMinIndex) );
CWS-TOOLING: integrate CWS vcl98 2009-01-16 15:17:38 +0100 pl r266422 : #i93515# add fix for compiz (thanks cmc) 2009-01-15 10:55:36 +0100 thb r266352 : #i97399# start==end angle means no arc at all 2009-01-14 18:54:37 +0100 pl r266327 : #i96536# #i96396# add: pagescroll for wheel events (thanks mod) 2009-01-14 18:21:06 +0100 pl r266325 : #i96536# #i96396# add: gestures, bracket matching (thanks mod) 2009-01-13 12:03:29 +0100 hdu r266206 : #i98024# preserve glyph zero-advance for artificial bold and vertical layout (thanks CMC!) 2009-01-12 16:32:20 +0100 hdu r266167 : #i97991# fix rotated text: temporary workaround for #i87686# 2009-01-08 17:16:17 +0100 hdu r266028 : #159054# ignore empty ATSULayout 2009-01-08 16:59:05 +0100 hdu r266026 : #159054# prevent invalid ATSUStyle 2009-01-07 19:04:06 +0100 pl r265976 : #158288# add extraction of fonts and individual object streams to pdfunzip 2009-01-07 14:42:17 +0100 pl r265969 : #i93011# workaround our ancient accelerator mechanisms to have deeper child window hirearchies working 2009-01-07 14:39:15 +0100 pl r265967 : #i93011# workaround our ancient accelerator mechanisms to have deeper child window hirearchies working 2009-01-07 11:10:58 +0100 hdu r265956 : #i97522# getPixel() returns COL_BLACK on printers or when out of bounds 2009-01-06 18:41:48 +0100 pl r265938 : #i97696# do not force user password to owner password after all 2009-01-06 18:00:52 +0100 pl r265934 : #i97157# fix a snafu 2009-01-06 13:23:38 +0100 pl r265914 : #i93515# support for _NET_WM_USER_TIME (thanks cmc) 2009-01-06 12:50:37 +0100 hdu r265912 : #i97538# get rid of compiler warnings for complex logical expressions 2009-01-06 12:49:09 +0100 hdu r265911 : #i97538# get rid of compiler warnings for complex logical expressions 2009-01-06 12:14:07 +0100 hdu r265906 : #i97522# implemented AquaSalGraphics::getPixel() 2008-12-18 16:46:59 +0100 pl r265706 : #i96343# reset quick job flag 2008-12-18 16:44:22 +0100 pl r265705 : #i96343# reset quick job flag 2008-12-18 14:08:22 +0100 pl r265688 : #i93241# fix bit field query 2008-12-18 12:41:52 +0100 pl r265682 : #i93241# eliminate useless static locale variable 2008-12-17 19:23:07 +0100 pl r265654 : #i97064# set language to OOo user configured UI language (thanks cmc) 2008-12-17 17:44:38 +0100 hdu r265651 : #i97326# debug-helper: print cairo version 2008-12-17 17:43:15 +0100 hdu r265650 : #i97326# ignore cairo changing the transformation of our FT_FACE 2008-12-17 14:44:32 +0100 pl r265604 : #i93631# refine control positioning 2008-12-17 12:40:39 +0100 hdu r265596 : #i97167# update VCL.xcu for MacOSX for Japanese (thanks maho!) 2008-12-17 11:59:51 +0100 hdu r265592 : #i97317# code movement to prevent needless and expensive construction/destruction in error path 2008-12-17 11:54:43 +0100 hdu r265590 : #i97317# workaround QUARTZ bug with drawing small polygons 2008-12-16 17:57:02 +0100 pl r265567 : #i97138# select num copies when grabbing focus 2008-12-16 17:15:11 +0100 pl r265561 : #i93173# lazy deletion of toolbars 2008-12-16 16:33:51 +0100 pl r265558 : #i93173# lazy deletion of toolbars: reparent floating DockingWindows in doLazyDelete 2008-12-16 13:23:17 +0100 pl r265536 : #i97196# ensure style engine has been loaded (thanks cmc)
2009-02-11 10:53:35 +00:00
// note: nCutStart will never be smaller than nMinIndex
memcpy( pAry+nCutStart-nMinIndex,
pDXArray + nOrgLen - (nCutStop-nMinIndex),
sizeof(sal_Int32)*(nLen - (nCutStart-nMinIndex)) );
pDXArray = pAry;
}
}
2000-09-18 16:07:07 +00:00
}
// convert from logical units to physical units
// recode string if needed
if( mpFontEntry->mpConversion )
mpFontEntry->mpConversion->RecodeString( aStr, 0, aStr.Len() );
long nPixelWidth = nLogicalWidth;
if( nLogicalWidth && mbMap )
nPixelWidth = ImplLogicWidthToDevicePixel( nLogicalWidth );
if( pDXArray && mbMap )
2002-04-23 06:40:42 +00:00
{
// convert from logical units to font units using a temporary array
sal_Int32* pTempDXAry = (sal_Int32*)alloca( nLen * sizeof(sal_Int32) );
// using base position for better rounding a.k.a. "dancing characters"
int nPixelXOfs = ImplLogicWidthToDevicePixel( rLogicalPos.X() );
for( int i = 0; i < nLen; ++i )
pTempDXAry[i] = ImplLogicWidthToDevicePixel( rLogicalPos.X() + pDXArray[i] ) - nPixelXOfs;
pDXArray = pTempDXAry;
2000-09-18 16:07:07 +00:00
}
ImplLayoutArgs aLayoutArgs = ImplPrepareLayoutArgs( aStr, nMinIndex, nLen, nPixelWidth, pDXArray );
2000-09-18 16:07:07 +00:00
// get matching layout object for base font
SalLayout* pSalLayout = NULL;
2002-07-20 14:54:30 +00:00
if( mpPDFWriter )
pSalLayout = mpPDFWriter->GetTextLayout( aLayoutArgs, &mpFontEntry->maFontSelData );
2002-07-20 14:54:30 +00:00
if( !pSalLayout )
pSalLayout = mpGraphics->GetTextLayout( aLayoutArgs, 0 );
// layout text
if( pSalLayout && !pSalLayout->LayoutText( aLayoutArgs ) )
{
pSalLayout->Release();
pSalLayout = NULL;
}
if( !pSalLayout )
return NULL;
// do glyph fallback if needed
// #105768# avoid fallback for very small font sizes
2005-02-23 17:27:30 +00:00
if( aLayoutArgs.NeedFallback() )
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
if( mpFontEntry && (mpFontEntry->maFontSelData.mnHeight >= 3) )
pSalLayout = ImplGlyphFallbackLayout( pSalLayout, aLayoutArgs );
// position, justify, etc. the layout
pSalLayout->AdjustLayout( aLayoutArgs );
pSalLayout->DrawBase() = ImplLogicToDevicePixel( rLogicalPos );
// adjust to right alignment if necessary
if( aLayoutArgs.mnFlags & SAL_LAYOUT_RIGHT_ALIGN )
{
long nRTLOffset;
if( pDXArray )
nRTLOffset = pDXArray[ nLen - 1 ];
else if( nPixelWidth )
nRTLOffset = nPixelWidth;
else
nRTLOffset = pSalLayout->GetTextWidth() / pSalLayout->GetUnitsPerPixel();
pSalLayout->DrawOffset().X() = 1 - nRTLOffset;
}
return pSalLayout;
}
// -----------------------------------------------------------------------
SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLayoutArgs& rLayoutArgs ) const
{
2005-02-23 17:27:30 +00:00
// prepare multi level glyph fallback
MultiSalLayout* pMultiSalLayout = NULL;
ImplLayoutRuns aLayoutRuns = rLayoutArgs.maRuns;
rLayoutArgs.PrepareFallback();
rLayoutArgs.mnFlags |= SAL_LAYOUT_FOR_FALLBACK;
#if defined(HDU_DEBUG)
{
int nCharPos = -1;
bool bRTL = false;
fprintf(stderr,"OD:ImplLayout Glyph Fallback for");
for( int i=0; i<8 && rLayoutArgs.GetNextPos( &nCharPos, &bRTL); ++i )
fprintf(stderr," U+%04X", rLayoutArgs.mpStr[ nCharPos ] );
fprintf(stderr,"\n");
rLayoutArgs.ResetPos();
}
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
#endif
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
// get list of unicodes that need glyph fallback
int nCharPos = -1;
bool bRTL = false;
rtl::OUStringBuffer aMissingCodeBuf;
while( rLayoutArgs.GetNextPos( &nCharPos, &bRTL) )
aMissingCodeBuf.append( rLayoutArgs.mpStr[ nCharPos ] );
rLayoutArgs.ResetPos();
rtl::OUString aMissingCodes = aMissingCodeBuf.makeStringAndClear();
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplFontSelectData aFontSelData = mpFontEntry->maFontSelData;
ImplFontMetricData aOrigMetric( aFontSelData );
// TODO: use cached metric in fontentry
mpGraphics->GetFontMetric( &aOrigMetric );
// when device specific font substitution may have been performed for
// the originally selected font then make sure that a fallback to that
// font is performed first
int nDevSpecificFallback = 0;
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
if( mpOutDevData && !mpOutDevData->maDevFontSubst.Empty() )
nDevSpecificFallback = 1;
// try if fallback fonts support the missing unicodes
for( int nFallbackLevel = 1; nFallbackLevel < MAX_FALLBACK; ++nFallbackLevel )
{
// find a font family suited for glyph fallback
#ifndef FONTFALLBACK_HOOKS_DISABLED
// GetGlyphFallbackFont() needs a valid aFontSelData.mpFontEntry
// if the system-specific glyph fallback is active
aFontSelData.mpFontEntry = mpFontEntry; // reset the fontentry to base-level
#endif
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
ImplFontEntry* pFallbackFont = mpFontCache->GetGlyphFallbackFont( mpFontList,
aFontSelData, nFallbackLevel-nDevSpecificFallback, aMissingCodes );
if( !pFallbackFont )
break;
aFontSelData.mpFontEntry = pFallbackFont;
aFontSelData.mpFontData = pFallbackFont->maFontSelData.mpFontData;
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
if( mpFontEntry && nFallbackLevel < MAX_FALLBACK-1)
{
2005-02-23 17:27:30 +00:00
// ignore fallback font if it is the same as the original font
if( mpFontEntry->maFontSelData.mpFontData == aFontSelData.mpFontData )
{
mpFontCache->Release( pFallbackFont );
continue;
}
}
#if defined(HDU_DEBUG)
{
ByteString aOrigFontName( maFont.GetName(), RTL_TEXTENCODING_UTF8);
ByteString aFallbackName( aFontSelData.mpFontData->GetFamilyName(),
RTL_TEXTENCODING_UTF8);
fprintf(stderr,"\tGlyphFallback[lvl=%d] \"%s\" -> \"%s\" (q=%d)\n",
nFallbackLevel, aOrigFontName.GetBuffer(), aFallbackName.GetBuffer(),
aFontSelData.mpFontData->GetQuality());
}
#endif
// TODO: try to get the metric data from the GFB's mpFontEntry
ImplFontMetricData aSubstituteMetric( aFontSelData );
pFallbackFont->mnSetFontFlags = mpGraphics->SetFont( &aFontSelData, nFallbackLevel );
mpGraphics->GetFontMetric( &aSubstituteMetric, nFallbackLevel );
const long nOriginalHeight = aOrigMetric.mnAscent + aOrigMetric.mnDescent;
const long nSubstituteHeight = aSubstituteMetric.mnAscent + aSubstituteMetric.mnDescent;
// Too tall, shrink it a bit. Need a better calculation to include extra
// factors and any extra wriggle room we might have available?
// TODO: should we scale by max-ascent/max-descent instead of design height?
if( nSubstituteHeight > nOriginalHeight )
{
const float fScale = nOriginalHeight / (float)nSubstituteHeight;
const float fOrigHeight = aFontSelData.mfExactHeight;
const int nOrigHeight = aFontSelData.mnHeight;
aFontSelData.mfExactHeight *= fScale;
aFontSelData.mnHeight = static_cast<int>(aFontSelData.mfExactHeight);
pFallbackFont->mnSetFontFlags = mpGraphics->SetFont( &aFontSelData, nFallbackLevel );
aFontSelData.mnHeight = nOrigHeight;
aFontSelData.mfExactHeight = fOrigHeight;
}
// create and add glyph fallback layout to multilayout
rLayoutArgs.ResetPos();
SalLayout* pFallback = mpGraphics->GetTextLayout( rLayoutArgs, nFallbackLevel );
if( pFallback )
{
if( pFallback->LayoutText( rLayoutArgs ) )
{
if( !pMultiSalLayout )
pMultiSalLayout = new MultiSalLayout( *pSalLayout );
pMultiSalLayout->AddFallback( *pFallback,
rLayoutArgs.maRuns, aFontSelData.mpFontData );
INTEGRATION: CWS gfbfcfg (1.230.42); FILE MERGED 2007/11/27 13:20:22 hdu 1.230.42.12: RESYNC: (1.230-1.233); FILE MERGED 2007/11/21 16:02:59 hdu 1.230.42.11: #i83491# fix generic glyph fallback font calculation 2007/11/20 11:43:06 hdu 1.230.42.10: #i83491# fix crash on optimized unxsols4.pro builds, use string reference to avoid needless refcounting 2007/11/14 10:09:56 hdu 1.230.42.9: #i83491# move inline methods to allow warning free compile 2007/11/13 14:48:01 hdu 1.230.42.8: #i83491# normalize fontname to increase font cache hit rate 2007/11/12 10:32:11 hdu 1.230.42.7: #i83491# improve performance of glyph fallback hook by caching results 2007/09/17 14:03:35 hdu 1.230.42.6: #i54603# adjust to recent psprint API changes 2007/09/13 17:17:50 hdu 1.230.42.5: #i54603# fix modified glyph fallback 2007/09/12 17:40:05 hdu 1.230.42.4: #i54603# fix typo in OutputDevice::GetFontSubstituteCount() 2007/09/12 15:23:57 hdu 1.230.42.3: #i54603# add hooks for non-generic font substitutions 2007/09/07 15:02:23 hdu 1.230.42.2: Start to abstract font fallbacks to cleanup the previous patch The patch HAD to be applied though it was not close to ready, sorry When finished font fallback abstraction will solve these regressions - does not even compile on non-UNX platforms - introduces UNX-specific dependencies into platform-independent layers - kills the glyph- and font-fallback features on the non-UNX platforms - kills the features on UNX platforms that don't have up to date fontconfig lib or matching configuration entries - causes regressions for non-baseplane unicodes - kills the japanese EUDC feature 2007/09/05 09:58:33 hdu 1.230.42.1: #i54603# apply Caolan's fontconfig based glyph fallback patch
2007-12-12 12:20:52 +00:00
if (nFallbackLevel == MAX_FALLBACK-1)
pMultiSalLayout->SetInComplete();
}
else
{
// there is no need for a font that couldn't resolve anything
pFallback->Release();
}
}
mpFontCache->Release( pFallbackFont );
// break when this fallback was sufficient
if( !rLayoutArgs.PrepareFallback() )
break;
}
2000-09-18 16:07:07 +00:00
2005-02-23 17:27:30 +00:00
if( pMultiSalLayout && pMultiSalLayout->LayoutText( rLayoutArgs ) )
pSalLayout = pMultiSalLayout;
// restore orig font settings
pSalLayout->InitFont();
rLayoutArgs.maRuns = aLayoutRuns;
2002-04-23 06:40:42 +00:00
return pSalLayout;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
BOOL OutputDevice::GetTextIsRTL(
const String& rString,
xub_StrLen nIndex, xub_StrLen nLen ) const
{
String aStr( rString );
ImplLayoutArgs aArgs = ImplPrepareLayoutArgs( aStr, nIndex, nLen, 0, NULL );
bool bRTL = false;
int nCharPos = -1;
aArgs.GetNextPos( &nCharPos, &bRTL );
return (nCharPos != nIndex) ? TRUE : FALSE;
}
// -----------------------------------------------------------------------
xub_StrLen OutputDevice::GetTextBreak( const String& rStr, long nTextWidth,
2000-09-18 16:07:07 +00:00
xub_StrLen nIndex, xub_StrLen nLen,
long nCharExtra, BOOL /*TODO: bCellBreaking*/ ) const
2000-09-18 16:07:07 +00:00
{
DBG_TRACE( "OutputDevice::GetTextBreak()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen );
2002-04-23 06:40:42 +00:00
xub_StrLen nRetVal = STRING_LEN;
if( pSalLayout )
2000-09-18 16:07:07 +00:00
{
// convert logical widths into layout units
// NOTE: be very careful to avoid rounding errors for nCharExtra case
// problem with rounding errors especially for small nCharExtras
// TODO: remove when layout units have subpixel granularity
long nWidthFactor = pSalLayout->GetUnitsPerPixel();
long nSubPixelFactor = (nWidthFactor < 64 ) ? 64 : 1;
nTextWidth *= nWidthFactor * nSubPixelFactor;
long nTextPixelWidth = ImplLogicWidthToDevicePixel( nTextWidth );
long nExtraPixelWidth = 0;
2002-04-23 06:40:42 +00:00
if( nCharExtra != 0 )
{
nCharExtra *= nWidthFactor * nSubPixelFactor;
nExtraPixelWidth = ImplLogicWidthToDevicePixel( nCharExtra );
2002-04-23 06:40:42 +00:00
}
nRetVal = sal::static_int_cast<xub_StrLen>(pSalLayout->GetTextBreak( nTextPixelWidth, nExtraPixelWidth, nSubPixelFactor ));
2002-04-23 06:40:42 +00:00
pSalLayout->Release();
2000-09-18 16:07:07 +00:00
}
2002-04-23 06:40:42 +00:00
return nRetVal;
}
2000-09-18 16:07:07 +00:00
2002-04-23 06:40:42 +00:00
// -----------------------------------------------------------------------
2001-05-29 08:25:18 +00:00
xub_StrLen OutputDevice::GetTextBreak( const String& rStr, long nTextWidth,
sal_Unicode nHyphenatorChar, xub_StrLen& rHyphenatorPos,
2002-04-23 06:40:42 +00:00
xub_StrLen nIndex, xub_StrLen nLen,
long nCharExtra ) const
{
DBG_TRACE( "OutputDevice::GetTextBreak()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
2000-09-18 16:07:07 +00:00
rHyphenatorPos = STRING_LEN;
SalLayout* pSalLayout = ImplLayout( rStr, nIndex, nLen );
if( !pSalLayout )
return STRING_LEN;
// convert logical widths into layout units
// NOTE: be very careful to avoid rounding errors for nCharExtra case
// problem with rounding errors especially for small nCharExtras
// TODO: remove when layout units have subpixel granularity
long nWidthFactor = pSalLayout->GetUnitsPerPixel();
long nSubPixelFactor = (nWidthFactor < 64 ) ? 64 : 1;
nTextWidth *= nWidthFactor * nSubPixelFactor;
long nTextPixelWidth = ImplLogicWidthToDevicePixel( nTextWidth );
long nExtraPixelWidth = 0;
if( nCharExtra != 0 )
{
nCharExtra *= nWidthFactor * nSubPixelFactor;
nExtraPixelWidth = ImplLogicWidthToDevicePixel( nCharExtra );
}
// calculate un-hyphenated break position
xub_StrLen nRetVal = sal::static_int_cast<xub_StrLen>(pSalLayout->GetTextBreak( nTextPixelWidth, nExtraPixelWidth, nSubPixelFactor ));
// calculate hyphenated break position
String aHyphenatorStr( &nHyphenatorChar, 1 );
xub_StrLen nTempLen = 1;
SalLayout* pHyphenatorLayout = ImplLayout( aHyphenatorStr, 0, nTempLen );
if( pHyphenatorLayout )
2000-09-18 16:07:07 +00:00
{
// calculate subpixel width of hyphenation character
long nHyphenatorPixelWidth = pHyphenatorLayout->GetTextWidth() * nSubPixelFactor;
pHyphenatorLayout->Release();
2000-09-18 16:07:07 +00:00
// calculate hyphenated break position
nTextPixelWidth -= nHyphenatorPixelWidth;
if( nExtraPixelWidth > 0 )
nTextPixelWidth -= nExtraPixelWidth;
rHyphenatorPos = sal::static_int_cast<xub_StrLen>(pSalLayout->GetTextBreak( nTextPixelWidth, nExtraPixelWidth, nSubPixelFactor ));
2000-09-18 16:07:07 +00:00
if( rHyphenatorPos > nRetVal )
rHyphenatorPos = nRetVal;
}
2002-04-23 06:40:42 +00:00
pSalLayout->Release();
2002-04-23 06:40:42 +00:00
return nRetVal;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& rRect,
const String& rOrigStr, USHORT nStyle,
MetricVector* pVector, String* pDisplayText,
::vcl::ITextLayout& _rLayout )
2000-09-18 16:07:07 +00:00
{
Color aOldTextColor;
Color aOldTextFillColor;
BOOL bRestoreFillColor = false;
if ( (nStyle & TEXT_DRAW_DISABLE) && ! pVector )
2000-09-18 16:07:07 +00:00
{
BOOL bHighContrastBlack = FALSE;
BOOL bHighContrastWhite = FALSE;
const StyleSettings& rStyleSettings( rTargetDevice.GetSettings().GetStyleSettings() );
if( rStyleSettings.GetHighContrastMode() )
{
Color aCol;
if( rTargetDevice.IsBackground() )
aCol = rTargetDevice.GetBackground().GetColor();
else
// best guess is the face color here
// but it may be totally wrong. the background color
// was typically already reset
aCol = rStyleSettings.GetFaceColor();
bHighContrastBlack = aCol.IsDark();
bHighContrastWhite = aCol.IsBright();
}
aOldTextColor = rTargetDevice.GetTextColor();
if ( rTargetDevice.IsTextFillColor() )
2000-09-18 16:07:07 +00:00
{
bRestoreFillColor = TRUE;
aOldTextFillColor = rTargetDevice.GetTextFillColor();
2000-09-18 16:07:07 +00:00
}
if( bHighContrastBlack )
rTargetDevice.SetTextColor( COL_GREEN );
else if( bHighContrastWhite )
rTargetDevice.SetTextColor( COL_LIGHTGREEN );
else
{
// draw disabled text always without shadow
// as it fits better with native look
/*
SetTextColor( GetSettings().GetStyleSettings().GetLightColor() );
Rectangle aRect = rRect;
aRect.Move( 1, 1 );
DrawText( aRect, rOrigStr, nStyle & ~TEXT_DRAW_DISABLE );
*/
rTargetDevice.SetTextColor( rTargetDevice.GetSettings().GetStyleSettings().GetDisableColor() );
}
2000-09-18 16:07:07 +00:00
}
long nWidth = rRect.GetWidth();
long nHeight = rRect.GetHeight();
if ( ((nWidth <= 0) || (nHeight <= 0)) && (nStyle & TEXT_DRAW_CLIP) )
return;
Point aPos = rRect.TopLeft();
2002-04-23 06:40:42 +00:00
long nTextHeight = rTargetDevice.GetTextHeight();
TextAlign eAlign = rTargetDevice.GetTextAlign();
2000-09-18 16:07:07 +00:00
xub_StrLen nMnemonicPos = STRING_NOTFOUND;
String aStr = rOrigStr;
2000-09-18 16:07:07 +00:00
if ( nStyle & TEXT_DRAW_MNEMONIC )
aStr = GetNonMnemonicString( aStr, nMnemonicPos );
const bool bDrawMnemonics = !(rTargetDevice.GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_NOMNEMONICS) && !pVector;
2000-09-18 16:07:07 +00:00
// Mehrzeiligen Text behandeln wir anders
if ( nStyle & TEXT_DRAW_MULTILINE )
{
2002-04-23 06:40:42 +00:00
2000-09-18 16:07:07 +00:00
XubString aLastLine;
ImplMultiTextLineInfo aMultiLineInfo;
ImplTextLineInfo* pLineInfo;
long nMaxTextWidth;
xub_StrLen i;
xub_StrLen nLines;
xub_StrLen nFormatLines;
if ( nTextHeight )
{
2009-09-21 07:37:41 +00:00
nMaxTextWidth = ImplGetTextLines( aMultiLineInfo, nWidth, aStr, nStyle, _rLayout );
2000-09-18 16:07:07 +00:00
nLines = (xub_StrLen)(nHeight/nTextHeight);
nFormatLines = aMultiLineInfo.Count();
if ( !nLines )
nLines = 1;
if ( nFormatLines > nLines )
{
if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
{
// Letzte Zeile zusammenbauen und kuerzen
nFormatLines = nLines-1;
2002-04-23 06:40:42 +00:00
2000-09-18 16:07:07 +00:00
pLineInfo = aMultiLineInfo.GetLine( nFormatLines );
aLastLine = aStr.Copy( pLineInfo->GetIndex() );
aLastLine.ConvertLineEnd( LINEEND_LF );
// Alle LineFeed's durch Spaces ersetzen
xub_StrLen nLastLineLen = aLastLine.Len();
for ( i = 0; i < nLastLineLen; i++ )
{
if ( aLastLine.GetChar( i ) == _LF )
aLastLine.SetChar( i, ' ' );
}
aLastLine = ImplGetEllipsisString( rTargetDevice, aLastLine, nWidth, nStyle, _rLayout );
2000-09-18 16:07:07 +00:00
nStyle &= ~(TEXT_DRAW_VCENTER | TEXT_DRAW_BOTTOM);
nStyle |= TEXT_DRAW_TOP;
}
}
else
{
if ( nMaxTextWidth <= nWidth )
nStyle &= ~TEXT_DRAW_CLIP;
}
// Muss in der Hoehe geclippt werden?
if ( nFormatLines*nTextHeight > nHeight )
nStyle |= TEXT_DRAW_CLIP;
// Clipping setzen
if ( nStyle & TEXT_DRAW_CLIP )
{
rTargetDevice.Push( PUSH_CLIPREGION );
rTargetDevice.IntersectClipRegion( rRect );
2000-09-18 16:07:07 +00:00
}
// Vertikales Alignment
if ( nStyle & TEXT_DRAW_BOTTOM )
aPos.Y() += nHeight-(nFormatLines*nTextHeight);
else if ( nStyle & TEXT_DRAW_VCENTER )
aPos.Y() += (nHeight-(nFormatLines*nTextHeight))/2;
// Font Alignment
if ( eAlign == ALIGN_BOTTOM )
aPos.Y() += nTextHeight;
else if ( eAlign == ALIGN_BASELINE )
aPos.Y() += rTargetDevice.GetFontMetric().GetAscent();
2000-09-18 16:07:07 +00:00
// Alle Zeilen ausgeben, bis auf die letzte
for ( i = 0; i < nFormatLines; i++ )
{
pLineInfo = aMultiLineInfo.GetLine( i );
if ( nStyle & TEXT_DRAW_RIGHT )
aPos.X() += nWidth-pLineInfo->GetWidth();
else if ( nStyle & TEXT_DRAW_CENTER )
aPos.X() += (nWidth-pLineInfo->GetWidth())/2;
xub_StrLen nIndex = pLineInfo->GetIndex();
xub_StrLen nLineLen = pLineInfo->GetLen();
_rLayout.DrawText( aPos, aStr, nIndex, nLineLen, pVector, pDisplayText );
if ( bDrawMnemonics )
2000-09-18 16:07:07 +00:00
{
if ( (nMnemonicPos >= nIndex) && (nMnemonicPos < nIndex+nLineLen) )
{
long nMnemonicX;
long nMnemonicY;
long nMnemonicWidth;
sal_Int32* pCaretXArray = (sal_Int32*) alloca( 2 * sizeof(sal_Int32) * nLineLen );
/*BOOL bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray,
nIndex, nLineLen );
long lc_x1 = pCaretXArray[2*(nMnemonicPos - nIndex)];
long lc_x2 = pCaretXArray[2*(nMnemonicPos - nIndex)+1];
nMnemonicWidth = rTargetDevice.ImplLogicWidthToDevicePixel( ::abs((int)(lc_x1 - lc_x2)) );
Point aTempPos = rTargetDevice.LogicToPixel( aPos );
nMnemonicX = rTargetDevice.GetOutOffXPixel() + aTempPos.X() + rTargetDevice.ImplLogicWidthToDevicePixel( Min( lc_x1, lc_x2 ) );
nMnemonicY = rTargetDevice.GetOutOffYPixel() + aTempPos.Y() + rTargetDevice.ImplLogicWidthToDevicePixel( rTargetDevice.GetFontMetric().GetAscent() );
rTargetDevice.ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
2000-09-18 16:07:07 +00:00
}
}
aPos.Y() += nTextHeight;
aPos.X() = rRect.Left();
}
2002-04-23 06:40:42 +00:00
2000-09-18 16:07:07 +00:00
// Gibt es noch eine letzte Zeile, dann diese linksbuendig ausgeben,
// da die Zeile gekuerzt wurde
if ( aLastLine.Len() )
_rLayout.DrawText( aPos, aLastLine, 0, STRING_LEN, pVector, pDisplayText );
2000-09-18 16:07:07 +00:00
// Clipping zuruecksetzen
if ( nStyle & TEXT_DRAW_CLIP )
rTargetDevice.Pop();
2000-09-18 16:07:07 +00:00
}
}
else
{
long nTextWidth = _rLayout.GetTextWidth( aStr, 0, STRING_LEN );
2000-09-18 16:07:07 +00:00
// Evt. Text kuerzen
if ( nTextWidth > nWidth )
{
if ( nStyle & TEXT_DRAW_ELLIPSIS )
{
aStr = ImplGetEllipsisString( rTargetDevice, aStr, nWidth, nStyle, _rLayout );
2000-09-18 16:07:07 +00:00
nStyle &= ~(TEXT_DRAW_CENTER | TEXT_DRAW_RIGHT);
nStyle |= TEXT_DRAW_LEFT;
nTextWidth = _rLayout.GetTextWidth( aStr, 0, aStr.Len() );
2000-09-18 16:07:07 +00:00
}
}
else
{
if ( nTextHeight <= nHeight )
nStyle &= ~TEXT_DRAW_CLIP;
}
// horizontal text alignment
2000-09-18 16:07:07 +00:00
if ( nStyle & TEXT_DRAW_RIGHT )
aPos.X() += nWidth-nTextWidth;
else if ( nStyle & TEXT_DRAW_CENTER )
aPos.X() += (nWidth-nTextWidth)/2;
// vertical font alignment
2000-09-18 16:07:07 +00:00
if ( eAlign == ALIGN_BOTTOM )
aPos.Y() += nTextHeight;
else if ( eAlign == ALIGN_BASELINE )
aPos.Y() += rTargetDevice.GetFontMetric().GetAscent();
2000-09-18 16:07:07 +00:00
if ( nStyle & TEXT_DRAW_BOTTOM )
aPos.Y() += nHeight-nTextHeight;
else if ( nStyle & TEXT_DRAW_VCENTER )
aPos.Y() += (nHeight-nTextHeight)/2;
long nMnemonicX = 0;
long nMnemonicY = 0;
long nMnemonicWidth = 0;
2000-09-18 16:07:07 +00:00
if ( nMnemonicPos != STRING_NOTFOUND )
{
sal_Int32* pCaretXArray = (sal_Int32*) alloca( 2 * sizeof(sal_Int32) * aStr.Len() );
/*BOOL bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray, 0, aStr.Len() );
long lc_x1 = pCaretXArray[2*(nMnemonicPos)];
long lc_x2 = pCaretXArray[2*(nMnemonicPos)+1];
nMnemonicWidth = rTargetDevice.ImplLogicWidthToDevicePixel( ::abs((int)(lc_x1 - lc_x2)) );
Point aTempPos = rTargetDevice.LogicToPixel( aPos );
nMnemonicX = rTargetDevice.GetOutOffXPixel() + aTempPos.X() + rTargetDevice.ImplLogicWidthToDevicePixel( Min(lc_x1, lc_x2) );
nMnemonicY = rTargetDevice.GetOutOffYPixel() + aTempPos.Y() + rTargetDevice.ImplLogicWidthToDevicePixel( rTargetDevice.GetFontMetric().GetAscent() );
2000-09-18 16:07:07 +00:00
}
if ( nStyle & TEXT_DRAW_CLIP )
{
rTargetDevice.Push( PUSH_CLIPREGION );
rTargetDevice.IntersectClipRegion( rRect );
_rLayout.DrawText( aPos, aStr, 0, STRING_LEN, pVector, pDisplayText );
if ( bDrawMnemonics )
2000-09-18 16:07:07 +00:00
{
if ( nMnemonicPos != STRING_NOTFOUND )
rTargetDevice.ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
2000-09-18 16:07:07 +00:00
}
rTargetDevice.Pop();
2000-09-18 16:07:07 +00:00
}
else
{
_rLayout.DrawText( aPos, aStr, 0, STRING_LEN, pVector, pDisplayText );
if ( bDrawMnemonics )
2000-09-18 16:07:07 +00:00
{
if ( nMnemonicPos != STRING_NOTFOUND )
rTargetDevice.ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
2000-09-18 16:07:07 +00:00
}
}
}
if ( nStyle & TEXT_DRAW_DISABLE && !pVector )
2000-09-18 16:07:07 +00:00
{
rTargetDevice.SetTextColor( aOldTextColor );
2000-09-18 16:07:07 +00:00
if ( bRestoreFillColor )
rTargetDevice.SetTextFillColor( aOldTextFillColor );
2000-09-18 16:07:07 +00:00
}
}
// -----------------------------------------------------------------------
void OutputDevice::AddTextRectActions( const Rectangle& rRect,
const String& rOrigStr,
USHORT nStyle,
GDIMetaFile& rMtf )
{
DBG_TRACE( "OutputDevice::AddTextRectActions( const Rectangle& )" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( !rOrigStr.Len() || rRect.IsEmpty() )
return;
// we need a graphics
if( !mpGraphics && !ImplGetGraphics() )
return;
if( mbInitClipRegion )
ImplInitClipRegion();
// temporarily swap in passed mtf for action generation, and
// disable output generation.
const BOOL bOutputEnabled( IsOutputEnabled() );
GDIMetaFile* pMtf = mpMetaFile;
mpMetaFile = &rMtf;
EnableOutput( FALSE );
// #i47157# Factored out to ImplDrawTextRect(), to be shared
// between us and DrawText()
DefaultTextLayout aLayout( *this );
ImplDrawText( *this, rRect, rOrigStr, nStyle, NULL, NULL, aLayout );
// and restore again
EnableOutput( bOutputEnabled );
mpMetaFile = pMtf;
}
// -----------------------------------------------------------------------
void OutputDevice::DrawText( const Rectangle& rRect, const String& rOrigStr, USHORT nStyle,
MetricVector* pVector, String* pDisplayText,
::vcl::ITextLayout* _pTextLayout )
{
if( mpOutDevData && mpOutDevData->mpRecordLayout )
{
pVector = &mpOutDevData->mpRecordLayout->m_aUnicodeBoundRects;
pDisplayText = &mpOutDevData->mpRecordLayout->m_aDisplayText;
}
DBG_TRACE( "OutputDevice::DrawText( const Rectangle& )" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
bool bDecomposeTextRectAction = ( _pTextLayout != NULL ) && _pTextLayout->DecomposeTextRectAction();
if ( mpMetaFile && !bDecomposeTextRectAction )
mpMetaFile->AddAction( new MetaTextRectAction( rRect, rOrigStr, nStyle ) );
if ( ( !IsDeviceOutputNecessary() && !pVector && !bDecomposeTextRectAction ) || !rOrigStr.Len() || rRect.IsEmpty() )
return;
// we need a graphics
if( !mpGraphics && !ImplGetGraphics() )
return;
if( mbInitClipRegion )
ImplInitClipRegion();
if( mbOutputClipped && !bDecomposeTextRectAction )
return;
// temporarily disable mtf action generation (ImplDrawText _does_
// create META_TEXT_ACTIONs otherwise)
GDIMetaFile* pMtf = mpMetaFile;
if ( !bDecomposeTextRectAction )
mpMetaFile = NULL;
// #i47157# Factored out to ImplDrawText(), to be used also
// from AddTextRectActions()
DefaultTextLayout aDefaultLayout( *this );
ImplDrawText( *this, rRect, rOrigStr, nStyle, pVector, pDisplayText, _pTextLayout ? *_pTextLayout : aDefaultLayout );
// and enable again
mpMetaFile = pMtf;
if( mpAlphaVDev )
mpAlphaVDev->DrawText( rRect, rOrigStr, nStyle, pVector, pDisplayText );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
const XubString& rStr, USHORT nStyle,
TextRectInfo* pInfo,
const ::vcl::ITextLayout* _pTextLayout ) const
2000-09-18 16:07:07 +00:00
{
DBG_TRACE( "OutputDevice::GetTextRect()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
Rectangle aRect = rRect;
xub_StrLen nLines;
long nWidth = rRect.GetWidth();
long nMaxWidth;
long nTextHeight = GetTextHeight();
String aStr = rStr;
2000-09-18 16:07:07 +00:00
if ( nStyle & TEXT_DRAW_MNEMONIC )
aStr = GetNonMnemonicString( aStr );
if ( nStyle & TEXT_DRAW_MULTILINE )
{
ImplMultiTextLineInfo aMultiLineInfo;
ImplTextLineInfo* pLineInfo;
xub_StrLen nFormatLines;
xub_StrLen i;
nMaxWidth = 0;
DefaultTextLayout aDefaultLayout( *const_cast< OutputDevice* >( this ) );
2009-09-21 07:37:41 +00:00
ImplGetTextLines( aMultiLineInfo, nWidth, aStr, nStyle, _pTextLayout ? *_pTextLayout : aDefaultLayout );
2000-09-18 16:07:07 +00:00
nFormatLines = aMultiLineInfo.Count();
if ( !nTextHeight )
nTextHeight = 1;
nLines = (USHORT)(aRect.GetHeight()/nTextHeight);
if ( pInfo )
pInfo->mnLineCount = nFormatLines;
if ( !nLines )
nLines = 1;
if ( nFormatLines <= nLines )
nLines = nFormatLines;
else
{
if ( !(nStyle & TEXT_DRAW_ENDELLIPSIS) )
nLines = nFormatLines;
else
{
if ( pInfo )
pInfo->mbEllipsis = TRUE;
nMaxWidth = nWidth;
}
}
if ( pInfo )
{
BOOL bMaxWidth = nMaxWidth == 0;
pInfo->mnMaxWidth = 0;
for ( i = 0; i < nLines; i++ )
{
pLineInfo = aMultiLineInfo.GetLine( i );
if ( bMaxWidth && (pLineInfo->GetWidth() > nMaxWidth) )
nMaxWidth = pLineInfo->GetWidth();
if ( pLineInfo->GetWidth() > pInfo->mnMaxWidth )
pInfo->mnMaxWidth = pLineInfo->GetWidth();
}
}
else if ( !nMaxWidth )
{
for ( i = 0; i < nLines; i++ )
{
pLineInfo = aMultiLineInfo.GetLine( i );
if ( pLineInfo->GetWidth() > nMaxWidth )
nMaxWidth = pLineInfo->GetWidth();
}
}
}
else
{
nLines = 1;
nMaxWidth = _pTextLayout ? _pTextLayout->GetTextWidth( aStr, 0, aStr.Len() ) : GetTextWidth( aStr );
2000-09-18 16:07:07 +00:00
if ( pInfo )
{
pInfo->mnLineCount = 1;
pInfo->mnMaxWidth = nMaxWidth;
}
if ( (nMaxWidth > nWidth) && (nStyle & TEXT_DRAW_ELLIPSIS) )
{
if ( pInfo )
pInfo->mbEllipsis = TRUE;
nMaxWidth = nWidth;
}
}
if ( nStyle & TEXT_DRAW_RIGHT )
aRect.Left() = aRect.Right()-nMaxWidth+1;
else if ( nStyle & TEXT_DRAW_CENTER )
{
aRect.Left() += (nWidth-nMaxWidth)/2;
aRect.Right() = aRect.Left()+nMaxWidth-1;
}
else
aRect.Right() = aRect.Left()+nMaxWidth-1;
if ( nStyle & TEXT_DRAW_BOTTOM )
aRect.Top() = aRect.Bottom()-(nTextHeight*nLines)+1;
else if ( nStyle & TEXT_DRAW_VCENTER )
{
aRect.Top() += (aRect.GetHeight()-(nTextHeight*nLines))/2;
aRect.Bottom() = aRect.Top()+(nTextHeight*nLines)-1;
}
else
aRect.Bottom() = aRect.Top()+(nTextHeight*nLines)-1;
aRect.Right()++; // #99188# get rid of rounding problems when using this rect later
2000-09-18 16:07:07 +00:00
return aRect;
}
// -----------------------------------------------------------------------
static BOOL ImplIsCharIn( xub_Unicode c, const sal_Char* pStr )
{
while ( *pStr )
{
if ( *pStr == c )
return TRUE;
pStr++;
}
return FALSE;
}
// -----------------------------------------------------------------------
String OutputDevice::GetEllipsisString( const String& rOrigStr, long nMaxWidth,
USHORT nStyle ) const
2000-09-18 16:07:07 +00:00
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DefaultTextLayout aTextLayout( *const_cast< OutputDevice* >( this ) );
return ImplGetEllipsisString( *this, rOrigStr, nMaxWidth, nStyle, aTextLayout );
}
// -----------------------------------------------------------------------
String OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, const XubString& rOrigStr, long nMaxWidth,
USHORT nStyle, const ::vcl::ITextLayout& _rLayout )
{
DBG_TRACE( "OutputDevice::ImplGetEllipsisString()" );
2000-09-18 16:07:07 +00:00
String aStr = rOrigStr;
xub_StrLen nIndex = _rLayout.GetTextBreak( aStr, nMaxWidth, 0, aStr.Len() );
2000-09-18 16:07:07 +00:00
2002-04-23 06:40:42 +00:00
2000-09-18 16:07:07 +00:00
if ( nIndex != STRING_LEN )
{
if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
{
aStr.Erase( nIndex );
if ( nIndex > 1 )
{
aStr.AppendAscii( "..." );
while ( aStr.Len() && (_rLayout.GetTextWidth( aStr, 0, aStr.Len() ) > nMaxWidth) )
2000-09-18 16:07:07 +00:00
{
if ( (nIndex > 1) || (nIndex == aStr.Len()) )
nIndex--;
aStr.Erase( nIndex, 1 );
}
}
if ( !aStr.Len() && (nStyle & TEXT_DRAW_CLIP) )
aStr += rOrigStr.GetChar( 0 );
2000-09-18 16:07:07 +00:00
}
else if ( nStyle & TEXT_DRAW_PATHELLIPSIS )
2000-09-18 16:07:07 +00:00
{
rtl::OUString aPath( rOrigStr );
rtl::OUString aAbbreviatedPath;
osl_abbreviateSystemPath( aPath.pData, &aAbbreviatedPath.pData, nIndex, NULL );
aStr = aAbbreviatedPath;
}
else if ( nStyle & TEXT_DRAW_NEWSELLIPSIS )
{
static sal_Char const pSepChars[] = ".";
2000-09-18 16:07:07 +00:00
// Letztes Teilstueck ermitteln
xub_StrLen nLastContent = aStr.Len();
2000-09-18 16:07:07 +00:00
while ( nLastContent )
{
nLastContent--;
if ( ImplIsCharIn( aStr.GetChar( nLastContent ), pSepChars ) )
2000-09-18 16:07:07 +00:00
break;
}
while ( nLastContent &&
ImplIsCharIn( aStr.GetChar( nLastContent-1 ), pSepChars ) )
2000-09-18 16:07:07 +00:00
nLastContent--;
XubString aLastStr( aStr, nLastContent, aStr.Len() );
XubString aTempLastStr1( RTL_CONSTASCII_USTRINGPARAM( "..." ) );
aTempLastStr1 += aLastStr;
if ( _rLayout.GetTextWidth( aTempLastStr1, 0, aTempLastStr1.Len() ) > nMaxWidth )
aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth, nStyle | TEXT_DRAW_ENDELLIPSIS, _rLayout );
2000-09-18 16:07:07 +00:00
else
{
USHORT nFirstContent = 0;
while ( nFirstContent < nLastContent )
{
nFirstContent++;
if ( ImplIsCharIn( aStr.GetChar( nFirstContent ), pSepChars ) )
2000-09-18 16:07:07 +00:00
break;
}
while ( (nFirstContent < nLastContent) &&
ImplIsCharIn( aStr.GetChar( nFirstContent ), pSepChars ) )
2000-09-18 16:07:07 +00:00
nFirstContent++;
if ( nFirstContent >= nLastContent )
aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth, nStyle | TEXT_DRAW_ENDELLIPSIS, _rLayout );
2000-09-18 16:07:07 +00:00
else
{
if ( nFirstContent > 4 )
nFirstContent = 4;
XubString aFirstStr( aStr, 0, nFirstContent );
2000-09-18 16:07:07 +00:00
aFirstStr.AppendAscii( "..." );
XubString aTempStr = aFirstStr;
aTempStr += aLastStr;
if ( _rLayout.GetTextWidth( aTempStr, 0, aTempStr.Len() ) > nMaxWidth )
aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth, nStyle | TEXT_DRAW_ENDELLIPSIS, _rLayout );
2000-09-18 16:07:07 +00:00
else
{
do
{
aStr = aTempStr;
if( nLastContent > aStr.Len() )
nLastContent = aStr.Len();
2000-09-18 16:07:07 +00:00
while ( nFirstContent < nLastContent )
{
nLastContent--;
if ( ImplIsCharIn( aStr.GetChar( nLastContent ), pSepChars ) )
2000-09-18 16:07:07 +00:00
break;
2002-04-23 06:40:42 +00:00
2000-09-18 16:07:07 +00:00
}
while ( (nFirstContent < nLastContent) &&
ImplIsCharIn( aStr.GetChar( nLastContent-1 ), pSepChars ) )
2000-09-18 16:07:07 +00:00
nLastContent--;
if ( nFirstContent < nLastContent )
{
XubString aTempLastStr( aStr, nLastContent, aStr.Len() );
2000-09-18 16:07:07 +00:00
aTempStr = aFirstStr;
aTempStr += aTempLastStr;
if ( _rLayout.GetTextWidth( aTempStr, 0, aTempStr.Len() ) > nMaxWidth )
2000-09-18 16:07:07 +00:00
break;
}
}
while ( nFirstContent < nLastContent );
}
}
}
}
}
return aStr;
}
// -----------------------------------------------------------------------
void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
xub_StrLen nIndex, xub_StrLen nLen,
USHORT nStyle, MetricVector* pVector, String* pDisplayText )
2000-09-18 16:07:07 +00:00
{
DBG_TRACE( "OutputDevice::DrawCtrlText()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( !IsDeviceOutputNecessary() || (nIndex >= rStr.Len()) )
return;
// better get graphics here because ImplDrawMnemonicLine() will not
2000-09-18 16:07:07 +00:00
// we need a graphics
if( !mpGraphics && !ImplGetGraphics() )
return;
if( mbInitClipRegion )
2000-09-18 16:07:07 +00:00
ImplInitClipRegion();
if ( mbOutputClipped )
return;
if( nIndex >= rStr.Len() )
return;
if( (ULONG)nIndex+nLen >= rStr.Len() )
nLen = rStr.Len() - nIndex;
2000-09-18 16:07:07 +00:00
XubString aStr = rStr;
xub_StrLen nMnemonicPos = STRING_NOTFOUND;
2002-04-23 06:40:42 +00:00
long nMnemonicX = 0;
long nMnemonicY = 0;
long nMnemonicWidth = 0;
2008-10-29 09:25:50 +00:00
if ( (nStyle & TEXT_DRAW_MNEMONIC) && nLen > 1 )
2000-09-18 16:07:07 +00:00
{
aStr = GetNonMnemonicString( aStr, nMnemonicPos );
if ( nMnemonicPos != STRING_NOTFOUND )
{
if( nMnemonicPos < nIndex )
--nIndex;
else if( nLen < STRING_LEN )
{
if( nMnemonicPos < (nIndex+nLen) )
--nLen;
DBG_ASSERT( nMnemonicPos < (nIndex+nLen), "Mnemonic underline marker after last character" );
}
BOOL bInvalidPos = FALSE;
if( nMnemonicPos >= nLen )
{
// #106952#
// may occur in BiDi-Strings: the '~' is sometimes found behind the last char
// due to some strange BiDi text editors
// ->place the underline behind the string to indicate a failure
bInvalidPos = TRUE;
nMnemonicPos = nLen-1;
}
sal_Int32* pCaretXArray = (sal_Int32*)alloca( 2 * sizeof(sal_Int32) * nLen );
/*BOOL bRet =*/ GetCaretPositions( aStr, pCaretXArray, nIndex, nLen );
long lc_x1 = pCaretXArray[ 2*(nMnemonicPos - nIndex) ];
long lc_x2 = pCaretXArray[ 2*(nMnemonicPos - nIndex)+1 ];
2002-10-01 06:48:28 +00:00
nMnemonicWidth = ::abs((int)(lc_x1 - lc_x2));
Point aTempPos( Min(lc_x1,lc_x2), GetFontMetric().GetAscent() );
if( bInvalidPos ) // #106952#, place behind the (last) character
aTempPos = Point( Max(lc_x1,lc_x2), GetFontMetric().GetAscent() );
aTempPos += rPos;
aTempPos = LogicToPixel( aTempPos );
nMnemonicX = mnOutOffX + aTempPos.X();
nMnemonicY = mnOutOffY + aTempPos.Y();
2000-09-18 16:07:07 +00:00
}
}
if ( nStyle & TEXT_DRAW_DISABLE && ! pVector )
2000-09-18 16:07:07 +00:00
{
Color aOldTextColor;
Color aOldTextFillColor;
BOOL bRestoreFillColor;
BOOL bHighContrastBlack = FALSE;
BOOL bHighContrastWhite = FALSE;
const StyleSettings& rStyleSettings( GetSettings().GetStyleSettings() );
if( rStyleSettings.GetHighContrastMode() )
{
if( IsBackground() )
{
Wallpaper aWall = GetBackground();
Color aCol = aWall.GetColor();
bHighContrastBlack = aCol.IsDark();
bHighContrastWhite = aCol.IsBright();
}
}
2000-09-18 16:07:07 +00:00
aOldTextColor = GetTextColor();
if ( IsTextFillColor() )
{
bRestoreFillColor = TRUE;
aOldTextFillColor = GetTextFillColor();
}
else
bRestoreFillColor = FALSE;
if( bHighContrastBlack )
SetTextColor( COL_GREEN );
else if( bHighContrastWhite )
SetTextColor( COL_LIGHTGREEN );
else
SetTextColor( GetSettings().GetStyleSettings().GetDisableColor() );
DrawText( rPos, aStr, nIndex, nLen, pVector, pDisplayText );
if ( !(GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_NOMNEMONICS) && !pVector )
2000-09-18 16:07:07 +00:00
{
if ( nMnemonicPos != STRING_NOTFOUND )
ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
2000-09-18 16:07:07 +00:00
}
SetTextColor( aOldTextColor );
if ( bRestoreFillColor )
SetTextFillColor( aOldTextFillColor );
}
else
{
DrawText( rPos, aStr, nIndex, nLen, pVector, pDisplayText );
if ( !(GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_NOMNEMONICS) && !pVector )
2000-09-18 16:07:07 +00:00
{
if ( nMnemonicPos != STRING_NOTFOUND )
ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
2000-09-18 16:07:07 +00:00
}
}
if( mpAlphaVDev )
mpAlphaVDev->DrawCtrlText( rPos, rStr, nIndex, nLen, nStyle, pVector, pDisplayText );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
long OutputDevice::GetCtrlTextWidth( const String& rStr,
2000-09-18 16:07:07 +00:00
xub_StrLen nIndex, xub_StrLen nLen,
USHORT nStyle ) const
{
DBG_TRACE( "OutputDevice::GetCtrlTextSize()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if ( nStyle & TEXT_DRAW_MNEMONIC )
{
xub_StrLen nMnemonicPos;
XubString aStr = GetNonMnemonicString( rStr, nMnemonicPos );
if ( nMnemonicPos != STRING_NOTFOUND )
{
if ( nMnemonicPos < nIndex )
nIndex--;
else if ( (nLen < STRING_LEN) &&
(nMnemonicPos >= nIndex) && (nMnemonicPos < (ULONG)(nIndex+nLen)) )
nLen--;
}
return GetTextWidth( aStr, nIndex, nLen );
}
else
return GetTextWidth( rStr, nIndex, nLen );
}
// -----------------------------------------------------------------------
String OutputDevice::GetNonMnemonicString( const String& rStr, xub_StrLen& rMnemonicPos )
2000-09-18 16:07:07 +00:00
{
String aStr = rStr;
2000-09-18 16:07:07 +00:00
xub_StrLen nLen = aStr.Len();
xub_StrLen i = 0;
rMnemonicPos = STRING_NOTFOUND;
while ( i < nLen )
{
if ( aStr.GetChar( i ) == '~' )
{
if ( aStr.GetChar( i+1 ) != '~' )
{
if ( rMnemonicPos == STRING_NOTFOUND )
rMnemonicPos = i;
aStr.Erase( i, 1 );
nLen--;
}
else
{
aStr.Erase( i, 1 );
nLen--;
i++;
}
}
else
i++;
}
return aStr;
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
int OutputDevice::GetDevFontCount() const
2000-09-18 16:07:07 +00:00
{
DBG_TRACE( "OutputDevice::GetDevFontCount()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( !mpGetDevFontList )
mpGetDevFontList = mpFontList->GetDevFontList();
return mpGetDevFontList->Count();
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
FontInfo OutputDevice::GetDevFont( int nDevFontIndex ) const
2000-09-18 16:07:07 +00:00
{
DBG_TRACE( "OutputDevice::GetDevFont()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
FontInfo aFontInfo;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplInitFontList();
2000-09-18 16:07:07 +00:00
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
int nCount = GetDevFontCount();
if( nDevFontIndex < nCount )
2000-09-18 16:07:07 +00:00
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
const ImplFontData& rData = *mpGetDevFontList->Get( nDevFontIndex );
aFontInfo.SetName( rData.maName );
aFontInfo.SetStyleName( rData.maStyleName );
aFontInfo.SetCharSet( rData.mbSymbolFlag ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
aFontInfo.SetFamily( rData.meFamily );
aFontInfo.SetPitch( rData.mePitch );
aFontInfo.SetWeight( rData.meWeight );
aFontInfo.SetItalic( rData.meItalic );
aFontInfo.SetWidthType( rData.meWidthType );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( rData.IsScalable() )
aFontInfo.mpImplMetric->mnMiscFlags |= ImplFontMetric::SCALABLE_FLAG;
if( rData.mbDevice )
aFontInfo.mpImplMetric->mnMiscFlags |= ImplFontMetric::DEVICE_FLAG;
2000-09-18 16:07:07 +00:00
}
return aFontInfo;
}
// -----------------------------------------------------------------------
2002-11-06 15:53:42 +00:00
BOOL OutputDevice::AddTempDevFont( const String& rFileURL, const String& rFontName )
{
DBG_TRACE( "OutputDevice::AddTempDevFont()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
ImplInitFontList();
if( !mpGraphics && !ImplGetGraphics() )
2002-11-06 15:53:42 +00:00
return FALSE;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
bool bRC = mpGraphics->AddTempDevFont( mpFontList, rFileURL, rFontName );
if( !bRC )
2002-11-06 15:53:42 +00:00
return FALSE;
if( mpAlphaVDev )
mpAlphaVDev->AddTempDevFont( rFileURL, rFontName );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mpFontCache->Invalidate();
2002-11-06 15:53:42 +00:00
return TRUE;
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
int OutputDevice::GetDevFontSizeCount( const Font& rFont ) const
2000-09-18 16:07:07 +00:00
{
DBG_TRACE( "OutputDevice::GetDevFontSizeCount()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
delete mpGetDevSizeList;
2000-09-18 16:07:07 +00:00
ImplInitFontList();
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
mpGetDevSizeList = mpFontList->GetDevSizeList( rFont.GetName() );
return mpGetDevSizeList->Count();
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
Size OutputDevice::GetDevFontSize( const Font& rFont, int nSizeIndex ) const
2000-09-18 16:07:07 +00:00
{
DBG_TRACE( "OutputDevice::GetDevFontSize()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// check range
int nCount = GetDevFontSizeCount( rFont );
if ( nSizeIndex >= nCount )
2000-09-18 16:07:07 +00:00
return Size();
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// when mapping is enabled round to .5 points
Size aSize( 0, mpGetDevSizeList->Get( nSizeIndex ) );
2000-09-18 16:07:07 +00:00
if ( mbMap )
{
aSize.Height() *= 10;
MapMode aMap( MAP_10TH_INCH, Point(), Fraction( 1, 72 ), Fraction( 1, 72 ) );
aSize = PixelToLogic( aSize, aMap );
aSize.Height() += 5;
aSize.Height() /= 10;
long nRound = aSize.Height() % 5;
if ( nRound >= 3 )
aSize.Height() += (5-nRound);
else
aSize.Height() -= nRound;
aSize.Height() *= 10;
aSize = LogicToPixel( aSize, aMap );
aSize = PixelToLogic( aSize );
aSize.Height() += 5;
aSize.Height() /= 10;
}
return aSize;
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
BOOL OutputDevice::IsFontAvailable( const String& rFontName ) const
2000-09-18 16:07:07 +00:00
{
DBG_TRACE( "OutputDevice::IsFontAvailable()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplDevFontListData* pFound = mpFontList->FindFontFamily( rFontName );
return (pFound != NULL);
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
FontMetric OutputDevice::GetFontMetric() const
{
DBG_TRACE( "OutputDevice::GetFontMetric()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
FontMetric aMetric;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( mbNewFont && !ImplNewFont() )
return aMetric;
2000-09-18 16:07:07 +00:00
ImplFontEntry* pEntry = mpFontEntry;
ImplFontMetricData* pMetric = &(pEntry->maMetric);
// prepare metric
2000-09-18 16:07:07 +00:00
aMetric.Font::operator=( maFont );
// set aMetric with info from font
aMetric.SetName( maFont.GetName() );
2000-09-18 16:07:07 +00:00
aMetric.SetStyleName( pMetric->maStyleName );
aMetric.SetSize( PixelToLogic( Size( pMetric->mnWidth, pMetric->mnAscent+pMetric->mnDescent-pMetric->mnIntLeading ) ) );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
aMetric.SetCharSet( pMetric->mbSymbolFlag ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
2000-09-18 16:07:07 +00:00
aMetric.SetFamily( pMetric->meFamily );
aMetric.SetPitch( pMetric->mePitch );
aMetric.SetWeight( pMetric->meWeight );
aMetric.SetItalic( pMetric->meItalic );
aMetric.SetWidthType( pMetric->meWidthType );
2000-09-18 16:07:07 +00:00
if ( pEntry->mnOwnOrientation )
aMetric.SetOrientation( pEntry->mnOwnOrientation );
else
aMetric.SetOrientation( pMetric->mnOrientation );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( !pEntry->maMetric.mbKernableFont )
aMetric.SetKerning( maFont.GetKerning() & ~KERNING_FONTSPECIFIC );
2000-09-18 16:07:07 +00:00
// set remaining metric fields
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
aMetric.mpImplMetric->mnMiscFlags = 0;
if( pMetric->mbDevice )
aMetric.mpImplMetric->mnMiscFlags |= ImplFontMetric::DEVICE_FLAG;
if( pMetric->mbScalableFont )
aMetric.mpImplMetric->mnMiscFlags |= ImplFontMetric::SCALABLE_FLAG;
2001-02-23 15:13:58 +00:00
aMetric.mpImplMetric->mnAscent = ImplDevicePixelToLogicHeight( pMetric->mnAscent+mnEmphasisAscent );
aMetric.mpImplMetric->mnDescent = ImplDevicePixelToLogicHeight( pMetric->mnDescent+mnEmphasisDescent );
aMetric.mpImplMetric->mnIntLeading = ImplDevicePixelToLogicHeight( pMetric->mnIntLeading+mnEmphasisAscent );
aMetric.mpImplMetric->mnExtLeading = ImplDevicePixelToLogicHeight( pMetric->mnExtLeading );
2001-02-23 15:13:58 +00:00
aMetric.mpImplMetric->mnLineHeight = ImplDevicePixelToLogicHeight( pMetric->mnAscent+pMetric->mnDescent+mnEmphasisAscent+mnEmphasisDescent );
2000-09-18 16:07:07 +00:00
aMetric.mpImplMetric->mnSlant = ImplDevicePixelToLogicHeight( pMetric->mnSlant );
#ifdef UNX
// backwards compatible line metrics after fixing #i60945#
if( (meOutDevType == OUTDEV_VIRDEV)
&& static_cast<const VirtualDevice*>(this)->ForceZeroExtleadBug() )
aMetric.mpImplMetric->mnExtLeading = 0;
#endif
2000-09-18 16:07:07 +00:00
return aMetric;
}
// -----------------------------------------------------------------------
FontMetric OutputDevice::GetFontMetric( const Font& rFont ) const
{
2002-04-23 06:40:42 +00:00
// select font, query metrics, select original font again
2000-09-18 16:07:07 +00:00
Font aOldFont = GetFont();
2002-04-23 06:40:42 +00:00
const_cast<OutputDevice*>(this)->SetFont( rFont );
2000-09-18 16:07:07 +00:00
FontMetric aMetric( GetFontMetric() );
2002-04-23 06:40:42 +00:00
const_cast<OutputDevice*>(this)->SetFont( aOldFont );
2000-09-18 16:07:07 +00:00
return aMetric;
}
// -----------------------------------------------------------------------
CWS-TOOLING: integrate CWS cairocanvastext01 2009-05-12 07:10:00 +0200 mox r271795 : Rename ::GetLayoutData() to ::GetSysTextLayoutData() to avoid build breakage in sc module. 2009-05-11 23:40:57 +0200 mox r271794 : merge fixes (again). These files should have been removed by the rebase. 2009-05-11 20:17:44 +0200 mox r271791 : fix build breakage on UNX 2009-05-11 16:53:15 +0200 mox r271779 : Documentation fix 2009-05-11 16:49:16 +0200 mox r271778 : merge fixes 2009-05-11 14:10:36 +0200 mox r271769 : CWS-TOOLING: rebase CWS cairocanvastext01 to trunk@271427 (milestone: DEV300:m47) 2009-05-11 10:55:11 +0200 mox r271760 : merge fixes 2009-05-11 10:49:44 +0200 mox r271759 : manual merge to DEV300_m47 2009-05-11 10:42:11 +0200 mox r271758 : merge fixes 2009-05-11 10:29:16 +0200 mox r271757 : Manual merge to DEV300_m47 2009-05-11 10:21:13 +0200 mox r271756 : manual merge to DEV300_m47 2009-05-11 10:10:29 +0200 mox r271755 : manual merge to DEV300_m47 2009-05-11 10:01:33 +0200 mox r271754 : Manual merge to DEV300_m47 2009-05-11 09:59:30 +0200 mox r271753 : manual merge to DEV300_m47 2009-05-11 09:57:33 +0200 mox r271752 : merge fixes 2009-05-11 09:56:05 +0200 mox r271751 : merge fixes 2009-05-11 09:53:26 +0200 mox r271749 : Manual merge to DEV300_m47 2009-05-11 09:49:34 +0200 mox r271748 : manual merge to DEV300_m47 2009-05-11 09:43:20 +0200 mox r271747 : manual merge to DEV300_m47 2009-05-11 09:30:10 +0200 mox r271745 : Manual merge to DEV300_m47 2009-05-11 09:28:59 +0200 mox r271744 : manual merge to DEV300_m47 2009-05-11 09:24:49 +0200 mox r271743 : Fix to merge 2009-05-11 09:21:55 +0200 mox r271742 : Manual merge to DEV300_m47 2009-05-11 09:18:13 +0200 mox r271741 : merge fixes 2009-05-11 09:00:50 +0200 mox r271739 : Manual merge to DEV300_m47 2009-05-09 13:26:10 +0200 mox r271734 : cleanup 2009-05-09 13:17:22 +0200 mox r271733 : WNT build fixes 2009-05-09 09:23:59 +0200 mox r271732 : Implement proper cross-platform font width calculation Implement faux bold support 2009-02-21 19:47:08 +0100 mox r268339 : CWS-TOOLING: rebase CWS cairocanvastext01 to trunk@267171 (milestone: DEV300:m41) 2009-01-19 21:51:21 +0100 mox r266530 : Fix compilation on win32 2009-01-19 21:37:20 +0100 mox r266529 : Fix typo 2009-01-19 21:35:28 +0100 mox r266528 : Better debug 2009-01-19 21:13:30 +0100 mox r266527 : Win32 fixes for proper text rendering 2009-01-19 21:12:56 +0100 mox r266526 : Win32 fixes for proper text rendering 2008-12-27 13:04:05 +0100 mox r265814 : configure fixes 2008-12-27 11:37:00 +0100 mox r265813 : x86_64 works only with system-cairo 2008-12-26 20:02:32 +0100 mox r265809 : Use the fix for 64bit builds 2008-12-25 16:58:11 +0100 mox r265802 : Fix build breaker on WNT 2008-12-24 23:04:58 +0100 mox r265801 : Unbreak build after rebase. 2008-12-23 18:52:32 +0100 mox r265790 : CWS-TOOLING: rebase CWS cairocanvastext01 to trunk@265758 (milestone: DEV300:m38) 2008-12-23 18:23:09 +0100 mox r265789 : Fix the fix 2008-12-23 18:21:27 +0100 mox r265788 : Fix OS2 stuff 2008-12-11 19:50:40 +0100 mox r265354 : Fix build breaker on Mac 2008-12-09 22:00:53 +0100 mox r265139 : CWS-TOOLING: rebase CWS cairocanvastext01 to trunk@264807 (milestone: DEV300:m37) 2008-12-08 23:02:32 +0100 thb r265052 : Removed outdated parts from readme 2008-12-08 22:26:54 +0100 mox r265051 : cleanup 2008-12-07 19:55:31 +0100 mox r264967 : Fix for non-intel processors. 2008-12-07 19:47:11 +0100 mox r264963 : sysdata fixes 2008-12-07 19:23:27 +0100 mox r264959 : Sysdata fixes 2008-12-07 19:01:48 +0100 mox r264958 : Fix sysdata usage 2008-12-07 11:41:33 +0100 mox r264951 : sysdata fixes 2008-12-07 11:38:32 +0100 mox r264950 : sysdata fixes 2008-12-06 23:15:06 +0100 mox r264947 : Try to fix error: __sync_val_compare_and_swap_4 2008-12-06 23:09:30 +0100 mox r264945 : Revert unnecessary change. 2008-12-06 23:04:40 +0100 mox r264944 : Use pre/postx from tools module. 2008-12-06 22:49:08 +0100 mox r264943 : Use proper pre/post includes. 2008-12-06 22:48:03 +0100 mox r264942 : Use pre/postx from tools module. 2008-12-06 22:24:10 +0100 mox r264941 : Fix build breaker. 2008-12-06 21:55:46 +0100 mox r264940 : Make pre/postx.h properly available 2008-12-06 21:54:23 +0100 mox r264939 : Make pre/postx.h properly available. 2008-12-06 21:43:09 +0100 mox r264938 : Try to fix error: __sync_val_compare_and_swap_4 2008-12-06 21:12:18 +0100 mox r264937 : Remove obsolete pre-built binaries 2008-12-06 21:07:40 +0100 mox r264936 : WNT: do not hardcode pixman version in cairo build 2008-12-06 19:26:44 +0100 mox r264934 : Revert pixman upgrade. 2008-12-06 18:35:14 +0100 mox r264933 : Fix build breaker 2008-12-06 18:31:11 +0100 mox r264932 : Use static pixman lib on unx/32bit to avoid linking problems 2008-12-06 17:22:52 +0100 mox r264930 : Update pixman to 0.13.2 2008-12-06 13:30:41 +0100 mox r264928 : Fix accidentally changed property 2008-12-06 13:09:00 +0100 mox r264927 : Fix accidental prop changes 2008-12-06 12:40:08 +0100 mox r264926 : Fix build breaker on Win32 2008-12-06 12:39:22 +0100 mox r264925 : Fix build breaker on Win32 2008-12-06 12:30:23 +0100 mox r264924 : Fix build breakers on win32 2008-12-06 11:45:33 +0100 mox r264923 : revert. 2008-12-06 11:43:05 +0100 mox r264922 : Try to fix header include problems on WNT 2008-12-06 09:57:35 +0100 mox r264921 : Cleanup accidental props 2008-11-29 14:43:51 +0100 mox r264580 : Move headers around to make all platforms compile 2008-11-29 14:41:59 +0100 mox r264579 : WaE fixes for X11 2008-11-29 13:13:49 +0100 mox r264578 : Fix build breaker on linux 2008-11-29 12:21:03 +0100 mox r264577 : Fix build breaker 2008-11-29 12:13:50 +0100 mox r264576 : Try to fix build breaker 2008-11-28 22:51:27 +0100 mox r264573 : Revert header includes to common style 2008-11-18 18:59:15 +0100 mox r263794 : Fix build breaker. 2008-11-17 20:28:19 +0100 mox r263740 : Revert most configure hacks 2008-11-17 20:12:51 +0100 mox r263739 : CWS-TOOLING: rebase CWS cairocanvastext01 to trunk@263288 (milestone: DEV300:m35) 2008-11-14 21:22:22 +0100 mox r263698 : ZLIB_FIX define set 2008-11-14 18:48:22 +0100 mox r263694 : hardcode zlib paths 2008-11-14 16:23:07 +0100 mox r263683 : Fix typo 2008-11-13 20:16:13 +0100 mox r263662 : WaE fix 2008-11-13 19:44:29 +0100 mox r263661 : Properly include zlib headers for win32 2008-11-12 20:05:51 +0100 mox r263610 : Add debugging code. 2008-11-10 19:44:35 +0100 mox r263537 : Try to fix build breaker 2008-11-09 22:34:35 +0100 mox r263504 : Remove accidentally added svn:ignore properties. 2008-11-09 22:33:21 +0100 mox r263503 : prop should be actually deleted. 2008-11-09 22:30:06 +0100 mox r263502 : props should be empty. 2008-11-09 22:23:22 +0100 mox r263501 : Try fix props again... 2008-11-09 22:11:26 +0100 mox r263500 : try to fix svn:ignore 2008-11-09 21:30:01 +0100 mox r263499 : CWS-TOOLING: rebase CWS cairocanvastext01 to trunk@262620 (milestone: DEV300:m34) 2008-11-09 20:30:55 +0100 mox r263498 : add missing cairo patch 2008-11-09 10:56:33 +0100 mox r263494 : Resync cairo module with cws cairosource01 2008-11-01 09:32:19 +0100 mox r262870 : CWS-TOOLING: rebase CWS cairocanvastext01 to trunk@262620 (milestone: DEV300:m34) 2008-10-26 20:55:48 +0100 mox r262663 : Fix build breaker 2008-10-25 13:10:00 +0200 mox r262662 : CWS rebase to m33 2008-10-12 19:47:56 +0200 mox r262170 : Migrate CWS cairocanvastext01 to SVN.
2009-05-18 12:01:49 +00:00
/** OutputDevice::GetSysFontData
*
* @param nFallbacklevel Fallback font level (0 = best matching font)
*
* Retrieve detailed font information in platform independent structure
*
* @return SystemFontData
**/
SystemFontData OutputDevice::GetSysFontData(int nFallbacklevel) const
{
SystemFontData aSysFontData;
aSysFontData.nSize = sizeof(aSysFontData);
if (!mpGraphics) ImplGetGraphics();
if (mpGraphics) aSysFontData = mpGraphics->GetSysFontData(nFallbacklevel);
return aSysFontData;
}
// -----------------------------------------------------------------------
/** OutputDevice::GetSysTextLayoutData
*
* @param rStartPt Start point of the text
* @param rStr Text string that will be transformed into layout of glyphs
* @param nIndex Position in the string from where layout will be done
* @param nLen Length of the string
* @param pDXAry Custom layout adjustment data
*
* Export finalized glyph layout data as platform independent SystemTextLayoutData
* (see vcl/inc/vcl/sysdata.hxx)
*
* Only parameters rStartPt and rStr are mandatory, the rest is optional
* (default values will be used)
*
* @return SystemTextLayoutData
**/
SystemTextLayoutData OutputDevice::GetSysTextLayoutData(const Point& rStartPt, const XubString& rStr, xub_StrLen nIndex, xub_StrLen nLen,
const sal_Int32* pDXAry) const
{
DBG_TRACE( "OutputDevice::GetSysTextLayoutData()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
SystemTextLayoutData aSysLayoutData;
aSysLayoutData.nSize = sizeof(aSysLayoutData);
aSysLayoutData.rGlyphData.reserve( 256 );
if ( mpMetaFile ) {
if (pDXAry)
mpMetaFile->AddAction( new MetaTextArrayAction( rStartPt, rStr, pDXAry, nIndex, nLen ) );
else
mpMetaFile->AddAction( new MetaTextAction( rStartPt, rStr, nIndex, nLen ) );
}
if ( !IsDeviceOutputNecessary() ) return aSysLayoutData;
SalLayout* rLayout = ImplLayout( rStr, nIndex, nLen, rStartPt, 0, pDXAry, true );
// setup glyphs
Point aPos;
sal_GlyphId aGlyphId;
int nFallbacklevel = 0;
for( int nStart = 0; rLayout->GetNextGlyphs( 1, &aGlyphId, aPos, nStart ); )
{
// NOTE: Windows backend is producing unicode chars (ucs4), so on windows,
// ETO_GLYPH_INDEX is unusable, unless extra glyph conversion is made.
SystemGlyphData aGlyph;
aGlyph.index = static_cast<unsigned long> (aGlyphId & GF_IDXMASK);
aGlyph.x = aPos.X();
aGlyph.y = aPos.Y();
aSysLayoutData.rGlyphData.push_back(aGlyph);
int nLevel = (aGlyphId & GF_FONTMASK) >> GF_FONTSHIFT;
if (nLevel > nFallbacklevel && nLevel < MAX_FALLBACK)
nFallbacklevel = nLevel;
}
// Get font data
aSysLayoutData.aSysFontData = GetSysFontData(nFallbacklevel);
aSysLayoutData.orientation = rLayout->GetOrientation();
rLayout->Release();
return aSysLayoutData;
}
// -----------------------------------------------------------------------
long OutputDevice::GetMinKashida() const
{
DBG_TRACE( "OutputDevice::GetMinKashida()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
if( mbNewFont && !ImplNewFont() )
return 0;
ImplFontEntry* pEntry = mpFontEntry;
ImplFontMetricData* pMetric = &(pEntry->maMetric);
return ImplDevicePixelToLogicWidth( pMetric->mnMinKashida );
}
// -----------------------------------------------------------------------
long OutputDevice::GetMinKashida( const Font& rFont ) const
{
// select font, query Kashida, select original font again
Font aOldFont = GetFont();
const_cast<OutputDevice*>(this)->SetFont( rFont );
long aKashida = GetMinKashida();
const_cast<OutputDevice*>(this)->SetFont( aOldFont );
return aKashida;
}
// -----------------------------------------------------------------------
xub_StrLen OutputDevice::ValidateKashidas ( const String& rTxt,
xub_StrLen nIdx, xub_StrLen nLen,
xub_StrLen nKashCount,
const xub_StrLen* pKashidaPos,
xub_StrLen* pKashidaPosDropped ) const
{
// do layout
SalLayout* pSalLayout = ImplLayout( rTxt, nIdx, nLen );
if( !pSalLayout )
return 0;
xub_StrLen nDropped = 0;
for( int i = 0; i < nKashCount; ++i )
{
if( !pSalLayout->IsKashidaPosValid( pKashidaPos[ i ] ))
{
pKashidaPosDropped[ nDropped ] = pKashidaPos [ i ];
++nDropped;
}
}
pSalLayout->Release();
return nDropped;
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
// TODO: best is to get rid of this method completely
2000-09-18 16:07:07 +00:00
ULONG OutputDevice::GetKerningPairCount() const
{
DBG_TRACE( "OutputDevice::GetKerningPairCount()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( mbNewFont && !ImplNewFont() )
return 0;
if( mbInitFont )
ImplInitFont();
if( mpPDFWriter && mpPDFWriter->isBuiltinFont( mpFontEntry->maFontSelData.mpFontData ) )
return 0;
// get the kerning pair count from the device layer
int nKernPairs = mpGraphics->GetKernPairs( 0, NULL );
return nKernPairs;
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
inline bool CmpKernData( const KerningPair& a, const KerningPair& b )
{
return (a.nChar1 < b.nChar1) || ((a.nChar1 == a.nChar2) && (a.nChar2 < a.nChar2));
}
// TODO: best is to get rid of this method completely
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
void OutputDevice::GetKerningPairs( ULONG nRequestedPairs, KerningPair* pKernPairs ) const
2000-09-18 16:07:07 +00:00
{
DBG_TRACE( "OutputDevice::GetKerningPairs()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
if( mbNewFont && !ImplNewFont() )
return;
if( mbInitFont )
ImplInitFont();
if( mpPDFWriter && mpPDFWriter->isBuiltinFont( mpFontEntry->maFontSelData.mpFontData ) )
return;
// get the kerning pairs directly from the device layer
int nKernPairs = mpGraphics->GetKernPairs( nRequestedPairs, (ImplKernPairData*)pKernPairs );
// sort kerning pairs
std::sort( pKernPairs, pKernPairs+nKernPairs, CmpKernData );
2000-09-18 16:07:07 +00:00
}
// -----------------------------------------------------------------------
BOOL OutputDevice::GetGlyphBoundRects( const Point& rOrigin, const String& rStr,
int nIndex, int nLen, int nBase, MetricVector& rVector )
{
DBG_TRACE( "OutputDevice::GetGlyphBoundRect_CTL()" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
rVector.clear();
if( nLen == STRING_LEN )
nLen = rStr.Len() - nIndex;
Rectangle aRect;
for( int i = 0; i < nLen; i++ )
{
if( !GetTextBoundRect( aRect, rStr, sal::static_int_cast<xub_StrLen>(nBase), sal::static_int_cast<xub_StrLen>(nIndex+i), 1 ) )
break;
aRect.Move( rOrigin.X(), rOrigin.Y() );
rVector.push_back( aRect );
}
return (nLen == (int)rVector.size());
}
// -----------------------------------------------------------------------
BOOL OutputDevice::GetTextBoundRect( Rectangle& rRect,
CWS-TOOLING: integrate CWS vcl103 2009-07-24 Jens-Heiner Rechtien #i10000#: merge with m53 2009-07-10 Philipp Lohmann merge 2009-07-10 hdu #i103417# ignore non-standard font styles 2009-07-07 Philipp Lohmann #i98789# add: Invalidate on StateChanged( STATE_CHANGE_ENABLE ) 2009-07-07 Philipp Lohmann #i102501# ExportFormFields should be persistent 2009-07-07 Philipp Lohmann merge 2009-07-07 Philipp Lohmann #i103319# there is no platform currently where we should beep on disabled controls 2009-07-02 Philipp Lohmann merge 2009-07-01 Philipp Lohmann #i93100# handle ListBox with no border a little more graceful on MacOSX 2009-07-01 Philipp Lohmann #i101307# don't crash due to unfortunate timing 2009-07-03 thb #i103145# Swapped HINT_DOCK for HINT_TOOLBAR for the presentation fullscreen window; anecdotal evidence suggests it works much better then for wide-spread window managers 2009-06-30 Philipp Lohmann #i103102# evaluate Cmd-Option key combinations 2009-06-29 Philipp Lohmann #i103148# catch exception from missing UCB (thanks thb) 2009-06-29 hdu #i102378# fix PDF-export on PPC (thanks cloph!) 2009-06-25 Philipp Lohmann fix another link problem 2009-06-24 Philipp Lohmann use correct method signature 2009-06-24 Philipp Lohmann fix a warning 2009-06-24 Philipp Lohmann fix a warning 2009-06-24 Philipp Lohmann #i100357# add: GDIMetaFile::GetBoundRect 2009-06-24 Philipp Lohmann merge 2009-06-24 hdu #i100357# extend GetTextBoundRect() to measure justified text too 2009-06-23 Philipp Lohmann #i101108# protect writer from itself, no one could ever use paper of size (0,0) 2009-06-22 Philipp Lohmann merge 2009-06-22 Philipp Lohmann #i92356# treat windows running a popup menu as modal 2009-06-22 hdu #i100000# remove sft.h again (CWS dba32b accidentially reintroduced it) 2009-06-17 Philipp Lohmann merge 2009-06-17 Philipp Lohmann remove warnings (thanks ericb) 2009-06-17 Philipp Lohmann merge 2009-06-17 Philipp Lohmann #i102133# free cursors (thanks cmc) 2009-06-17 Philipp Lohmann #i97293# catch exception 2009-06-17 Philipp Lohmann #i91240# fix images in menus, again 2009-06-15 Philipp Lohmann #i100586# fix a pure virtual method (thanks cmc) 2009-06-15 Philipp Lohmann fix an array delete issue 2009-06-15 Philipp Lohmann #i102228# fix a cleanup issue 2009-06-15 Philipp Lohmann #i97218# solve duplicate accelerator 2009-06-12 hdu #i102219# avoid void*->oslGenericFunction cast for MingW (thanks tono!)
2009-07-24 15:45:35 +00:00
const String& rStr, xub_StrLen nBase, xub_StrLen nIndex, xub_StrLen nLen,
ULONG nLayoutWidth, const sal_Int32* pDXAry ) const
2000-09-18 16:07:07 +00:00
{
DBG_TRACE( "OutputDevice::GetTextBoundRect()" );
2000-09-18 16:07:07 +00:00
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
BOOL bRet = FALSE;
rRect.SetEmpty();
2000-09-18 16:07:07 +00:00
SalLayout* pSalLayout = NULL;
CWS-TOOLING: integrate CWS vcl103 2009-07-24 Jens-Heiner Rechtien #i10000#: merge with m53 2009-07-10 Philipp Lohmann merge 2009-07-10 hdu #i103417# ignore non-standard font styles 2009-07-07 Philipp Lohmann #i98789# add: Invalidate on StateChanged( STATE_CHANGE_ENABLE ) 2009-07-07 Philipp Lohmann #i102501# ExportFormFields should be persistent 2009-07-07 Philipp Lohmann merge 2009-07-07 Philipp Lohmann #i103319# there is no platform currently where we should beep on disabled controls 2009-07-02 Philipp Lohmann merge 2009-07-01 Philipp Lohmann #i93100# handle ListBox with no border a little more graceful on MacOSX 2009-07-01 Philipp Lohmann #i101307# don't crash due to unfortunate timing 2009-07-03 thb #i103145# Swapped HINT_DOCK for HINT_TOOLBAR for the presentation fullscreen window; anecdotal evidence suggests it works much better then for wide-spread window managers 2009-06-30 Philipp Lohmann #i103102# evaluate Cmd-Option key combinations 2009-06-29 Philipp Lohmann #i103148# catch exception from missing UCB (thanks thb) 2009-06-29 hdu #i102378# fix PDF-export on PPC (thanks cloph!) 2009-06-25 Philipp Lohmann fix another link problem 2009-06-24 Philipp Lohmann use correct method signature 2009-06-24 Philipp Lohmann fix a warning 2009-06-24 Philipp Lohmann fix a warning 2009-06-24 Philipp Lohmann #i100357# add: GDIMetaFile::GetBoundRect 2009-06-24 Philipp Lohmann merge 2009-06-24 hdu #i100357# extend GetTextBoundRect() to measure justified text too 2009-06-23 Philipp Lohmann #i101108# protect writer from itself, no one could ever use paper of size (0,0) 2009-06-22 Philipp Lohmann merge 2009-06-22 Philipp Lohmann #i92356# treat windows running a popup menu as modal 2009-06-22 hdu #i100000# remove sft.h again (CWS dba32b accidentially reintroduced it) 2009-06-17 Philipp Lohmann merge 2009-06-17 Philipp Lohmann remove warnings (thanks ericb) 2009-06-17 Philipp Lohmann merge 2009-06-17 Philipp Lohmann #i102133# free cursors (thanks cmc) 2009-06-17 Philipp Lohmann #i97293# catch exception 2009-06-17 Philipp Lohmann #i91240# fix images in menus, again 2009-06-15 Philipp Lohmann #i100586# fix a pure virtual method (thanks cmc) 2009-06-15 Philipp Lohmann fix an array delete issue 2009-06-15 Philipp Lohmann #i102228# fix a cleanup issue 2009-06-15 Philipp Lohmann #i97218# solve duplicate accelerator 2009-06-12 hdu #i102219# avoid void*->oslGenericFunction cast for MingW (thanks tono!)
2009-07-24 15:45:35 +00:00
const Point aPoint;
// calculate offset when nBase!=nIndex
long nXOffset = 0;
if( nBase != nIndex )
2002-04-23 06:40:42 +00:00
{
xub_StrLen nStart = Min( nBase, nIndex );
xub_StrLen nOfsLen = Max( nBase, nIndex ) - nStart;
CWS-TOOLING: integrate CWS vcl103 2009-07-24 Jens-Heiner Rechtien #i10000#: merge with m53 2009-07-10 Philipp Lohmann merge 2009-07-10 hdu #i103417# ignore non-standard font styles 2009-07-07 Philipp Lohmann #i98789# add: Invalidate on StateChanged( STATE_CHANGE_ENABLE ) 2009-07-07 Philipp Lohmann #i102501# ExportFormFields should be persistent 2009-07-07 Philipp Lohmann merge 2009-07-07 Philipp Lohmann #i103319# there is no platform currently where we should beep on disabled controls 2009-07-02 Philipp Lohmann merge 2009-07-01 Philipp Lohmann #i93100# handle ListBox with no border a little more graceful on MacOSX 2009-07-01 Philipp Lohmann #i101307# don't crash due to unfortunate timing 2009-07-03 thb #i103145# Swapped HINT_DOCK for HINT_TOOLBAR for the presentation fullscreen window; anecdotal evidence suggests it works much better then for wide-spread window managers 2009-06-30 Philipp Lohmann #i103102# evaluate Cmd-Option key combinations 2009-06-29 Philipp Lohmann #i103148# catch exception from missing UCB (thanks thb) 2009-06-29 hdu #i102378# fix PDF-export on PPC (thanks cloph!) 2009-06-25 Philipp Lohmann fix another link problem 2009-06-24 Philipp Lohmann use correct method signature 2009-06-24 Philipp Lohmann fix a warning 2009-06-24 Philipp Lohmann fix a warning 2009-06-24 Philipp Lohmann #i100357# add: GDIMetaFile::GetBoundRect 2009-06-24 Philipp Lohmann merge 2009-06-24 hdu #i100357# extend GetTextBoundRect() to measure justified text too 2009-06-23 Philipp Lohmann #i101108# protect writer from itself, no one could ever use paper of size (0,0) 2009-06-22 Philipp Lohmann merge 2009-06-22 Philipp Lohmann #i92356# treat windows running a popup menu as modal 2009-06-22 hdu #i100000# remove sft.h again (CWS dba32b accidentially reintroduced it) 2009-06-17 Philipp Lohmann merge 2009-06-17 Philipp Lohmann remove warnings (thanks ericb) 2009-06-17 Philipp Lohmann merge 2009-06-17 Philipp Lohmann #i102133# free cursors (thanks cmc) 2009-06-17 Philipp Lohmann #i97293# catch exception 2009-06-17 Philipp Lohmann #i91240# fix images in menus, again 2009-06-15 Philipp Lohmann #i100586# fix a pure virtual method (thanks cmc) 2009-06-15 Philipp Lohmann fix an array delete issue 2009-06-15 Philipp Lohmann #i102228# fix a cleanup issue 2009-06-15 Philipp Lohmann #i97218# solve duplicate accelerator 2009-06-12 hdu #i102219# avoid void*->oslGenericFunction cast for MingW (thanks tono!)
2009-07-24 15:45:35 +00:00
pSalLayout = ImplLayout( rStr, nStart, nOfsLen, aPoint, nLayoutWidth, pDXAry );
if( pSalLayout )
{
nXOffset = pSalLayout->GetTextWidth();
nXOffset /= pSalLayout->GetUnitsPerPixel();
pSalLayout->Release();
// TODO: fix offset calculation for Bidi case
if( nBase < nIndex)
nXOffset = -nXOffset;
2002-04-23 06:40:42 +00:00
}
}
2000-09-18 16:07:07 +00:00
CWS-TOOLING: integrate CWS vcl103 2009-07-24 Jens-Heiner Rechtien #i10000#: merge with m53 2009-07-10 Philipp Lohmann merge 2009-07-10 hdu #i103417# ignore non-standard font styles 2009-07-07 Philipp Lohmann #i98789# add: Invalidate on StateChanged( STATE_CHANGE_ENABLE ) 2009-07-07 Philipp Lohmann #i102501# ExportFormFields should be persistent 2009-07-07 Philipp Lohmann merge 2009-07-07 Philipp Lohmann #i103319# there is no platform currently where we should beep on disabled controls 2009-07-02 Philipp Lohmann merge 2009-07-01 Philipp Lohmann #i93100# handle ListBox with no border a little more graceful on MacOSX 2009-07-01 Philipp Lohmann #i101307# don't crash due to unfortunate timing 2009-07-03 thb #i103145# Swapped HINT_DOCK for HINT_TOOLBAR for the presentation fullscreen window; anecdotal evidence suggests it works much better then for wide-spread window managers 2009-06-30 Philipp Lohmann #i103102# evaluate Cmd-Option key combinations 2009-06-29 Philipp Lohmann #i103148# catch exception from missing UCB (thanks thb) 2009-06-29 hdu #i102378# fix PDF-export on PPC (thanks cloph!) 2009-06-25 Philipp Lohmann fix another link problem 2009-06-24 Philipp Lohmann use correct method signature 2009-06-24 Philipp Lohmann fix a warning 2009-06-24 Philipp Lohmann fix a warning 2009-06-24 Philipp Lohmann #i100357# add: GDIMetaFile::GetBoundRect 2009-06-24 Philipp Lohmann merge 2009-06-24 hdu #i100357# extend GetTextBoundRect() to measure justified text too 2009-06-23 Philipp Lohmann #i101108# protect writer from itself, no one could ever use paper of size (0,0) 2009-06-22 Philipp Lohmann merge 2009-06-22 Philipp Lohmann #i92356# treat windows running a popup menu as modal 2009-06-22 hdu #i100000# remove sft.h again (CWS dba32b accidentially reintroduced it) 2009-06-17 Philipp Lohmann merge 2009-06-17 Philipp Lohmann remove warnings (thanks ericb) 2009-06-17 Philipp Lohmann merge 2009-06-17 Philipp Lohmann #i102133# free cursors (thanks cmc) 2009-06-17 Philipp Lohmann #i97293# catch exception 2009-06-17 Philipp Lohmann #i91240# fix images in menus, again 2009-06-15 Philipp Lohmann #i100586# fix a pure virtual method (thanks cmc) 2009-06-15 Philipp Lohmann fix an array delete issue 2009-06-15 Philipp Lohmann #i102228# fix a cleanup issue 2009-06-15 Philipp Lohmann #i97218# solve duplicate accelerator 2009-06-12 hdu #i102219# avoid void*->oslGenericFunction cast for MingW (thanks tono!)
2009-07-24 15:45:35 +00:00
pSalLayout = ImplLayout( rStr, nIndex, nLen, aPoint, nLayoutWidth, pDXAry );
Rectangle aPixelRect;
if( pSalLayout )
2002-04-23 06:40:42 +00:00
{
bRet = pSalLayout->GetBoundRect( *mpGraphics, aPixelRect );
if( bRet )
2002-04-23 06:40:42 +00:00
{
int nWidthFactor = pSalLayout->GetUnitsPerPixel();
if( nWidthFactor > 1 )
{
double fFactor = 1.0 / nWidthFactor;
2002-08-15 10:17:51 +00:00
aPixelRect.Left()
= static_cast< long >(aPixelRect.Left() * fFactor);
aPixelRect.Right()
= static_cast< long >(aPixelRect.Right() * fFactor);
aPixelRect.Top()
= static_cast< long >(aPixelRect.Top() * fFactor);
aPixelRect.Bottom()
= static_cast< long >(aPixelRect.Bottom() * fFactor);
}
2000-09-18 16:07:07 +00:00
Point aRotatedOfs( mnTextOffX, mnTextOffY );
aRotatedOfs -= pSalLayout->GetDrawPosition( Point( nXOffset, 0 ) );
aPixelRect += aRotatedOfs;
rRect = PixelToLogic( aPixelRect );
if( mbMap )
rRect += Point( maMapRes.mnMapOfsX, maMapRes.mnMapOfsY );
}
pSalLayout->Release();
}
if( bRet || (OUTDEV_PRINTER == meOutDevType) || !mpFontEntry )
return bRet;
2002-04-23 06:40:42 +00:00
// fall back to bitmap method to get the bounding rectangle,
// so we need a monochrome virtual device with matching font
VirtualDevice aVDev( 1 );
Font aFont( GetFont() );
aFont.SetShadow( FALSE );
aFont.SetOutline( FALSE );
aFont.SetRelief( RELIEF_NONE );
aFont.SetOrientation( 0 );
aFont.SetSize( Size( mpFontEntry->maFontSelData.mnWidth, mpFontEntry->maFontSelData.mnHeight ) );
aVDev.SetFont( aFont );
aVDev.SetTextAlign( ALIGN_TOP );
// layout the text on the virtual device
CWS-TOOLING: integrate CWS vcl103 2009-07-24 Jens-Heiner Rechtien #i10000#: merge with m53 2009-07-10 Philipp Lohmann merge 2009-07-10 hdu #i103417# ignore non-standard font styles 2009-07-07 Philipp Lohmann #i98789# add: Invalidate on StateChanged( STATE_CHANGE_ENABLE ) 2009-07-07 Philipp Lohmann #i102501# ExportFormFields should be persistent 2009-07-07 Philipp Lohmann merge 2009-07-07 Philipp Lohmann #i103319# there is no platform currently where we should beep on disabled controls 2009-07-02 Philipp Lohmann merge 2009-07-01 Philipp Lohmann #i93100# handle ListBox with no border a little more graceful on MacOSX 2009-07-01 Philipp Lohmann #i101307# don't crash due to unfortunate timing 2009-07-03 thb #i103145# Swapped HINT_DOCK for HINT_TOOLBAR for the presentation fullscreen window; anecdotal evidence suggests it works much better then for wide-spread window managers 2009-06-30 Philipp Lohmann #i103102# evaluate Cmd-Option key combinations 2009-06-29 Philipp Lohmann #i103148# catch exception from missing UCB (thanks thb) 2009-06-29 hdu #i102378# fix PDF-export on PPC (thanks cloph!) 2009-06-25 Philipp Lohmann fix another link problem 2009-06-24 Philipp Lohmann use correct method signature 2009-06-24 Philipp Lohmann fix a warning 2009-06-24 Philipp Lohmann fix a warning 2009-06-24 Philipp Lohmann #i100357# add: GDIMetaFile::GetBoundRect 2009-06-24 Philipp Lohmann merge 2009-06-24 hdu #i100357# extend GetTextBoundRect() to measure justified text too 2009-06-23 Philipp Lohmann #i101108# protect writer from itself, no one could ever use paper of size (0,0) 2009-06-22 Philipp Lohmann merge 2009-06-22 Philipp Lohmann #i92356# treat windows running a popup menu as modal 2009-06-22 hdu #i100000# remove sft.h again (CWS dba32b accidentially reintroduced it) 2009-06-17 Philipp Lohmann merge 2009-06-17 Philipp Lohmann remove warnings (thanks ericb) 2009-06-17 Philipp Lohmann merge 2009-06-17 Philipp Lohmann #i102133# free cursors (thanks cmc) 2009-06-17 Philipp Lohmann #i97293# catch exception 2009-06-17 Philipp Lohmann #i91240# fix images in menus, again 2009-06-15 Philipp Lohmann #i100586# fix a pure virtual method (thanks cmc) 2009-06-15 Philipp Lohmann fix an array delete issue 2009-06-15 Philipp Lohmann #i102228# fix a cleanup issue 2009-06-15 Philipp Lohmann #i97218# solve duplicate accelerator 2009-06-12 hdu #i102219# avoid void*->oslGenericFunction cast for MingW (thanks tono!)
2009-07-24 15:45:35 +00:00
pSalLayout = aVDev.ImplLayout( rStr, nIndex, nLen, aPoint, nLayoutWidth, pDXAry );
if( !pSalLayout )
return false;
// make the bitmap big enough
// TODO: use factors when it would get too big
long nWidth = pSalLayout->GetTextWidth();
long nHeight = mpFontEntry->mnLineHeight + mnEmphasisAscent + mnEmphasisDescent;
Point aOffset( nWidth/2, 8 );
Size aOutSize( nWidth + 2*aOffset.X(), nHeight + 2*aOffset.Y() );
if( !nWidth || !aVDev.SetOutputSizePixel( aOutSize ) )
return false;
// draw text in black
pSalLayout->DrawBase() = aOffset;
aVDev.SetTextColor( Color( COL_BLACK ) );
aVDev.SetTextFillColor();
aVDev.ImplInitTextColor();
aVDev.ImplDrawText( *pSalLayout );
pSalLayout->Release();
2002-04-23 06:40:42 +00:00
// find extents using the bitmap
Bitmap aBmp = aVDev.GetBitmap( Point(), aOutSize );
BitmapReadAccess* pAcc = aBmp.AcquireReadAccess();
if( !pAcc )
return FALSE;
const BitmapColor aBlack( pAcc->GetBestMatchingColor( Color( COL_BLACK ) ) );
const long nW = pAcc->Width();
const long nH = pAcc->Height();
long nLeft = 0;
long nRight = 0;
2002-04-23 06:40:42 +00:00
// find top left point
long nTop = 0;
for(; nTop < nH; ++nTop )
{
for( nLeft = 0; nLeft < nW; ++nLeft )
if( pAcc->GetPixel( nTop, nLeft ) == aBlack )
break;
if( nLeft < nW )
break;
}
2002-04-23 06:40:42 +00:00
// find bottom right point
long nBottom = nH;
while( --nBottom >= nTop )
{
for( nRight = nW; --nRight >= 0; )
if( pAcc->GetPixel( nBottom, nRight ) == aBlack )
break;
if( nRight >= 0 )
break;
}
if( nRight < nLeft )
{
long nX = nRight;
nRight = nLeft;
nLeft = nX;
}
2002-04-23 06:40:42 +00:00
for( long nY = nTop; nY <= nBottom; ++nY )
{
// find leftmost point
long nX;
for( nX = 0; nX < nLeft; ++nX )
if( pAcc->GetPixel( nY, nX ) == aBlack )
break;
nLeft = nX;
2002-04-23 06:40:42 +00:00
// find rightmost point
for( nX = nW; --nX > nRight; )
if( pAcc->GetPixel( nY, nX ) == aBlack )
break;
nRight = nX;
}
2000-09-18 16:07:07 +00:00
aBmp.ReleaseAccess( pAcc );
2000-09-18 16:07:07 +00:00
if( nTop <= nBottom )
{
Size aSize( nRight - nLeft + 1, nBottom - nTop + 1 );
Point aTopLeft( nLeft, nTop );
aTopLeft -= aOffset;
// adjust to text alignment
aTopLeft.Y()+= mnTextOffY - (mpFontEntry->maMetric.mnAscent + mnEmphasisAscent);
// convert to logical coordinates
aSize = PixelToLogic( aSize );
aTopLeft.X() = ImplDevicePixelToLogicWidth( aTopLeft.X() );
aTopLeft.Y() = ImplDevicePixelToLogicHeight( aTopLeft.Y() );
rRect = Rectangle( aTopLeft, aSize );
return TRUE;
2000-09-18 16:07:07 +00:00
}
return FALSE;
2002-04-23 06:40:42 +00:00
}
2002-04-23 06:40:42 +00:00
// -----------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
BOOL OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
const String& rStr, xub_StrLen nBase, xub_StrLen nIndex, xub_StrLen nLen,
CWS-TOOLING: integrate CWS vcl103 2009-07-24 Jens-Heiner Rechtien #i10000#: merge with m53 2009-07-10 Philipp Lohmann merge 2009-07-10 hdu #i103417# ignore non-standard font styles 2009-07-07 Philipp Lohmann #i98789# add: Invalidate on StateChanged( STATE_CHANGE_ENABLE ) 2009-07-07 Philipp Lohmann #i102501# ExportFormFields should be persistent 2009-07-07 Philipp Lohmann merge 2009-07-07 Philipp Lohmann #i103319# there is no platform currently where we should beep on disabled controls 2009-07-02 Philipp Lohmann merge 2009-07-01 Philipp Lohmann #i93100# handle ListBox with no border a little more graceful on MacOSX 2009-07-01 Philipp Lohmann #i101307# don't crash due to unfortunate timing 2009-07-03 thb #i103145# Swapped HINT_DOCK for HINT_TOOLBAR for the presentation fullscreen window; anecdotal evidence suggests it works much better then for wide-spread window managers 2009-06-30 Philipp Lohmann #i103102# evaluate Cmd-Option key combinations 2009-06-29 Philipp Lohmann #i103148# catch exception from missing UCB (thanks thb) 2009-06-29 hdu #i102378# fix PDF-export on PPC (thanks cloph!) 2009-06-25 Philipp Lohmann fix another link problem 2009-06-24 Philipp Lohmann use correct method signature 2009-06-24 Philipp Lohmann fix a warning 2009-06-24 Philipp Lohmann fix a warning 2009-06-24 Philipp Lohmann #i100357# add: GDIMetaFile::GetBoundRect 2009-06-24 Philipp Lohmann merge 2009-06-24 hdu #i100357# extend GetTextBoundRect() to measure justified text too 2009-06-23 Philipp Lohmann #i101108# protect writer from itself, no one could ever use paper of size (0,0) 2009-06-22 Philipp Lohmann merge 2009-06-22 Philipp Lohmann #i92356# treat windows running a popup menu as modal 2009-06-22 hdu #i100000# remove sft.h again (CWS dba32b accidentially reintroduced it) 2009-06-17 Philipp Lohmann merge 2009-06-17 Philipp Lohmann remove warnings (thanks ericb) 2009-06-17 Philipp Lohmann merge 2009-06-17 Philipp Lohmann #i102133# free cursors (thanks cmc) 2009-06-17 Philipp Lohmann #i97293# catch exception 2009-06-17 Philipp Lohmann #i91240# fix images in menus, again 2009-06-15 Philipp Lohmann #i100586# fix a pure virtual method (thanks cmc) 2009-06-15 Philipp Lohmann fix an array delete issue 2009-06-15 Philipp Lohmann #i102228# fix a cleanup issue 2009-06-15 Philipp Lohmann #i97218# solve duplicate accelerator 2009-06-12 hdu #i102219# avoid void*->oslGenericFunction cast for MingW (thanks tono!)
2009-07-24 15:45:35 +00:00
BOOL bOptimize, ULONG nTWidth, const sal_Int32* pDXArray ) const
2002-08-15 10:17:51 +00:00
{
// the fonts need to be initialized
if( mbNewFont )
ImplNewFont();
if( mbInitFont )
ImplInitFont();
if( !mpFontEntry )
return FALSE;
2002-08-15 10:17:51 +00:00
BOOL bRet = FALSE;
rVector.clear();
if( nLen == STRING_LEN )
nLen = rStr.Len() - nIndex;
rVector.reserve( nLen );
2002-04-23 06:40:42 +00:00
// we want to get the Rectangle in logical units, so to
2002-04-23 06:40:42 +00:00
// avoid rounding errors we just size the font in logical units
BOOL bOldMap = mbMap;
if( bOldMap )
{
const_cast<OutputDevice&>(*this).mbMap = FALSE;
const_cast<OutputDevice&>(*this).mbNewFont = TRUE;
}
SalLayout* pSalLayout = NULL;
// calculate offset when nBase!=nIndex
long nXOffset = 0;
if( nBase != nIndex )
{
xub_StrLen nStart = Min( nBase, nIndex );
xub_StrLen nOfsLen = Max( nBase, nIndex ) - nStart;
pSalLayout = ImplLayout( rStr, nStart, nOfsLen, Point(0,0), nTWidth, pDXArray );
if( pSalLayout )
{
nXOffset = pSalLayout->GetTextWidth();
pSalLayout->Release();
// TODO: fix offset calculation for Bidi case
if( nBase > nIndex)
nXOffset = -nXOffset;
}
}
2002-04-23 06:40:42 +00:00
pSalLayout = ImplLayout( rStr, nIndex, nLen, Point(0,0), nTWidth, pDXArray );
2002-04-23 06:40:42 +00:00
if( pSalLayout )
2000-09-18 16:07:07 +00:00
{
2002-08-15 10:17:51 +00:00
bRet = pSalLayout->GetOutline( *mpGraphics, rVector );
if( bRet )
2002-04-23 06:40:42 +00:00
{
// transform polygon to pixel units
::basegfx::B2DHomMatrix aMatrix;
int nWidthFactor = pSalLayout->GetUnitsPerPixel();
if( nXOffset | mnTextOffX | mnTextOffY )
{
Point aRotatedOfs( mnTextOffX*nWidthFactor, mnTextOffY*nWidthFactor );
aRotatedOfs -= pSalLayout->GetDrawPosition( Point( nXOffset, 0 ) );
aMatrix.translate( aRotatedOfs.X(), aRotatedOfs.Y() );
}
if( nWidthFactor > 1 )
{
double fFactor = 1.0 / nWidthFactor;
aMatrix.scale( fFactor, fFactor );
}
if( !aMatrix.isIdentity() )
{
::basegfx::B2DPolyPolygonVector::iterator aIt = rVector.begin();
for(; aIt != rVector.end(); ++aIt )
(*aIt).transform( aMatrix );
}
2000-09-18 16:07:07 +00:00
}
pSalLayout->Release();
2000-09-18 16:07:07 +00:00
}
if( bOldMap )
2001-02-23 15:13:58 +00:00
{
// restore original font size and map mode
const_cast<OutputDevice&>(*this).mbMap = bOldMap;
const_cast<OutputDevice&>(*this).mbNewFont = TRUE;
}
2001-02-23 15:13:58 +00:00
if( bRet || (OUTDEV_PRINTER == meOutDevType) || !mpFontEntry )
return bRet;
2002-04-23 06:40:42 +00:00
// fall back to bitmap conversion ------------------------------------------
2002-04-23 06:40:42 +00:00
2002-08-15 10:17:51 +00:00
// Here, we can savely assume that the mapping between characters and glyphs
// is one-to-one. This is most probably valid for the old bitmap fonts.
2001-02-23 15:13:58 +00:00
// fall back to bitmap method to get the bounding rectangle,
// so we need a monochrome virtual device with matching font
pSalLayout = ImplLayout( rStr, nIndex, nLen, Point(0,0), nTWidth, pDXArray );
2002-08-15 10:17:51 +00:00
if (pSalLayout == 0)
return false;
long nOrgWidth = pSalLayout->GetTextWidth();
2002-08-15 10:17:51 +00:00
long nOrgHeight = mpFontEntry->mnLineHeight + mnEmphasisAscent
+ mnEmphasisDescent;
pSalLayout->Release();
2001-02-23 15:13:58 +00:00
VirtualDevice aVDev(1);
2002-08-15 10:17:51 +00:00
Font aFont(GetFont());
aFont.SetShadow(false);
aFont.SetOutline(false);
aFont.SetRelief(RELIEF_NONE);
aFont.SetOrientation(0);
if( bOptimize )
{
aFont.SetSize( Size( 0, GLYPH_FONT_HEIGHT ) );
aVDev.SetMapMode( MAP_PIXEL );
}
aVDev.SetFont( aFont );
aVDev.SetTextAlign( ALIGN_TOP );
aVDev.SetTextColor( Color(COL_BLACK) );
aVDev.SetTextFillColor();
2002-08-15 10:17:51 +00:00
pSalLayout = aVDev.ImplLayout( rStr, nIndex, nLen, Point(0,0), nTWidth, pDXArray );
2002-08-15 10:17:51 +00:00
if (pSalLayout == 0)
return false;
long nWidth = pSalLayout->GetTextWidth();
long nHeight = ((OutputDevice*)&aVDev)->mpFontEntry->mnLineHeight + ((OutputDevice*)&aVDev)->mnEmphasisAscent
+ ((OutputDevice*)&aVDev)->mnEmphasisDescent;
pSalLayout->Release();
2001-02-23 15:13:58 +00:00
if( !nWidth || !nHeight )
return TRUE;
double fScaleX = static_cast< double >(nOrgWidth) / nWidth;
double fScaleY = static_cast< double >(nOrgHeight) / nHeight;
// calculate offset when nBase!=nIndex
// TODO: fix offset calculation for Bidi case
nXOffset = 0;
if( nBase != nIndex )
{
xub_StrLen nStart = ((nBase < nIndex) ? nBase : nIndex);
xub_StrLen nLength = ((nBase > nIndex) ? nBase : nIndex) - nStart;
pSalLayout = aVDev.ImplLayout( rStr, nStart, nLength, Point(0,0), nTWidth, pDXArray );
if( pSalLayout )
{
nXOffset = pSalLayout->GetTextWidth();
pSalLayout->Release();
if( nBase > nIndex)
nXOffset = -nXOffset;
}
}
bRet = true;
bool bRTL = false;
String aStr( rStr ); // prepare for e.g. localized digits
ImplLayoutArgs aLayoutArgs = ImplPrepareLayoutArgs( aStr, nIndex, nLen, 0, NULL );
for( int nCharPos = -1; aLayoutArgs.GetNextPos( &nCharPos, &bRTL);)
{
bool bSuccess = false;
// draw character into virtual device
pSalLayout = aVDev.ImplLayout( rStr, static_cast< xub_StrLen >(nCharPos), 1, Point(0,0), nTWidth, pDXArray );
2002-08-15 10:17:51 +00:00
if (pSalLayout == 0)
return false;
long nCharWidth = pSalLayout->GetTextWidth();
2001-02-23 15:13:58 +00:00
2002-08-15 10:17:51 +00:00
Point aOffset(nCharWidth / 2, 8);
Size aSize(nCharWidth + 2 * aOffset.X(), nHeight + 2 * aOffset.Y());
bSuccess = (bool)aVDev.SetOutputSizePixel(aSize);
if( bSuccess )
{
// draw glyph into virtual device
aVDev.Erase();
pSalLayout->DrawBase() += aOffset;
pSalLayout->DrawBase() += Point( ((OutputDevice*)&aVDev)->mnTextOffX, ((OutputDevice*)&aVDev)->mnTextOffY );
pSalLayout->DrawText( *((OutputDevice*)&aVDev)->mpGraphics );
pSalLayout->Release();
2002-04-23 06:40:42 +00:00
// convert character image into outline
Bitmap aBmp( aVDev.GetBitmap(Point(0, 0), aSize));
PolyPolygon aPolyPoly;
bool bVectorized = aBmp.Vectorize(aPolyPoly, BMP_VECTORIZE_OUTER | BMP_VECTORIZE_REDUCE_EDGES);
if( !bVectorized )
bSuccess = false;
else
2002-08-15 10:17:51 +00:00
{
// convert units to logical width
for (USHORT j = 0; j < aPolyPoly.Count(); ++j)
{
Polygon& rPoly = aPolyPoly[j];
for (USHORT k = 0; k < rPoly.GetSize(); ++k)
{
Point& rPt = rPoly[k];
rPt -= aOffset;
int nPixelX = rPt.X() - ((OutputDevice&)aVDev).mnTextOffX + nXOffset;
int nPixelY = rPt.Y() - ((OutputDevice&)aVDev).mnTextOffY;
rPt.X() = ImplDevicePixelToLogicWidth( nPixelX );
rPt.Y() = ImplDevicePixelToLogicHeight( nPixelY );
}
}
// ignore "empty" glyphs:
if( aPolyPoly.Count() > 0 )
{
// convert to B2DPolyPolygon
// TODO: get rid of intermediate tool's PolyPolygon
::basegfx::B2DPolyPolygon aB2DPolyPoly = aPolyPoly.getB2DPolyPolygon();
::basegfx::B2DHomMatrix aMatrix;
aMatrix.scale( fScaleX, fScaleY );
int nAngle = GetFont().GetOrientation();
if( nAngle )
aMatrix.rotate( nAngle * F_PI1800 );
aB2DPolyPoly.transform( aMatrix );
rVector.push_back( aB2DPolyPoly );
}
2002-08-15 10:17:51 +00:00
}
}
2000-09-18 16:07:07 +00:00
nXOffset += nCharWidth;
bRet = bRet && bSuccess;
2002-08-15 10:17:51 +00:00
}
return bRet;
}
// -----------------------------------------------------------------------
BOOL OutputDevice::GetTextOutlines( PolyPolyVector& rResultVector,
const String& rStr, xub_StrLen nBase, xub_StrLen nIndex,
CWS-TOOLING: integrate CWS vcl103 2009-07-24 Jens-Heiner Rechtien #i10000#: merge with m53 2009-07-10 Philipp Lohmann merge 2009-07-10 hdu #i103417# ignore non-standard font styles 2009-07-07 Philipp Lohmann #i98789# add: Invalidate on StateChanged( STATE_CHANGE_ENABLE ) 2009-07-07 Philipp Lohmann #i102501# ExportFormFields should be persistent 2009-07-07 Philipp Lohmann merge 2009-07-07 Philipp Lohmann #i103319# there is no platform currently where we should beep on disabled controls 2009-07-02 Philipp Lohmann merge 2009-07-01 Philipp Lohmann #i93100# handle ListBox with no border a little more graceful on MacOSX 2009-07-01 Philipp Lohmann #i101307# don't crash due to unfortunate timing 2009-07-03 thb #i103145# Swapped HINT_DOCK for HINT_TOOLBAR for the presentation fullscreen window; anecdotal evidence suggests it works much better then for wide-spread window managers 2009-06-30 Philipp Lohmann #i103102# evaluate Cmd-Option key combinations 2009-06-29 Philipp Lohmann #i103148# catch exception from missing UCB (thanks thb) 2009-06-29 hdu #i102378# fix PDF-export on PPC (thanks cloph!) 2009-06-25 Philipp Lohmann fix another link problem 2009-06-24 Philipp Lohmann use correct method signature 2009-06-24 Philipp Lohmann fix a warning 2009-06-24 Philipp Lohmann fix a warning 2009-06-24 Philipp Lohmann #i100357# add: GDIMetaFile::GetBoundRect 2009-06-24 Philipp Lohmann merge 2009-06-24 hdu #i100357# extend GetTextBoundRect() to measure justified text too 2009-06-23 Philipp Lohmann #i101108# protect writer from itself, no one could ever use paper of size (0,0) 2009-06-22 Philipp Lohmann merge 2009-06-22 Philipp Lohmann #i92356# treat windows running a popup menu as modal 2009-06-22 hdu #i100000# remove sft.h again (CWS dba32b accidentially reintroduced it) 2009-06-17 Philipp Lohmann merge 2009-06-17 Philipp Lohmann remove warnings (thanks ericb) 2009-06-17 Philipp Lohmann merge 2009-06-17 Philipp Lohmann #i102133# free cursors (thanks cmc) 2009-06-17 Philipp Lohmann #i97293# catch exception 2009-06-17 Philipp Lohmann #i91240# fix images in menus, again 2009-06-15 Philipp Lohmann #i100586# fix a pure virtual method (thanks cmc) 2009-06-15 Philipp Lohmann fix an array delete issue 2009-06-15 Philipp Lohmann #i102228# fix a cleanup issue 2009-06-15 Philipp Lohmann #i97218# solve duplicate accelerator 2009-06-12 hdu #i102219# avoid void*->oslGenericFunction cast for MingW (thanks tono!)
2009-07-24 15:45:35 +00:00
xub_StrLen nLen, BOOL bOptimize, ULONG nTWidth, const sal_Int32* pDXArray ) const
{
rResultVector.clear();
// get the basegfx polypolygon vector
::basegfx::B2DPolyPolygonVector aB2DPolyPolyVector;
if( !GetTextOutlines( aB2DPolyPolyVector, rStr, nBase, nIndex, nLen,
bOptimize, nTWidth, pDXArray ) )
return FALSE;
// convert to a tool polypolygon vector
rResultVector.reserve( aB2DPolyPolyVector.size() );
::basegfx::B2DPolyPolygonVector::const_iterator aIt = aB2DPolyPolyVector.begin();
for(; aIt != aB2DPolyPolyVector.end(); ++aIt )
rResultVector.push_back(PolyPolygon(*aIt)); // #i76339#
return TRUE;
}
// -----------------------------------------------------------------------
BOOL OutputDevice::GetTextOutline( PolyPolygon& rPolyPoly,
const String& rStr, xub_StrLen nBase, xub_StrLen nIndex, xub_StrLen nLen,
CWS-TOOLING: integrate CWS vcl103 2009-07-24 Jens-Heiner Rechtien #i10000#: merge with m53 2009-07-10 Philipp Lohmann merge 2009-07-10 hdu #i103417# ignore non-standard font styles 2009-07-07 Philipp Lohmann #i98789# add: Invalidate on StateChanged( STATE_CHANGE_ENABLE ) 2009-07-07 Philipp Lohmann #i102501# ExportFormFields should be persistent 2009-07-07 Philipp Lohmann merge 2009-07-07 Philipp Lohmann #i103319# there is no platform currently where we should beep on disabled controls 2009-07-02 Philipp Lohmann merge 2009-07-01 Philipp Lohmann #i93100# handle ListBox with no border a little more graceful on MacOSX 2009-07-01 Philipp Lohmann #i101307# don't crash due to unfortunate timing 2009-07-03 thb #i103145# Swapped HINT_DOCK for HINT_TOOLBAR for the presentation fullscreen window; anecdotal evidence suggests it works much better then for wide-spread window managers 2009-06-30 Philipp Lohmann #i103102# evaluate Cmd-Option key combinations 2009-06-29 Philipp Lohmann #i103148# catch exception from missing UCB (thanks thb) 2009-06-29 hdu #i102378# fix PDF-export on PPC (thanks cloph!) 2009-06-25 Philipp Lohmann fix another link problem 2009-06-24 Philipp Lohmann use correct method signature 2009-06-24 Philipp Lohmann fix a warning 2009-06-24 Philipp Lohmann fix a warning 2009-06-24 Philipp Lohmann #i100357# add: GDIMetaFile::GetBoundRect 2009-06-24 Philipp Lohmann merge 2009-06-24 hdu #i100357# extend GetTextBoundRect() to measure justified text too 2009-06-23 Philipp Lohmann #i101108# protect writer from itself, no one could ever use paper of size (0,0) 2009-06-22 Philipp Lohmann merge 2009-06-22 Philipp Lohmann #i92356# treat windows running a popup menu as modal 2009-06-22 hdu #i100000# remove sft.h again (CWS dba32b accidentially reintroduced it) 2009-06-17 Philipp Lohmann merge 2009-06-17 Philipp Lohmann remove warnings (thanks ericb) 2009-06-17 Philipp Lohmann merge 2009-06-17 Philipp Lohmann #i102133# free cursors (thanks cmc) 2009-06-17 Philipp Lohmann #i97293# catch exception 2009-06-17 Philipp Lohmann #i91240# fix images in menus, again 2009-06-15 Philipp Lohmann #i100586# fix a pure virtual method (thanks cmc) 2009-06-15 Philipp Lohmann fix an array delete issue 2009-06-15 Philipp Lohmann #i102228# fix a cleanup issue 2009-06-15 Philipp Lohmann #i97218# solve duplicate accelerator 2009-06-12 hdu #i102219# avoid void*->oslGenericFunction cast for MingW (thanks tono!)
2009-07-24 15:45:35 +00:00
BOOL bOptimize, ULONG nTWidth, const sal_Int32* pDXArray ) const
{
rPolyPoly.Clear();
// get the basegfx polypolygon vector
::basegfx::B2DPolyPolygonVector aB2DPolyPolyVector;
if( !GetTextOutlines( aB2DPolyPolyVector, rStr, nBase, nIndex, nLen,
bOptimize, nTWidth, pDXArray ) )
return FALSE;
// convert and merge into a tool polypolygon
::basegfx::B2DPolyPolygonVector::const_iterator aIt = aB2DPolyPolyVector.begin();
for(; aIt != aB2DPolyPolyVector.end(); ++aIt )
for( unsigned int i = 0; i < aIt->count(); ++i )
rPolyPoly.Insert(Polygon((*aIt).getB2DPolygon( i ))); // #i76339#
return TRUE;
}
// -----------------------------------------------------------------------
BOOL OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
rFontCharMap.Reset();
// we need a graphics
if( !mpGraphics && !ImplGetGraphics() )
2002-04-23 06:40:42 +00:00
return FALSE;
if( mbNewFont )
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplNewFont();
if( mbInitFont )
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
ImplInitFont();
if( !mpFontEntry )
return FALSE;
#ifdef ENABLE_IFC_CACHE // a little font charmap cache helps considerably
static const int NMAXITEMS = 16;
static int nUsedItems = 0, nCurItem = 0;
struct CharMapCacheItem { const ImplFontData* mpFontData; FontCharMap maCharMap; };
static CharMapCacheItem aCache[ NMAXITEMS ];
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
const ImplFontData* pFontData = mpFontEntry->maFontSelData.mpFontData;
int i;
for( i = nUsedItems; --i >= 0; )
if( pFontData == aCache[i].mpFontData )
break;
if( i >= 0 ) // found in cache
{
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
rFontCharMap.Reset( aCache[i].maCharMap.mpImpl );
}
else // need to cache
#endif // ENABLE_IFC_CACHE
{
const ImplFontCharMap* pNewMap = mpGraphics->GetImplFontCharMap();
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
rFontCharMap.Reset( pNewMap );
#ifdef ENABLE_IFC_CACHE
// manage cache round-robin and insert data
CharMapCacheItem& rItem = aCache[ nCurItem ];
rItem.mpFontData = pFontData;
INTEGRATION: CWS fontlists02 (1.167.12); FILE MERGED 2004/06/24 06:28:05 hdu 1.167.12.22: #21821# use CTL processing for diacritical marks 2004/06/23 10:56:36 hdu 1.167.12.21: #i26679# fix glyphfallback for fontlists02 2004/06/15 12:13:42 hdu 1.167.12.20: #i26679# better handling of duplicate font faces, invalidate font cache when adding fonts 2004/06/10 12:13:33 hdu 1.167.12.19: RESYNC: (1.170-1.171); FILE MERGED 2004/06/10 08:42:29 hdu 1.167.12.18: #i30086# set symbol flag for *Symbol fonts correctly 2004/06/09 12:33:39 hdu 1.167.12.17: #i30086# symbol code aliasing while recoding symbols to another font 2004/06/08 14:34:12 hdu 1.167.12.16: #i29650# do not calculate ghostline color from COL_TRANSPARENT 2004/06/07 16:11:10 hdu 1.167.12.15: #i26679# fix GetNextFontToken() for empty token string 2004/06/03 14:58:46 hdu 1.167.12.14: #i26679# move encapsulation of font family and font attributes 2004/06/03 11:28:10 hdu 1.167.12.13: #i26679# use extendable ImplFontData to remove GlyphCache specific handling from OutputDevice 2004/06/02 12:42:19 hdu 1.167.12.12: #i26679# a little more cleanup 2004/05/28 16:10:02 hdu 1.167.12.11: #i26679# just moving source code segments after refactoring class responsibilities 2004/05/28 15:57:57 hdu 1.167.12.10: #i26679# better encapsulation of ImplFontListData 2004/05/28 15:03:25 hdu 1.167.12.9: #i26679# better encapsulation of ImplFontData 2004/05/28 12:06:40 hdu 1.167.12.8: #i26679# add cache of recently used font names to improve the ratio of direct hits in the font instance cache 2004/05/27 15:39:13 hdu 1.167.12.7: #i26679# fix fontcache management when multiple names map to the same entry 2004/05/26 08:44:46 hdu 1.167.12.6: #i26679# fix reference counting for mpFirstFontEntry 2004/05/25 13:18:09 hdu 1.167.12.5: #i26679# complete conversion to ImplFontEntry hash_map instead of linked list 2004/05/19 16:20:22 hdu 1.167.12.4: #i26679# use ImplFontCharMap instead of messing with raw arrays 2004/05/12 13:49:08 hdu 1.167.12.3: #i26679# treat make font alias names as first class font names 2004/03/25 17:51:01 hdu 1.167.12.2: RESYNC: (1.167-1.170); FILE MERGED 2004/03/25 16:38:56 hdu 1.167.12.1: Font Management Refactoring, first step: Keep the externally visible original algorithms intact Split up the ImplFontCache::Get(..) monster method Make implicit relationships between font management classes explicit Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching Get rid of linear searches in mainstream code, use efficient STL containers Get rid of some obsolete data types BOOL->bool, USHORT->int, etc. Improve infrastructure for unicode surrogate processing
2004-07-13 08:31:22 +00:00
rItem.maCharMap.Reset( pNewMap );
if( ++nCurItem >= NMAXITEMS )
nCurItem = 0;
if( ++nUsedItems >= NMAXITEMS )
nUsedItems = NMAXITEMS;
#endif // ENABLE_IFC_CACHE
}
if( rFontCharMap.IsDefaultMap() )
return FALSE;
return TRUE;
}
// -----------------------------------------------------------------------
xub_StrLen OutputDevice::HasGlyphs( const Font& rTempFont, const String& rStr,
xub_StrLen nIndex, xub_StrLen nLen ) const
{
if( nIndex >= rStr.Len() )
return nIndex;
xub_StrLen nEnd = nIndex + nLen;
if( (ULONG)nIndex+nLen > rStr.Len() )
nEnd = rStr.Len();
DBG_ASSERT( nIndex < nEnd, "StartPos >= EndPos?" );
DBG_ASSERT( nEnd <= rStr.Len(), "String too short" );
// to get the map temporarily set font
const Font aOrigFont = GetFont();
const_cast<OutputDevice&>(*this).SetFont( rTempFont );
FontCharMap aFontCharMap;
BOOL bRet = GetFontCharMap( aFontCharMap );
const_cast<OutputDevice&>(*this).SetFont( aOrigFont );
// if fontmap is unknown assume it doesn't have the glyphs
if( bRet == FALSE )
return nIndex;
const sal_Unicode* pStr = rStr.GetBuffer();
for( pStr += nIndex; nIndex < nEnd; ++pStr, ++nIndex )
if( ! aFontCharMap.HasChar( *pStr ) )
return nIndex;
return STRING_LEN;
}
// -----------------------------------------------------------------------