summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2003-06-30 13:32:24 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2003-06-30 13:32:24 +0000
commite54494b83bc6917054ad1e57be4f10bc08ccd527 (patch)
tree65213bd47e9df4dd9c0317f12197aedaead39201 /vcl
parentb83416558229b723b96899314a69430d473c3816 (diff)
INTEGRATION: CWS vcl13 (1.104.20); FILE MERGED
2003/06/24 12:12:08 pl 1.104.20.1: #i15935# enable fallback for builtin printer fonts
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/source/gdi/salgdi3.cxx49
1 files changed, 40 insertions, 9 deletions
diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx
index 807cca55d16a..421a6f19f612 100644
--- a/vcl/unx/source/gdi/salgdi3.cxx
+++ b/vcl/unx/source/gdi/salgdi3.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: salgdi3.cxx,v $
*
- * $Revision: 1.104 $
+ * $Revision: 1.105 $
*
- * last change: $Author: vg $ $Date: 2003-05-28 12:34:11 $
+ * last change: $Author: hr $ $Date: 2003-06-30 14:32:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1171,7 +1171,6 @@ void SalGraphicsData::DrawServerSimpleFontString( const ServerFontLayout& rSalLa
#ifndef _USE_PRINT_EXTENSION_
-// TODO: move into psp project
class PspFontLayout : public GenericSalLayout
{
public:
@@ -1195,7 +1194,7 @@ PspFontLayout::PspFontLayout( ::psp::PrinterGfx& rGfx )
mnFontID = mrPrinterGfx.GetFontID();
mnFontHeight = mrPrinterGfx.GetFontHeight();
mnFontWidth = mrPrinterGfx.GetFontWidth();
- mbVertical = false;
+ mbVertical = mrPrinterGfx.GetFontVertical();
}
//--------------------------------------------------------------------------
@@ -1218,12 +1217,12 @@ bool PspFontLayout::LayoutText( ImplLayoutArgs& rArgs )
sal_Unicode cChar = rArgs.mpStr[ nCharPos ];
int nGlyphIndex = cChar; // printer glyphs = unicode
-#if 0
- // TODO: find out if printer font really contains the char
+
// update fallback_runs if needed
- if( rGfx.HasGlyph( cChar ) )
+ psp::CharacterMetric aMetric;
+ mrPrinterGfx.GetFontMgr().getMetrics( mnFontID, cChar, cChar, &aMetric, mbVertical );
+ if( aMetric.width == -1 && aMetric.height == -1 )
rArgs.NeedFallback( nCharPos, bRightToLeft );
-#endif
// apply pair kerning to prev glyph if requested
if( SAL_LAYOUT_KERNING_PAIRS & rArgs.mnFlags )
@@ -1256,6 +1255,36 @@ bool PspFontLayout::LayoutText( ImplLayoutArgs& rArgs )
return (nOldGlyphId >= 0);
}
+class PspServerFontLayout : public ServerFontLayout
+{
+public:
+ PspServerFontLayout( ::psp::PrinterGfx&, ServerFont& rFont );
+
+ virtual void InitFont() const;
+private:
+ ::psp::PrinterGfx& mrPrinterGfx;
+ int mnFontID;
+ int mnFontHeight;
+ int mnFontWidth;
+ bool mbVertical;
+};
+
+PspServerFontLayout::PspServerFontLayout( ::psp::PrinterGfx& rGfx, ServerFont& rFont )
+ : ServerFontLayout( rFont ),
+ mrPrinterGfx( rGfx )
+{
+ mnFontID = mrPrinterGfx.GetFontID();
+ mnFontHeight = mrPrinterGfx.GetFontHeight();
+ mnFontWidth = mrPrinterGfx.GetFontWidth();
+ mbVertical = mrPrinterGfx.GetFontVertical();
+}
+
+void PspServerFontLayout::InitFont() const
+{
+ mrPrinterGfx.SetFont( mnFontID, mnFontHeight, mnFontWidth,
+ mnOrientation, mbVertical );
+}
+
//--------------------------------------------------------------------------
void DrawPrinterLayout( const SalLayout& rLayout, ::psp::PrinterGfx& rGfx )
@@ -2017,6 +2046,8 @@ SalLayout* SalGraphicsData::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackL
int nFontId = m_pPrinterGfx->GetFontID();
if( psp::fonttype::TrueType != psp::PrintFontManager::get().getFontType( nFontId ) )
rArgs.mnFlags |= SAL_LAYOUT_DISABLE_GLYPH_PROCESSING;
+ else if( nFallbackLevel > 0 )
+ rArgs.mnFlags &= ~SAL_LAYOUT_DISABLE_GLYPH_PROCESSING;
}
#endif // !defined(_USE_PRINT_EXTENSION_)
@@ -2024,7 +2055,7 @@ SalLayout* SalGraphicsData::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackL
if( mpServerFont[ nFallbackLevel ]
&& !(rArgs.mnFlags & SAL_LAYOUT_DISABLE_GLYPH_PROCESSING) )
- pLayout = new ServerFontLayout( *mpServerFont[ nFallbackLevel ] );
+ pLayout = m_pPrinterGfx ? new PspServerFontLayout( *m_pPrinterGfx, *mpServerFont[nFallbackLevel] ) : new ServerFontLayout( *mpServerFont[ nFallbackLevel ] );
#if !defined(_USE_PRINT_EXTENSION_)
else if( m_pPrinterGfx != NULL )
pLayout = new PspFontLayout( *m_pPrinterGfx );