… | |
… | |
2253 | int back = bgcolor_of (rend); // desired background |
2253 | int back = bgcolor_of (rend); // desired background |
2254 | |
2254 | |
2255 | // only do special processing if any attributes are set, which is unlikely |
2255 | // only do special processing if any attributes are set, which is unlikely |
2256 | if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful)) |
2256 | if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful)) |
2257 | { |
2257 | { |
2258 | #if ENABLE_STYLES |
|
|
2259 | // "careful" (too wide) character handling |
|
|
2260 | |
|
|
2261 | // include previous careful character(s) if possible, looks nicer (best effort...) |
|
|
2262 | while (text > stp |
|
|
2263 | && srp[text - stp - 1] & RS_Careful |
|
|
2264 | && RS_SAME (rend, srp[text - stp - 1])) |
|
|
2265 | text--, count++, xpixel -= fwidth; |
|
|
2266 | |
|
|
2267 | // force redraw after "careful" characters to avoid pixel droppings |
|
|
2268 | for (int i = 0; srp[col + i] & RS_Careful && col + i < ncol - 1; i++) |
|
|
2269 | drp[col + i + 1] = srp[col + i + 1] ^ RS_redraw; |
|
|
2270 | |
|
|
2271 | // force redraw before "careful" characters to avoid pixel droppings |
|
|
2272 | for (int i = 0; srp[text - stp - i] & RS_Careful && text - i > stp; i++) |
|
|
2273 | drp[text - stp - i - 1] = srp[text - stp - i - 1] ^ RS_redraw; |
|
|
2274 | #endif |
|
|
2275 | |
|
|
2276 | bool invert = rend & RS_RVid; |
2258 | bool invert = rend & RS_RVid; |
2277 | |
2259 | |
2278 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
2260 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
2279 | if (rend & RS_Bold |
2261 | if (rend & RS_Bold |
2280 | && fore == Color_fg) |
2262 | && fore == Color_fg) |
… | |
… | |
2302 | fore = Color_UL; |
2284 | fore = Color_UL; |
2303 | #endif |
2285 | #endif |
2304 | |
2286 | |
2305 | if (invert) |
2287 | if (invert) |
2306 | { |
2288 | { |
|
|
2289 | #ifdef OPTION_HC |
|
|
2290 | if ((showcursor && row == screen.cur.row && text - stp == screen.cur.col) |
|
|
2291 | || !ISSET_PIXCOLOR (Color_HC)) |
|
|
2292 | #endif |
|
|
2293 | /* invert the column if no highlightColor is set or it is the |
|
|
2294 | * current cursor column */ |
2307 | ::swap (fore, back); |
2295 | ::swap (fore, back); |
|
|
2296 | #ifdef OPTION_HC |
|
|
2297 | else if (ISSET_PIXCOLOR (Color_HC)) |
|
|
2298 | back = Color_HC; |
|
|
2299 | #endif |
2308 | |
2300 | |
2309 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
2301 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
|
|
2302 | # ifndef OPTION_HC |
2310 | if (ISSET_PIXCOLOR (Color_RV)) |
2303 | if (ISSET_PIXCOLOR (Color_RV)) |
2311 | back = Color_RV; |
2304 | back = Color_RV; |
2312 | |
2305 | # endif |
2313 | if (fore == back) |
2306 | if (fore == back) |
2314 | { |
2307 | { |
2315 | fore = Color_bg; |
2308 | fore = Color_bg; |
2316 | back = Color_fg; |
2309 | back = Color_fg; |
2317 | } |
2310 | } |
… | |
… | |
2327 | hidden_text = 0; |
2320 | hidden_text = 0; |
2328 | } |
2321 | } |
2329 | else if (hidden_text) |
2322 | else if (hidden_text) |
2330 | fore = back; |
2323 | fore = back; |
2331 | } |
2324 | } |
|
|
2325 | #endif |
|
|
2326 | |
|
|
2327 | #if ENABLE_STYLES |
|
|
2328 | // "careful" (too wide) character handling |
|
|
2329 | |
|
|
2330 | // include previous careful character(s) if possible, looks nicer (best effort...) |
|
|
2331 | while (text > stp |
|
|
2332 | && srp[text - stp - 1] & RS_Careful |
|
|
2333 | && RS_SAME (rend, srp[text - stp - 1])) |
|
|
2334 | text--, count++, xpixel -= fwidth; |
|
|
2335 | |
|
|
2336 | // force redraw after "careful" characters to avoid pixel droppings |
|
|
2337 | for (int i = 0; srp[col + i] & RS_Careful && col + i < ncol - 1; i++) |
|
|
2338 | drp[col + i + 1] = srp[col + i + 1] ^ RS_redraw; |
|
|
2339 | |
|
|
2340 | // force redraw before "careful" characters to avoid pixel droppings |
|
|
2341 | for (int i = 0; srp[text - stp - i] & RS_Careful && text - i > stp; i++) |
|
|
2342 | drp[text - stp - i - 1] = srp[text - stp - i - 1] ^ RS_redraw; |
2332 | #endif |
2343 | #endif |
2333 | } |
2344 | } |
2334 | |
2345 | |
2335 | /* |
2346 | /* |
2336 | * Actually do the drawing of the string here |
2347 | * Actually do the drawing of the string here |