void concater_rep::ghost (string s, path ip, color col) { if ((N(s)>2) && (s[0]=='<') && (s[N(s)-1]=='>')) { ghost ("<", ip, col); ghost (s (1,N(s)-1), ip, col); ghost (">", ip, col); return; } string fn_name= "cmr"; if (N(s)==1) { if (s[0] == '<') { fn_name= "cmsy"; s= "h"; } else if (s[0] == '>') { fn_name= "cmsy"; s= "i"; } else if (s[0] == '|') { fn_name= "cmsy"; s= "j"; } else if (s[0] == '\\') { fn_name= "cmsy"; s= "n"; } else if (s[0] == '{') { fn_name= "cmsy"; s= "f"; } else if (s[0] == '}') { fn_name= "cmsy"; s= "g"; } } int sz= script (env->fn_size, env->index_level); font gfn (tex_font (fn_name, sz, (int) (env->magn*env->dpi))); box b= text_box (decorate (ip), 0, s, gfn, col); array<box> bs (1); bs[0]= b; a << line_item (STD_ITEM, OP_SKIP, composite_box (decorate (ip), bs), HYPH_INVALID); }
void concater_rep::marker (path ip) { if (is_decoration (ip)) ip= path (0, ip); string fn_name= "cmr"; int sz= script (env->fn_size, env->index_level); font gfn (tex_font (fn_name, sz, (int) (env->magn*env->dpi))); box b= text_box (ip->next, ip->item, "", gfn, blue); a << line_item (MARKER_ITEM, OP_SKIP, b, HYPH_INVALID); }
/*static*/ void hyphenate (line_item item, int pos, line_item& item1, line_item& item2) { path ip= item->b->ip; int x1= is_accessible (ip)? item->b->get_leaf_left_pos (): 0; int x2= is_accessible (ip)? x1+ pos+ 1: 0; box b= item->b; string s = b->get_leaf_string (); font fn = b->get_leaf_font (); pencil pen= b->get_leaf_pencil (); string s1, s2; array<int> hp= item->lan->get_hyphens (s); item->lan->hyphenate (s, pos, s1, s2); item1= line_item (STRING_ITEM, OP_SKIP, shorter_box (ip, text_box (ip, x1, s1, fn, pen), pos+ 1), hp[pos], item->lan); item2= line_item (STRING_ITEM, item->op_type, text_box (ip, x2, s2, fn, pen), item->penalty, item->lan); item2->spc= item->spc; // cout << s << " ---> " << s1 << " " << s2 << "\n"; }
void bridge_ornamented_rep::insert_ornament (box b) { /* ttt->insert_marker (st, ip); array<page_item> l2= array<page_item> (1); l2[0]= page_item (b); ttt->insert_stack (l2, stack_border ()); */ lazy_paragraph par (env, ip); par->a= copy (ttt->a); par->a << line_item (STD_ITEM, env->mode_op, b, HYPH_INVALID); par->a << ttt->b; par->format_paragraph (); ttt->insert_stack (par->sss->l, par->sss->sb); }
void concater_rep::control (tree t, path ip) { box b= empty_box (ip, 0, 0, 0, env->fn->yx); a << line_item (CONTROL_ITEM, OP_SKIP, b, HYPH_INVALID, t); }
void concater_rep::print (int type, int op_type, box b) { a << line_item (type, op_type, b, HYPH_INVALID); }
void concater_rep::print (box b) { a << line_item (STD_ITEM, env->mode_op, b, HYPH_INVALID); }