From 887b2ec54fc7181ff9e5333fed6d63cfbaf9896d Mon Sep 17 00:00:00 2001 From: zzo38 Date: Sat, 4 Jun 2011 20:43:49 -0700 Subject: [PATCH] (no message) --- texnicard.w | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/texnicard.w b/texnicard.w index 30ebe14..24f911a 100755 --- a/texnicard.w +++ b/texnicard.w @@ -407,6 +407,7 @@ of a pattern. @d forward_one_space 10 @d match_left_side 11 // match at beginning of line @d match_right_side 12 // match at end of line +@d match_eight_bit 13 // match 8-bit encodings and control characters @= typedef struct { @@ -2544,8 +2545,11 @@ information. @d file_state 'F' @d include_state 'I' @d keyword_state 'K' +@d image_state 'M' @d pattern_state 'P' @d subroutine_state 'S' +@d font_state 'T' +@d encoding_state 'U' @d wordforms_state 'W' @d heading 0x80 @@ -5647,7 +5651,7 @@ the letters in the box. box_node*this; // Current node @; @; -#define @!actual box->width +#define @!actual @, box->width actual=(factor*natural)/8+at_size; @; #undef actual @@ -5665,9 +5669,32 @@ the letters in the box. @ @= { for(this=first;*this;this=this->next) { + switch(type_of(this)) { + case chars_node: @; @+break; + case hlist_node: case vlist_node: case rule_node: + @; + @+break; + default: break; // All other nodes are ignored + } } } +@ @= { + scaled w,h,d; + calc_chars(this,&w,&h,&d,tracking<<1); + natural+=w; + if(h>box->height) box->height=h; + if(d>box->depth) box->depth=d; +} + +@ @= { + natural+=this->width; + if(this->height+this->shift_amount>box->height) + box->height=this->height+this->shift_amount; + if(this->depth-this->shift_amount>box->depth) + box->depth=this->depth-this->shift_amount; +} + @ A macro named |actual| is defined above so that this code can be used for both horizontal and for vertical packaging. -- 2.11.4.GIT