Changeset 230:c853f6513712
- Timestamp:
- 05/24/08 02:59:14
(8 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
removed debug prints
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r229 |
r230 |
|
| 12 | 12 | *******************************************************************************/ |
|---|
| 13 | 13 | module dwt.graphics.TextLayout; |
|---|
| 14 | | |
|---|
| 15 | | import tango.util.log.Trace; |
|---|
| 16 | 14 | |
|---|
| 17 | 15 | import dwt.DWT; |
|---|
| … | … | |
| 2264 | 2262 | int pcItems; |
|---|
| 2265 | 2263 | wchar[] chars = StrToWCHARs( segmentsText ); |
|---|
| 2266 | | Trace.formatln( "{} {}: segmentsText='{}' chars='{}'", __FILE__,__LINE__, segmentsText, chars ); |
|---|
| 2267 | 2264 | OS.ScriptItemize(chars.ptr, chars.length, MAX_ITEM, &scriptControl, &scriptState, pItems, &pcItems); |
|---|
| 2268 | 2265 | // if (hr is E_OUTOFMEMORY) //TODO handle it |
|---|
| 2269 | 2266 | |
|---|
| 2270 | 2267 | // Translate the utf16 indices to utf8 indices |
|---|
| 2271 | | Trace.formatln( "{} {}: pcItems={} chars.length={} segmentsText.length={}", __FILE__,__LINE__,pcItems, chars.length, segmentsText.length ); |
|---|
| 2272 | 2268 | int utf8idx = 0; |
|---|
| 2273 | 2269 | SCRIPT_ITEM* si = pItems; |
|---|
| 2274 | 2270 | foreach( uint utf16idx, char c; chars ){ |
|---|
| 2275 | | Trace.formatln( "{} {}: utf8idx={} utf16idx={} si.iCharPos={}", __FILE__,__LINE__,utf8idx, utf16idx, si.iCharPos ); |
|---|
| 2276 | 2271 | if( si.iCharPos is utf16idx ){ |
|---|
| 2277 | 2272 | si.iCharPos = utf8idx; |
|---|
| … | … | |
| 2296 | 2291 | } |
|---|
| 2297 | 2292 | int count = 0, start = 0, end = segmentsText.length, itemIndex = 0, styleIndex = 0; |
|---|
| 2298 | | Trace.formatln( "{} {}: itemCount={} stylesCount={}", __FILE__,__LINE__,itemCount, stylesCount ); |
|---|
| 2299 | 2293 | StyleItem[] runs = new StyleItem[itemCount + stylesCount]; |
|---|
| 2300 | 2294 | SCRIPT_ITEM* scriptItem = new SCRIPT_ITEM(); |
|---|
| 2301 | 2295 | bool linkBefore = false; |
|---|
| 2302 | | Trace.formatln( "{} {}: start={} end={}", __FILE__,__LINE__,start, end ); |
|---|
| 2303 | 2296 | while (start < end) { |
|---|
| 2304 | 2297 | StyleItem item = new StyleItem(); |
|---|
| 2305 | 2298 | item.start = start; |
|---|
| 2306 | 2299 | item.style = styles[styleIndex].style; |
|---|
| 2307 | | Trace.formatln( "{} {}: count={}", __FILE__,__LINE__,count ); |
|---|
| 2308 | 2300 | runs[count++] = item; |
|---|
| 2309 | 2301 | OS.MoveMemory(scriptItem, (cast(void*)items) + itemIndex * SCRIPT_ITEM.sizeof, SCRIPT_ITEM.sizeof); |
|---|
| … | … | |
| 2334 | 2326 | } |
|---|
| 2335 | 2327 | item.length = start - item.start; |
|---|
| 2336 | | Trace.formatln( "{} {}: start={} end={}", __FILE__,__LINE__,start, end ); |
|---|
| 2337 | 2328 | } |
|---|
| 2338 | 2329 | StyleItem item = new StyleItem(); |
|---|
| … | … | |
| 2340 | 2331 | OS.MoveMemory(scriptItem, (cast(void*)items) + itemCount * SCRIPT_ITEM.sizeof, SCRIPT_ITEM.sizeof); |
|---|
| 2341 | 2332 | item.analysis = scriptItem.a; |
|---|
| 2342 | | Trace.formatln( "{} {}: count={}", __FILE__,__LINE__,count ); |
|---|
| 2343 | 2333 | runs[count++] = item; |
|---|
| 2344 | 2334 | if (runs.length !is count) { |
|---|
| … | … | |
| 2755 | 2745 | styles[1].start = text.length; |
|---|
| 2756 | 2746 | stylesCount = 2; |
|---|
| 2757 | | Trace.formatln( "{} {}: text='{}'", __FILE__,__LINE__, text ); |
|---|
| 2758 | 2747 | } |
|---|
| 2759 | 2748 | |
|---|