88ff66c
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
88ff66c
index 32f2126..05de4cf 100644
cca98c8
--- a/vcl/inc/vcl/salgdi.hxx
cca98c8
+++ b/vcl/inc/vcl/salgdi.hxx
cca98c8
@@ -38,6 +38,7 @@
88ff66c
 #include "vcl/outdev.hxx"
88ff66c
 #include "vcl/salnativewidgets.hxx"
cca98c8
 #include "vcl/salctrlhandle.hxx"
cca98c8
+#include "vcl/sallayout.hxx"
88ff66c
 
88ff66c
 #include <map>
88ff66c
 
cca98c8
@@ -303,8 +304,8 @@
88ff66c
                                             Int32Vector& rWidths,
88ff66c
                                             Ucs2UIntMap& rUnicodeEnc ) = 0;
88ff66c
 
cca98c8
-    virtual BOOL                    GetGlyphBoundRect( long nIndex, Rectangle& ) = 0;
cca98c8
-    virtual BOOL                    GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& ) = 0;
cca98c8
+    virtual BOOL                    GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ) = 0;
cca98c8
+    virtual BOOL                    GetGlyphOutline( sal_GlyphId nIndex, basegfx::B2DPolyPolygon& ) = 0;
88ff66c
 
88ff66c
     virtual SalLayout*              GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) = 0;
88ff66c
     virtual void					 DrawServerFontLayout( const ServerFontLayout& ) = 0;
88ff66c
diff --git a/vcl/inc/unx/pspgraphics.h b/vcl/inc/unx/pspgraphics.h
88ff66c
index 29f9251..f5787b1 100644
cca98c8
--- a/vcl/unx/inc/pspgraphics.h
cca98c8
+++ b/vcl/unx/inc/pspgraphics.h
cca98c8
@@ -128,8 +128,8 @@
88ff66c
                                             bool bVertical,
88ff66c
                                             Int32Vector& rWidths,
88ff66c
                                             Ucs2UIntMap& rUnicodeEnc );
cca98c8
-    virtual BOOL			GetGlyphBoundRect( long nIndex, Rectangle& );
cca98c8
-    virtual BOOL			GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
cca98c8
+    virtual BOOL			GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& );
cca98c8
+    virtual BOOL			GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& );
88ff66c
     virtual SalLayout*		GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
88ff66c
     virtual void			DrawServerFontLayout( const ServerFontLayout& );
88ff66c
     virtual bool            supportsOperation( OutDevSupportType ) const;
88ff66c
diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h
88ff66c
index a7c2fa1..d03d1df 100644
cca98c8
--- a/vcl/unx/inc/salgdi.h
cca98c8
+++ b/vcl/unx/inc/salgdi.h
cca98c8
@@ -279,8 +279,8 @@
88ff66c
                                             bool bVertical,
88ff66c
                                             Int32Vector& rWidths,
88ff66c
                                             Ucs2UIntMap& rUnicodeEnc );
cca98c8
-    virtual BOOL			GetGlyphBoundRect( long nIndex, Rectangle& );
cca98c8
-    virtual BOOL			GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
cca98c8
+    virtual BOOL			GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& );
cca98c8
+    virtual BOOL			GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& );
88ff66c
     virtual SalLayout*		GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
88ff66c
     virtual void			DrawServerFontLayout( const ServerFontLayout& );
88ff66c
     virtual bool            supportsOperation( OutDevSupportType ) const;
88ff66c
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
88ff66c
index 647cc22..f30251d 100755
88ff66c
--- a/vcl/source/gdi/outdev3.cxx
88ff66c
+++ b/vcl/source/gdi/outdev3.cxx
88ff66c
@@ -6112,7 +6112,7 @@ void OutputDevice::forceFallbackFontToFit(SalLayout &rFallback, ImplFontEntry &r
88ff66c
         if( !rFallback.GetNextGlyphs( 1, &nLGlyph, aPos, nStart ) )
88ff66c
             break;
88ff66c
 
88ff66c
-        int nFontTag = nFallbackLevel << GF_FONTSHIFT;
88ff66c
+        sal_GlyphId nFontTag = nFallbackLevel << GF_FONTSHIFT;
88ff66c
         nLGlyph |= nFontTag;
88ff66c
 
88ff66c
         // get bounding rectangle of individual glyph
88ff66c
diff --git a/vcl/unx/generic/gdi/pspgraphics.cxx b/vcl/unx/generic/gdi/pspgraphics.cxx
88ff66c
index ba2319c..8e66c93 100644
cca98c8
--- a/vcl/unx/source/gdi/pspgraphics.cxx
cca98c8
+++ b/vcl/unx/source/gdi/pspgraphics.cxx
cca98c8
@@ -933,7 +933,7 @@
88ff66c
     return nHavePairs;
88ff66c
 }
88ff66c
 
cca98c8
-BOOL PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
cca98c8
+BOOL PspGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect )
88ff66c
 {
88ff66c
     int nLevel = nGlyphIndex >> GF_FONTSHIFT;
88ff66c
     if( nLevel >= MAX_FALLBACK )
cca98c8
@@ -943,13 +943,13 @@
88ff66c
     if( !pSF )
cca98c8
         return FALSE;
88ff66c
 
88ff66c
-    nGlyphIndex &= ~GF_FONTMASK;
88ff66c
+    nGlyphIndex &= GF_IDXMASK;
88ff66c
     const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
88ff66c
     rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
cca98c8
     return TRUE;
88ff66c
 }
88ff66c
 
cca98c8
-BOOL PspGraphics::GetGlyphOutline( long nGlyphIndex,
cca98c8
+BOOL PspGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex,
88ff66c
     ::basegfx::B2DPolyPolygon& rB2DPolyPoly )
88ff66c
 {
88ff66c
     int nLevel = nGlyphIndex >> GF_FONTSHIFT;
cca98c8
@@ -960,7 +960,7 @@
88ff66c
     if( !pSF )
cca98c8
         return FALSE;
88ff66c
 
88ff66c
-    nGlyphIndex &= ~GF_FONTMASK;
88ff66c
+    nGlyphIndex &= GF_IDXMASK;
88ff66c
     if( pSF->GetGlyphOutline( nGlyphIndex, rB2DPolyPoly ) )
cca98c8
         return TRUE;
88ff66c
 
88ff66c
diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx
88ff66c
index 2615438..a90fd1c 100644
cca98c8
--- a/vcl/unx/source/gdi/salgdi3.cxx
cca98c8
+++ b/vcl/unx/source/gdi/salgdi3.cxx
cca98c8
@@ -1803,7 +1803,7 @@
88ff66c
 
88ff66c
 // ---------------------------------------------------------------------------
88ff66c
 
cca98c8
-BOOL X11SalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
cca98c8
+BOOL X11SalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect )
88ff66c
 {
88ff66c
     int nLevel = nGlyphIndex >> GF_FONTSHIFT;
cca98c8
     if( nLevel >= MAX_FALLBACK )
cca98c8
@@ -1813,7 +1813,7 @@
88ff66c
     if( !pSF )
cca98c8
         return FALSE;
88ff66c
 
88ff66c
-    nGlyphIndex &= ~GF_FONTMASK;
88ff66c
+    nGlyphIndex &= GF_IDXMASK;
88ff66c
     const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
88ff66c
     rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
cca98c8
     return TRUE;
cca98c8
@@ -1821,7 +1821,7 @@
88ff66c
 
88ff66c
 // ---------------------------------------------------------------------------
88ff66c
 
cca98c8
-BOOL X11SalGraphics::GetGlyphOutline( long nGlyphIndex,
cca98c8
+BOOL X11SalGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex,
88ff66c
     ::basegfx::B2DPolyPolygon& rPolyPoly )
88ff66c
 {
88ff66c
     int nLevel = nGlyphIndex >> GF_FONTSHIFT;
cca98c8
@@ -1832,7 +1832,7 @@
88ff66c
     if( !pSF )
cca98c8
         return FALSE;
88ff66c
 
88ff66c
-    nGlyphIndex &= ~GF_FONTMASK;
03b2934
+    nGlyphIndex &= GF_IDXMASK;
88ff66c
     if( pSF->GetGlyphOutline( nGlyphIndex, rPolyPoly ) )
cca98c8
         return TRUE;
88ff66c
 
88ff66c
diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx
88ff66c
index 37eac08..640eb43 100644
88ff66c
--- a/vcl/unx/headless/svpgdi.hxx
88ff66c
+++ b/vcl/unx/headless/svpgdi.hxx
88ff66c
@@ -111,8 +111,8 @@ public:
88ff66c
                                             bool bVertical,
88ff66c
                                             Int32Vector& rWidths,
88ff66c
                                             Ucs2UIntMap& rUnicodeEnc );
cca98c8
-    virtual BOOL			GetGlyphBoundRect( long nIndex, Rectangle& );
cca98c8
-    virtual BOOL			GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
cca98c8
+    virtual BOOL			GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& );
cca98c8
+    virtual BOOL			GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& );
88ff66c
     virtual SalLayout*		GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
88ff66c
     virtual void			DrawServerFontLayout( const ServerFontLayout& );
88ff66c
     virtual bool            supportsOperation( OutDevSupportType ) const;
88ff66c
diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx
88ff66c
index c9c1a7d..f44c445 100644
88ff66c
--- a/vcl/unx/headless/svppspgraphics.cxx
88ff66c
+++ b/vcl/unx/headless/svppspgraphics.cxx
cca98c8
@@ -843,7 +843,7 @@
88ff66c
     return nHavePairs;
88ff66c
 }
88ff66c
 
cca98c8
-BOOL PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
cca98c8
+BOOL PspGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect )
88ff66c
 {
88ff66c
     int nLevel = nGlyphIndex >> GF_FONTSHIFT;
88ff66c
     if( nLevel >= MAX_FALLBACK )
cca98c8
@@ -853,13 +853,13 @@
88ff66c
     if( !pSF )
cca98c8
         return FALSE;
88ff66c
 
88ff66c
-    nGlyphIndex &= ~GF_FONTMASK;
88ff66c
+    nGlyphIndex &= GF_IDXMASK;
88ff66c
     const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
88ff66c
     rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
cca98c8
     return TRUE;
88ff66c
 }
88ff66c
 
cca98c8
-BOOL PspGraphics::GetGlyphOutline( long nGlyphIndex,
cca98c8
+BOOL PspGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex,
88ff66c
     ::basegfx::B2DPolyPolygon& rB2DPolyPoly )
88ff66c
 {
88ff66c
     int nLevel = nGlyphIndex >> GF_FONTSHIFT;
cca98c8
@@ -870,7 +870,7 @@
88ff66c
     if( !pSF )
cca98c8
         return FALSE;
88ff66c
 
88ff66c
-    nGlyphIndex &= ~GF_FONTMASK;
88ff66c
+    nGlyphIndex &= GF_IDXMASK;
88ff66c
     if( pSF->GetGlyphOutline( nGlyphIndex, rB2DPolyPoly ) )
cca98c8
         return TRUE;
88ff66c
 
88ff66c
diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx
88ff66c
index 6245496..2c03386 100644
88ff66c
--- a/vcl/unx/headless/svppspgraphics.hxx
88ff66c
+++ b/vcl/unx/headless/svppspgraphics.hxx
88ff66c
@@ -125,8 +125,8 @@ public:
88ff66c
                                             bool bVertical,
88ff66c
                                             Int32Vector& rWidths,
88ff66c
                                             Ucs2UIntMap& rUnicodeEnc );
cca98c8
-    virtual BOOL			GetGlyphBoundRect( long nIndex, Rectangle& );
cca98c8
-    virtual BOOL			GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& );
cca98c8
+    virtual BOOL			GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& );
cca98c8
+    virtual BOOL			GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& );
88ff66c
     virtual SalLayout*		GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
88ff66c
     virtual void			DrawServerFontLayout( const ServerFontLayout& );
88ff66c
     virtual bool            supportsOperation( OutDevSupportType ) const;
88ff66c
diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx
88ff66c
index 24e0f1b..a077685 100644
88ff66c
--- a/vcl/unx/headless/svptext.cxx
88ff66c
+++ b/vcl/unx/headless/svptext.cxx
cca98c8
@@ -425,7 +425,7 @@
88ff66c
 
88ff66c
 // ---------------------------------------------------------------------------
88ff66c
 
cca98c8
-BOOL SvpSalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
cca98c8
+BOOL SvpSalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect )
88ff66c
 {
88ff66c
     int nLevel = nGlyphIndex >> GF_FONTSHIFT;
88ff66c
     if( nLevel >= MAX_FALLBACK )
cca98c8
@@ -435,7 +435,7 @@
88ff66c
     if( !pSF )
cca98c8
         return FALSE;
88ff66c
 
88ff66c
-    nGlyphIndex &= ~GF_FONTMASK;
88ff66c
+    nGlyphIndex &= GF_IDXMASK;
88ff66c
     const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
88ff66c
     rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
cca98c8
     return TRUE;
cca98c8
@@ -443,7 +443,7 @@
88ff66c
 
88ff66c
 // ---------------------------------------------------------------------------
88ff66c
 
cca98c8
-BOOL SvpSalGraphics::GetGlyphOutline( long nGlyphIndex, B2DPolyPolygon& rPolyPoly )
cca98c8
+BOOL SvpSalGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex, B2DPolyPolygon& rPolyPoly )
88ff66c
 {
88ff66c
     int nLevel = nGlyphIndex >> GF_FONTSHIFT;
88ff66c
     if( nLevel >= MAX_FALLBACK )
cca98c8
@@ -453,7 +453,7 @@
88ff66c
     if( !pSF )
cca98c8
         return FALSE;
88ff66c
 
88ff66c
-    nGlyphIndex &= ~GF_FONTMASK;
88ff66c
+    nGlyphIndex &= GF_IDXMASK;
88ff66c
     if( pSF->GetGlyphOutline( nGlyphIndex, rPolyPoly ) )
cca98c8
         return TRUE;
88ff66c
 
cca98c8
@@ -489,7 +489,7 @@
88ff66c
             continue;
88ff66c
 
88ff66c
         // get the glyph's alpha mask and adjust the drawing position
88ff66c
-        nGlyphIndex &= ~GF_FONTMASK;
88ff66c
+        nGlyphIndex &= GF_IDXMASK;
88ff66c
         B2IPoint aDstPoint( aPos.X(), aPos.Y() );
88ff66c
         BitmapDeviceSharedPtr aAlphaMask
88ff66c
             = rGlyphPeer.GetGlyphBmp( *pSF, nGlyphIndex, m_eTextFmt, aDstPoint );