summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-04-06 17:40:53 +0300
committerTor Lillqvist <tml@iki.fi>2013-04-07 01:13:35 +0300
commit6a0c8c728dac5437f6a39f995d6ac24668560a99 (patch)
tree3abd42f3ce12763b44bd4841481e65f9f7d9af94
parentc925e0d76c835cb331d20293919ab23e096d37f8 (diff)
Create a justified line if asked to
The end result is still not satisfactory but it is getting closer. Oh how nice it would have been to have some clean useful documentation for how the text layout machinery works. The number of entry points in the low-level "backends" (like CoreTextLayout) is quite small, so I doubt it would have required lots of text to document the "protocol" used between the upper layers and the layout machinery. Now one just have to use educated guessing aided by lots of debugging printout. But this is true for most of the codebase, of course. Change-Id: I791f190819a187418865279f6a5b4aa598e01d3c
-rw-r--r--vcl/coretext/salcoretextlayout.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/vcl/coretext/salcoretextlayout.cxx b/vcl/coretext/salcoretextlayout.cxx
index 3263e0d3ebd9..64e0d89f450a 100644
--- a/vcl/coretext/salcoretextlayout.cxx
+++ b/vcl/coretext/salcoretextlayout.cxx
@@ -501,6 +501,17 @@ bool CoreTextLayout::InitGIA( ImplLayoutArgs& rArgs ) const
return false;
}
+ if ( rArgs.mpDXArray ) {
+ CTLineRef justifiedLine = CTLineCreateJustifiedLine( mpLine, 1.0, rArgs.mpDXArray[mnCharCount-1] );
+ if ( !justifiedLine ) {
+ SAL_INFO( "vcl.coretext.layout", "InitGIA(): CTLineCreateJustifiedLine() failed" );
+ } else {
+ SAL_INFO( "vcl.coretext.layout", "InitGIA(): Created justified line" );
+ CFRelease( mpLine );
+ mpLine = justifiedLine;
+ }
+ }
+
mnGlyphCount = CTLineGetGlyphCount( mpLine );
SAL_INFO( "vcl.coretext.layout", "InitGIA(): CTLineGetGlyphCount() returned " << mnGlyphCount );