From 347a1622743363ae11cd12bc00d5827c5c952f79 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Mon, 5 Jan 2009 15:33:41 +0000 Subject: CWS-TOOLING: integrate CWS kashidafix 2008-12-15 15:31:40 +0100 hde r265507 : #i97098# 2008-12-15 15:30:52 +0100 hde r265506 : #i97098# 2008-12-10 14:08:07 +0100 fredrikh r265184 : i97098 2008-11-27 15:07:01 +0100 hdu r264493 : #i60594# only determine GetNextGlyphs() charpos if requested+available 2008-11-27 14:09:42 +0100 hdu r264487 : #i60594# simplify RTL-glyph-injection also for manual-cell-aligned cases 2008-11-26 13:25:08 +0100 fme r264379 : #i60594# Kashida fixes - syntax error 2008-11-26 13:16:22 +0100 hdu r264374 : #i60594# allow glyph injection even if there is not enough room if they can overlap 2008-11-25 16:40:20 +0100 hdu r264314 : #i60594# fix glyph-injection for PDF-export for usp>=1.6 2008-11-24 16:17:11 +0100 hdu r264254 : #i71804# adjust glyph-fallback usp-methods for new glyph-injection infrastructure 2008-11-24 16:15:30 +0100 hdu r264253 : #i71804# disable glyph-injection for glyph-fallback mixing 2008-11-20 08:29:15 +0100 fme r264027 : #i60594# Fix correction 2008-11-14 10:10:54 +0100 fme r263666 : CWS-TOOLING: rebase CWS kashidafix to trunk@263288 (milestone: DEV300:m35) 2008-10-30 16:35:30 +0100 fme r262834 : #i60594# migrate cws kashidafix to SVN. --- vcl/source/gdi/outdev3.cxx | 59 +++++++++++++++++++++++++++++++++++++++++++- vcl/source/gdi/sallayout.cxx | 7 ++++++ 2 files changed, 65 insertions(+), 1 deletion(-) (limited to 'vcl/source') diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index 19a9778ebb04..60db5cc152c2 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: outdev3.cxx,v $ - * $Revision: 1.245 $ + * $Revision: 1.240.14.5 $ * * This file is part of OpenOffice.org. * @@ -3734,9 +3734,11 @@ void OutputDevice::ImplInitAboveTextLineSize() ImplFontMetricData::ImplFontMetricData( const ImplFontSelectData& rFontSelData ) : ImplFontAttributes( rFontSelData ) { + // initialize the members provided by the font request mnWidth = rFontSelData.mnWidth; mnOrientation = sal::static_int_cast(rFontSelData.mnOrientation); + // intialize the used font name if( rFontSelData.mpFontData ) { maName = rFontSelData.mpFontData->maName; @@ -3753,12 +3755,15 @@ ImplFontMetricData::ImplFontMetricData( const ImplFontSelectData& rFontSelData ) mbKernableFont = false; } + // reset metrics that are usually measured for the font instance mnAscent = 0; mnDescent = 0; mnIntLeading = 0; mnExtLeading = 0; mnSlant = 0; + mnMinKashida = 0; + // reset metrics that are usually derived from the measurements mnUnderlineSize = 0; mnUnderlineOffset = 0; mnBUnderlineSize = 0; @@ -7557,6 +7562,58 @@ FontMetric OutputDevice::GetFontMetric( const Font& rFont ) const // ----------------------------------------------------------------------- +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(this)->SetFont( rFont ); + long aKashida = GetMinKashida(); + const_cast(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; +} + + + +// ----------------------------------------------------------------------- + + // TODO: best is to get rid of this method completely ULONG OutputDevice::GetKerningPairCount() const { diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 9e02b42aa789..9dd0bfdc0197 100755 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -1715,6 +1715,9 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs ) } mpLayouts[n]->AdjustLayout( aMultiArgs ); + // disable glyph-injection for glyph-fallback SalLayout iteration + mpLayouts[n]->DisableGlyphInjection( true ); + // remove unused parts of component if( n > 0 ) { @@ -1893,6 +1896,10 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs ) } mpLayouts[0]->Simplify( true ); + + // reenable glyph-injection + for( n = 0; n < mnLevel; ++n ) + mpLayouts[n]->DisableGlyphInjection( false ); } // ----------------------------------------------------------------------- -- cgit