winlayout.cxx (5f27b83c) winlayout.cxx (2a6d8217)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 2923 unchanged lines hidden (view full) ---

2932 mrWinFontEntry.InitKashidaHandling(mhDC);
2933 }
2934 maImpl.AdjustLayout(rArgs);
2935}
2936
2937void GraphiteWinLayout::DrawText(SalGraphics &sal_graphics) const
2938{
2939 HFONT hOrigFont = DisableFontScaling();
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 2923 unchanged lines hidden (view full) ---

2932 mrWinFontEntry.InitKashidaHandling(mhDC);
2933 }
2934 maImpl.AdjustLayout(rArgs);
2935}
2936
2937void GraphiteWinLayout::DrawText(SalGraphics &sal_graphics) const
2938{
2939 HFONT hOrigFont = DisableFontScaling();
2940 HDC aHDC = static_cast<WinSalGraphics&>(sal_graphics).mhDC;
2940 const HDC aHDC = static_cast<WinSalGraphics&>(sal_graphics).getHDC();
2941 maImpl.DrawBase() = WinLayout::maDrawBase;
2942 maImpl.DrawOffset() = WinLayout::maDrawOffset;
2943 const int MAX_GLYPHS = 2;
2944 sal_GlyphId glyphIntStr[MAX_GLYPHS];
2945 WORD glyphWStr[MAX_GLYPHS];
2946 int glyphIndex = 0;
2947 Point aPos(0,0);
2948 int nGlyphs = 0;
2949 do
2950 {
2951 nGlyphs = maImpl.GetNextGlyphs(1, glyphIntStr, aPos, glyphIndex);
2952 if (nGlyphs < 1)
2953 break;
2954 std::copy(glyphIntStr, glyphIntStr + nGlyphs, glyphWStr);
2955 ::ExtTextOutW(aHDC, aPos.X(), aPos.Y(), ETO_GLYPH_INDEX,
2956 NULL, (LPCWSTR)&(glyphWStr), nGlyphs, NULL);
2957 } while (nGlyphs);
2958 if( hOrigFont )
2941 maImpl.DrawBase() = WinLayout::maDrawBase;
2942 maImpl.DrawOffset() = WinLayout::maDrawOffset;
2943 const int MAX_GLYPHS = 2;
2944 sal_GlyphId glyphIntStr[MAX_GLYPHS];
2945 WORD glyphWStr[MAX_GLYPHS];
2946 int glyphIndex = 0;
2947 Point aPos(0,0);
2948 int nGlyphs = 0;
2949 do
2950 {
2951 nGlyphs = maImpl.GetNextGlyphs(1, glyphIntStr, aPos, glyphIndex);
2952 if (nGlyphs < 1)
2953 break;
2954 std::copy(glyphIntStr, glyphIntStr + nGlyphs, glyphWStr);
2955 ::ExtTextOutW(aHDC, aPos.X(), aPos.Y(), ETO_GLYPH_INDEX,
2956 NULL, (LPCWSTR)&(glyphWStr), nGlyphs, NULL);
2957 } while (nGlyphs);
2958 if( hOrigFont )
2959 DeleteFont( SelectFont( mhDC, hOrigFont ) );
2959 DeleteFont( SelectFont( aHDC, hOrigFont ) );
2960}
2961
2962int GraphiteWinLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) const
2963{
2964 mpFont.replaceDC(mhDC);
2965 int nBreak = maImpl.GetTextBreak(nMaxWidth, nCharExtra, nFactor);
2966 mpFont.restoreDC();
2967 return nBreak;

--- 44 unchanged lines hidden (view full) ---

3012 ImplWinFontEntry& rFontInstance = *mpWinFontEntry[ nFallbackLevel ];
3013
3014#if defined( USE_UNISCRIBE )
3015 if( !(rArgs.mnFlags & SAL_LAYOUT_COMPLEX_DISABLED)
3016 && (aUspModule || (bUspEnabled && InitUSP())) ) // CTL layout engine
3017 {
3018#ifdef ENABLE_GRAPHITE
3019 if (rFontFace.SupportsGraphite())
2960}
2961
2962int GraphiteWinLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) const
2963{
2964 mpFont.replaceDC(mhDC);
2965 int nBreak = maImpl.GetTextBreak(nMaxWidth, nCharExtra, nFactor);
2966 mpFont.restoreDC();
2967 return nBreak;

--- 44 unchanged lines hidden (view full) ---

3012 ImplWinFontEntry& rFontInstance = *mpWinFontEntry[ nFallbackLevel ];
3013
3014#if defined( USE_UNISCRIBE )
3015 if( !(rArgs.mnFlags & SAL_LAYOUT_COMPLEX_DISABLED)
3016 && (aUspModule || (bUspEnabled && InitUSP())) ) // CTL layout engine
3017 {
3018#ifdef ENABLE_GRAPHITE
3019 if (rFontFace.SupportsGraphite())
3020 pWinLayout = new GraphiteWinLayout(mhDC, rFontFace, rFontInstance);
3020 pWinLayout = new GraphiteWinLayout( getHDC(), rFontFace, rFontInstance);
3021 else
3022#endif // ENABLE_GRAPHITE
3023 // script complexity is determined in upper layers
3024 pWinLayout = new UniscribeLayout( getHDC(), rFontFace, rFontInstance );
3025 // NOTE: it must be guaranteed that the WinSalGraphics lives longer than
3026 // the created UniscribeLayout, otherwise the data passed into the
3027 // constructor might become invalid too early
3028 }

--- 10 unchanged lines hidden (view full) ---

3039 }
3040#endif // GCP_KERN_HACK
3041
3042 BYTE eCharSet = ANSI_CHARSET;
3043 if( mpLogFont )
3044 eCharSet = mpLogFont->lfCharSet;
3045#ifdef ENABLE_GRAPHITE
3046 if (rFontFace.SupportsGraphite())
3021 else
3022#endif // ENABLE_GRAPHITE
3023 // script complexity is determined in upper layers
3024 pWinLayout = new UniscribeLayout( getHDC(), rFontFace, rFontInstance );
3025 // NOTE: it must be guaranteed that the WinSalGraphics lives longer than
3026 // the created UniscribeLayout, otherwise the data passed into the
3027 // constructor might become invalid too early
3028 }

--- 10 unchanged lines hidden (view full) ---

3039 }
3040#endif // GCP_KERN_HACK
3041
3042 BYTE eCharSet = ANSI_CHARSET;
3043 if( mpLogFont )
3044 eCharSet = mpLogFont->lfCharSet;
3045#ifdef ENABLE_GRAPHITE
3046 if (rFontFace.SupportsGraphite())
3047 pWinLayout = new GraphiteWinLayout(mhDC, rFontFace, rFontInstance);
3047 pWinLayout = new GraphiteWinLayout( getHDC(), rFontFace, rFontInstance);
3048 else
3049#endif // ENABLE_GRAPHITE
3050 pWinLayout = new SimpleWinLayout( getHDC(), eCharSet, rFontFace, rFontInstance );
3051 }
3052
3053 if( mfFontScale != 1.0 )
3054 pWinLayout->SetFontScale( mfFontScale );
3055

--- 125 unchanged lines hidden ---
3048 else
3049#endif // ENABLE_GRAPHITE
3050 pWinLayout = new SimpleWinLayout( getHDC(), eCharSet, rFontFace, rFontInstance );
3051 }
3052
3053 if( mfFontScale != 1.0 )
3054 pWinLayout->SetFontScale( mfFontScale );
3055

--- 125 unchanged lines hidden ---