summaryrefslogtreecommitdiff
path: root/vcl/coretext/salgdi.cxx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-01-29 00:34:20 +0200
committerTor Lillqvist <tml@iki.fi>2013-01-29 00:40:36 +0200
commitef7b1133311ad6ff672a423d89c876d67f5f8f4a (patch)
treea02cb63fd2c65f1bc81a15e81fad3b064ffaa733 /vcl/coretext/salgdi.cxx
parent654c1e56cb86e85eb5ee9df5bc7894ec24402760 (diff)
More work on the CoreText code
It no longer gets stuck in a loop so easily. The key thing I realized was that there is a fundamental difference to how the ATSUI and CoreText APIs handle text buffers and the start offsets into them: ATSUCreateTextLayoutWithTextPtr() takes a pointer to the whole buffer, plus start offset and length. These are stored as part of the layout object. Other ATSUI calls that use the layout object interpret index parameters as relative to the buffer start, not relative to the start offset of the layout object. CTTypesetterCreateWithAttributedString() on the other hand takes an attributed string that has been created from a CFString that already is based on a potential substring of a buffer. I.e. the CTTypesetter has no knowledge of the original buffer. All index parameters are relative to that substring of the buffer, as are return values. Change-Id: I7026f323d90a72e1ae1784a69f521e347baffaea
Diffstat (limited to 'vcl/coretext/salgdi.cxx')
-rw-r--r--vcl/coretext/salgdi.cxx24
1 files changed, 13 insertions, 11 deletions
diff --git a/vcl/coretext/salgdi.cxx b/vcl/coretext/salgdi.cxx
index 64f4b17df9c7..05a93a525aca 100644
--- a/vcl/coretext/salgdi.cxx
+++ b/vcl/coretext/salgdi.cxx
@@ -48,20 +48,20 @@ QuartzSalGraphics::QuartzSalGraphics()
, mbVirDev( false )
, mbWindow( false )
{
- SAL_INFO( "vcl.coretext.gr", "-->" );
+ SAL_INFO( "vcl.coretext.gr", "QuartzSalGraphics::QuartzSalGraphics() " << this );
+
m_style = new CoreTextStyleInfo();
- SAL_INFO( "vcl.coretext.gr", "m_style=" << m_style << " <--" );
}
QuartzSalGraphics::~QuartzSalGraphics()
{
- SAL_INFO( "vcl.coretext.gr", "-->" );
+ SAL_INFO( "vcl.coretext.gr", "~QuartzSalGraphics(" << this << ")" );
+
if(m_style)
{
delete m_style;
m_style = NULL;
}
- SAL_INFO( "vcl.coretext.gr", "<--" );
}
inline bool QuartzSalGraphics::AddTempDevFont( ImplDevFontList*,
@@ -140,7 +140,14 @@ void QuartzSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbac
pMetric->mnExtLeading = nExtDescent + pMetric->mnDescent;
pMetric->mnIntLeading = 0;
pMetric->mnWidth = m_style->GetFontStretchedSize();
- SAL_INFO( "vcl.coretext.gr", "ascent=" << pMetric->mnAscent<< ", descent=" << pMetric->mnDescent << ", extleading=" << pMetric->mnExtLeading << ", intleading=" << pMetric->mnIntLeading << ", w=" << pMetric->mnWidth );
+
+ SAL_INFO( "vcl.coretext.gr",
+ "GetFontMetric(" << this << ") returning: {ascent=" << pMetric->mnAscent <<
+ ",descent=" << pMetric->mnDescent <<
+ ",extleading=" << pMetric->mnExtLeading <<
+ ",intleading=" << pMetric->mnIntLeading <<
+ ",width=" << pMetric->mnWidth <<
+ "}" );
}
sal_Bool QuartzSalGraphics::GetGlyphBoundRect( sal_GlyphId /*nGlyphId*/, Rectangle& /*rRect*/ )
@@ -203,7 +210,6 @@ bool QuartzSalGraphics::GetRawFontData( const PhysicalFontFace* pFontFace,
SystemFontData QuartzSalGraphics::GetSysFontData( int /* nFallbacklevel */ ) const
{
- SAL_INFO( "vcl.coretext.gr", "-->" );
SystemFontData aSysFontData;
aSysFontData.nSize = sizeof( SystemFontData );
aSysFontData.bAntialias = true;
@@ -236,23 +242,19 @@ SystemFontData QuartzSalGraphics::GetSysFontData( int /* nFallbacklevel */ ) con
aSysFontData.bVerticalCharacterType = vertical_font ? true : false;
SafeCFRelease(vertical_font);
- SAL_INFO( "vcl.coretext.gr", "<--" );
return aSysFontData;
}
sal_uInt16 QuartzSalGraphics::SetFont( FontSelectPattern* pReqFont, int /*nFallbackLevel*/ )
{
- SAL_INFO( "vcl.coretext.gr", "m_style=" << m_style << " -->" );
m_style->SetFont(pReqFont);
- SAL_INFO( "vcl.coretext.gr", "<--" );
+
return 0;
}
void QuartzSalGraphics::SetTextColor( SalColor nSalColor )
{
- SAL_INFO( "vcl.coretext.gr", "m_style=" << m_style << " -->" );
m_style->SetColor(nSalColor);
- SAL_INFO( "vcl.coretext.gr", "<--" );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */