… | |
… | |
147 | |
147 | |
148 | text_t t = l.t[x]; |
148 | text_t t = l.t[x]; |
149 | |
149 | |
150 | if (t != NOCHAR || !x) |
150 | if (t != NOCHAR || !x) |
151 | { |
151 | { |
152 | iso14755_51 (l.t[x], l.r[x]); |
152 | iso14755_51 (l.t[x], l.r[x], x, y); |
153 | iso14755buf = ISO_14755_54; |
153 | iso14755buf = ISO_14755_54; |
154 | break; |
154 | break; |
155 | } |
155 | } |
156 | |
156 | |
157 | x--; |
157 | x--; |
158 | } |
158 | } |
159 | } |
159 | } |
160 | #endif |
160 | #endif |
161 | |
161 | |
|
|
162 | void |
|
|
163 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y) |
|
|
164 | { |
162 | #if ENABLE_OVERLAY |
165 | #if ENABLE_OVERLAY |
163 | void |
|
|
164 | rxvt_term::iso14755_51 (unicode_t ch, rend_t r) |
|
|
165 | { |
|
|
166 | rxvt_fontset *fs = FONTSET (r); |
166 | rxvt_fontset *fs = FONTSET (r); |
167 | rxvt_font *f = (*fs)[fs->find_font (ch)]; |
167 | rxvt_font *f = (*fs)[fs->find_font (ch)]; |
168 | wchar_t *chr, *alloc, ch2, *fname; |
168 | wchar_t *chr, *alloc, ch2, *fname; |
169 | int len; |
169 | int len; |
170 | |
170 | |
171 | fname = rxvt_utf8towcs (f->name); |
171 | fname = rxvt_utf8towcs (f->name); |
172 | |
172 | |
173 | #if ENABLE_COMBINING |
173 | # if ENABLE_COMBINING |
174 | if (IS_COMPOSE (ch)) |
174 | if (IS_COMPOSE (ch)) |
175 | { |
175 | { |
176 | len = rxvt_composite.expand (ch, 0); |
176 | len = rxvt_composite.expand (ch, 0); |
177 | alloc = chr = new wchar_t[len]; |
177 | alloc = chr = new wchar_t[len]; |
178 | rxvt_composite.expand (ch, chr); |
178 | rxvt_composite.expand (ch, chr); |
179 | } |
179 | } |
180 | else |
180 | else |
181 | #endif |
181 | # endif |
182 | { |
182 | { |
183 | ch2 = ch; |
183 | ch2 = ch; |
184 | |
184 | |
185 | alloc = 0; |
185 | alloc = 0; |
186 | chr = &ch2; |
186 | chr = &ch2; |
187 | len = 1; |
187 | len = 1; |
188 | } |
188 | } |
189 | |
189 | |
|
|
190 | char attr[80]; // plenty |
|
|
191 | |
|
|
192 | sprintf (attr, "%08x = fg %d bg %d%s%s%s%s%s%s", |
|
|
193 | (int)r, |
|
|
194 | GET_FGCOLOR (r), GET_BGCOLOR (r), |
|
|
195 | r & RS_Bold ? " bold" : "", |
|
|
196 | r & RS_Italic ? " italic" : "", |
|
|
197 | r & RS_Blink ? " blink" : "", |
|
|
198 | r & RS_RVid ? " rvid" : "", |
|
|
199 | r & RS_Uline ? " uline" : "", |
|
|
200 | r & RS_Careful ? " careful" : ""); |
|
|
201 | |
190 | int width = wcswidth (fname, wcslen (fname)); |
202 | int width = wcswidth (fname, wcslen (fname)); |
191 | |
203 | |
192 | scr_overlay_new (0, -1, width < 8+5 ? 8+5 : width, len + 1); |
204 | max_it (width, 8+5); // for char + hey |
|
|
205 | max_it (width, strlen (attr)); |
|
|
206 | |
|
|
207 | if (y >= 0) |
|
|
208 | { |
|
|
209 | y = (y >= nrow - len - 4 && x < width + 2) ? 0 : -1; |
|
|
210 | x = 0; |
|
|
211 | } |
|
|
212 | |
|
|
213 | scr_overlay_new (x, y, width, len + 2); |
193 | |
214 | |
194 | r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r)); |
215 | r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r)); |
195 | |
216 | |
196 | for (int y = 0; y < len; y++) |
217 | for (int y = 0; y < len; y++) |
197 | { |
218 | { |
… | |
… | |
200 | ch = *chr++; |
221 | ch = *chr++; |
201 | |
222 | |
202 | sprintf (buf, "%8x", ch); |
223 | sprintf (buf, "%8x", ch); |
203 | scr_overlay_set (0, y, buf); |
224 | scr_overlay_set (0, y, buf); |
204 | scr_overlay_set (9, y, '='); |
225 | scr_overlay_set (9, y, '='); |
205 | #if !UNICODE3 |
226 | # if !UNICODE3 |
206 | if (ch >= 0x10000) |
227 | if (ch >= 0x10000) |
207 | ch = 0xfffd; |
228 | ch = 0xfffd; |
208 | #endif |
229 | # endif |
209 | scr_overlay_set (11, y, ch, r); |
230 | scr_overlay_set (11, y, ch, r); |
210 | scr_overlay_set (12, y, NOCHAR, r); |
231 | scr_overlay_set (12, y, NOCHAR, r); |
211 | } |
232 | } |
212 | |
233 | |
|
|
234 | scr_overlay_set (0, len , attr); |
213 | scr_overlay_set (0, len, fname); |
235 | scr_overlay_set (0, len + 1, fname); |
214 | |
236 | |
215 | free (fname); |
237 | free (fname); |
216 | |
238 | |
217 | #if ENABLE_COMBINING |
239 | # if ENABLE_COMBINING |
218 | if (alloc) |
240 | if (alloc) |
219 | delete [] alloc; |
241 | delete [] alloc; |
220 | #endif |
242 | # endif |
221 | } |
|
|
222 | #endif |
243 | #endif |
|
|
244 | } |
223 | |
245 | |
224 | void |
246 | void |
225 | rxvt_term::commit_iso14755 () |
247 | rxvt_term::commit_iso14755 () |
226 | { |
248 | { |
227 | wchar_t ch[2]; |
249 | wchar_t ch[2]; |