View | Details | Raw Unified | Return to issue 19591
Collapse All | Expand All

(-)oo_1.1rc4_src/vcl/source/gdi/outdev3.cxx.vcl-font-subst (-10 / +13 lines)
Lines 902-909 void OutputDevice::GetFontSubstitute( US Link Here
902
902
903
// -----------------------------------------------------------------------
903
// -----------------------------------------------------------------------
904
904
905
static inline bool ImplFontSubstituteMatch( USHORT nFlags, bool bPrinterDevice )
906
{
907
	const bool bOnScreenOnly = nFlags & FONT_SUBSTITUTE_SCREENONLY;
908
	const bool bAlways = nFlags & FONT_SUBSTITUTE_ALWAYS;
909
	return (bOnScreenOnly && !bPrinterDevice) || (bAlways && !bOnScreenOnly);
910
}
911
905
static BOOL ImplFontSubstitute( XubString& rFontName,
912
static BOOL ImplFontSubstitute( XubString& rFontName,
906
                                USHORT nFlags1, USHORT nFlags2, ImplFontSubstEntry* pDevSpecific )
913
                                bool bPrinterDevice, ImplFontSubstEntry* pDevSpecific )
907
{
914
{
908
#ifdef DBG_UTIL
915
#ifdef DBG_UTIL
909
    String aTempName = rFontName;
916
    String aTempName = rFontName;
Lines 916-922 static BOOL ImplFontSubstitute( XubStrin Link Here
916
    ImplFontSubstEntry* pEntry = pSVData->maGDIData.mpFirstFontSubst;
923
    ImplFontSubstEntry* pEntry = pSVData->maGDIData.mpFirstFontSubst;
917
    while ( pEntry )
924
    while ( pEntry )
918
    {
925
    {
919
        if ( ((pEntry->mnFlags & nFlags1) == nFlags2) &&
926
        if ( ImplFontSubstituteMatch(pEntry->mnFlags, bPrinterDevice) &&
920
             (pEntry->maSearchName == rFontName) )
927
             (pEntry->maSearchName == rFontName) )
921
        {
928
        {
922
            rFontName = pEntry->maSearchReplaceName;
929
            rFontName = pEntry->maSearchReplaceName;
Lines 930-936 static BOOL ImplFontSubstitute( XubStrin Link Here
930
        pEntry = pDevSpecific;
937
        pEntry = pDevSpecific;
931
        while ( pEntry )
938
        while ( pEntry )
932
        {
939
        {
933
            if ( ((pEntry->mnFlags & nFlags1) == nFlags2) &&
940
            if ( ImplFontSubstituteMatch(pEntry->mnFlags, bPrinterDevice) &&
934
                 (pEntry->maSearchName == rFontName) )
941
                 (pEntry->maSearchName == rFontName) )
935
            {
942
            {
936
                rFontName = pEntry->maSearchReplaceName;
943
                rFontName = pEntry->maSearchReplaceName;
Lines 1798-1813 ImplFontEntry* ImplFontCache::Get( ImplD Link Here
1798
1805
1799
    ImplDevFontListData*    pFoundData;
1806
    ImplDevFontListData*    pFoundData;
1800
    String                  aSearchName;
1807
    String                  aSearchName;
1801
    USHORT                  nSubstFlags1 = FONT_SUBSTITUTE_ALWAYS;
1802
    USHORT                  nSubstFlags2 = FONT_SUBSTITUTE_ALWAYS;
1803
    xub_StrLen              nFirstNameIndex = 0;
1808
    xub_StrLen              nFirstNameIndex = 0;
1804
    xub_StrLen              nIndex = 0;
1809
    xub_StrLen              nIndex = 0;
1805
    int                     nToken = 0;
1810
    int                     nToken = 0;
1806
    ULONG                   i;
1811
    ULONG                   i;
1807
1812
1808
    if ( mbPrinter )
1809
        nSubstFlags1 |= FONT_SUBSTITUTE_SCREENONLY;
1810
1811
    // Test if one Font in the name list is available
1813
    // Test if one Font in the name list is available
1812
    do
1814
    do
1813
    {
1815
    {
Lines 1815-1821 ImplFontEntry* ImplFontCache::Get( ImplD Link Here
1815
        String aToken = GetFontToken( aName, 0, nIndex );
1817
        String aToken = GetFontToken( aName, 0, nIndex );
1816
        aSearchName = aToken;
1818
        aSearchName = aToken;
1817
        ImplGetEnglishSearchFontName( aSearchName );
1819
        ImplGetEnglishSearchFontName( aSearchName );
1818
        ImplFontSubstitute( aSearchName, nSubstFlags1, nSubstFlags2, pDevSpecific );
1820
        ImplFontSubstitute( aSearchName, mbPrinter, pDevSpecific );
1819
        pFoundData = pFontList->ImplFind( aSearchName );
1821
        pFoundData = pFontList->ImplFind( aSearchName );
1820
        if( pFoundData )
1822
        if( pFoundData )
1821
        {
1823
        {
Lines 1825-1830 ImplFontEntry* ImplFontCache::Get( ImplD Link Here
1825
    }
1827
    }
1826
    while ( nIndex != STRING_NOTFOUND );
1828
    while ( nIndex != STRING_NOTFOUND );
1827
1829
1830
#if 0
1828
    // Danach versuchen wir es nocheinmal unter Beruecksichtigung
1831
    // Danach versuchen wir es nocheinmal unter Beruecksichtigung
1829
    // der gloablen Fontersetzungstabelle, wobei wir jetzt auch
1832
    // der gloablen Fontersetzungstabelle, wobei wir jetzt auch
1830
    // die Fonts nehmen, die ersetzt werden sollen, wenn sie
1833
    // die Fonts nehmen, die ersetzt werden sollen, wenn sie
Lines 1850-1855 ImplFontEntry* ImplFontCache::Get( ImplD Link Here
1850
        }
1853
        }
1851
        while ( nIndex != STRING_NOTFOUND );
1854
        while ( nIndex != STRING_NOTFOUND );
1852
    }
1855
    }
1856
#endif
1853
1857
1854
    ULONG nFontCount = pFontList->Count();
1858
    ULONG nFontCount = pFontList->Count();
1855
    if ( !pFoundData && nFontCount )
1859
    if ( !pFoundData && nFontCount )
Lines 2640-2646 ImplFontEntry* ImplFontCache::GetFallbac Link Here
2640
        {
2644
        {
2641
            String aTokenName = GetFontToken( aNameList, 0, nTokenPos );
2645
            String aTokenName = GetFontToken( aNameList, 0, nTokenPos );
2642
            ImplGetEnglishSearchFontName( aTokenName );
2646
            ImplGetEnglishSearchFontName( aTokenName );
2643
            //ImplFontSubstitute( aSearchName, nSubstFlags1, nSubstFlags2 );
2644
            ImplDevFontListData* pFoundData = pFontList->ImplFind( aTokenName );
2647
            ImplDevFontListData* pFoundData = pFontList->ImplFind( aTokenName );
2645
            // TODO: check FontCharset and reject if it is already covered
2648
            // TODO: check FontCharset and reject if it is already covered
2646
            if( pFoundData && (pFoundData->mpFirst->meType == TYPE_SCALABLE) )
2649
            if( pFoundData && (pFoundData->mpFirst->meType == TYPE_SCALABLE) )

Return to issue 19591