<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Graham,<div><br></div><div>I figured out a temporary fix to the not-flipped text issue. I hope this helps you identify the problem in the code and design/implement a real fix at some point.</div><div><br></div><div>In&nbsp;<font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">DKTextAdornment.m</span></font> in method&nbsp;<span class="Apple-style-span" style="font-family: Monaco; font-size: 10px; ">-(<span style="color: #5c2699">NSPoint</span>)&nbsp;textOriginForSize:(<span style="color: #5c2699">NSSize</span>) textSize objectSize:(<span style="color: #5c2699">NSSize</span>) osize</span></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div>in the section where you adjust the textOrigin based on the size of the textRect here's your code:</div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><span class="Apple-style-span" style="color: rgb(0, 116, 0); font-family: Monaco; font-size: 10px; "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span>// factor in textRect offset</span></div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px"><span class="Apple-tab-span" style="white-space:pre">        </span>textOrigin.<span style="color: #5c2699">x</span> += ( tr.<span style="color: #5c2699">origin</span>.<span style="color: #5c2699">x</span> * osize.<span style="color: #5c2699">width</span>);</p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span>textOrigin.</span><span style="color: #5c2699">y</span><span style="color: #000000"> += ( tr.</span><span style="color: #5c2699">origin</span><span style="color: #000000">.</span><span style="color: #5c2699">y</span><span style="color: #000000"> * osize.</span><span style="color: #5c2699">height</span><span style="color: #000000">)</span><span style="color: #000000">;</span></div><div><font class="Apple-style-span" color="#007400" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><div>If I add in another adjustment to the textOrigin.y value as below, then I can get the text objects to display correctly in a not-flipped drawing.</div><div><br></div></div><div><div><span class="Apple-style-span" style="color: rgb(0, 116, 0); font-family: Monaco; font-size: 10px; "><span style="color: rgb(0, 0, 0); "><span class="Apple-tab-span" style="white-space: pre; ">        </span></span>// factor in textRect offset</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; min-height: 14px; "><span class="Apple-tab-span" style="white-space: pre; ">        </span>textOrigin.<span style="color: rgb(92, 38, 153); ">x</span>&nbsp;+= ( tr.<span style="color: rgb(92, 38, 153); ">origin</span>.<span style="color: rgb(92, 38, 153); ">x</span>&nbsp;* osize.<span style="color: rgb(92, 38, 153); ">width</span>);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: rgb(0, 0, 0); "><span class="Apple-tab-span" style="white-space: pre; ">        </span>textOrigin.</span><span style="color: rgb(92, 38, 153); ">y</span><span style="color: rgb(0, 0, 0); ">&nbsp;+= ( tr.</span><span style="color: rgb(92, 38, 153); ">origin</span><span style="color: rgb(0, 0, 0); ">.</span><span style="color: rgb(92, 38, 153); ">y</span><span style="color: rgb(0, 0, 0); ">&nbsp;* osize.</span><span style="color: rgb(92, 38, 153); ">height</span><span style="color: rgb(0, 0, 0); ">) - textSize.</span><span style="color: rgb(92, 38, 153); ">height</span><span style="color: rgb(0, 0, 0); ">/</span><span style="color: rgb(28, 0, 207); ">2</span><span style="color: rgb(0, 0, 0); ">;&nbsp;&nbsp;</span>//[AD] changed to get not-flipped text to display correctly</div><div><font class="Apple-style-span" color="#007400" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div></div><div><div><div>This will certainly mess things up in a flipped drawing, but in my case I'm not working with flipped drawings so this fix solves my problem temporarily.</div><div><br></div><div>I hope this helps pinpoint at least some of the not-flipped text issues. Nothing I'm doing here would address your point about the NSLayoutManger, however.&nbsp;</div><div><br></div><div>-Allan</div><div><br></div><div><br></div><div><br></div></div><div></div></div><div><div><div>On Jun 1, 2009, at 10:32 PM, Graham Cox wrote:</div><blockquote type="cite"><div>One big problem with text is that NSLayoutManager assumes a flipped context. This may add some headaches when drawing text and so far I must admit I haven't put any effort into addressing this. However, recent work has led me a much greater understanding of this class than before, so I have a chance to create a subclass that can be used for tackling this.<br></div></blockquote></div><br></div></body></html>