aboutsummaryrefslogtreecommitdiffstats
path: root/z14.c
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2024-05-19 00:42:48 +0200
committerMatěj Cepl <mcepl@cepl.eu>2024-05-19 00:42:48 +0200
commiteb3942e15700f3f4f61b4e46917ae8fbe614e524 (patch)
treebe0c003fa8a0dead8d9dc921050ba13a56d1a9dd /z14.c
parent71d625f730d872791eef74d7999e1be28d5e5c7e (diff)
downloadlout-master.tar.gz
Lout 3.41.HEADmaster
http://jeffreykingston.id.au/lout/lout-3.41.tar.gz
Diffstat (limited to 'z14.c')
-rw-r--r--z14.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/z14.c b/z14.c
index 838d809..ccc07cc 100644
--- a/z14.c
+++ b/z14.c
@@ -1,7 +1,7 @@
/*@z14.c:Fill Service:Declarations@*******************************************/
/* */
-/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.39) */
-/* COPYRIGHT (C) 1991, 2008 Jeffrey H. Kingston */
+/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.41) */
+/* COPYRIGHT (C) 1991, 2023 Jeffrey H. Kingston */
/* */
/* Jeffrey H. Kingston (jeff@it.usyd.edu.au) */
/* School of Information Technologies */
@@ -28,6 +28,7 @@
/* */
/*****************************************************************************/
#include "externs.h"
+#include "child.h"
#define TOO_TIGHT_BAD 1048576 /* 2^21; badness of a too tight line */
#define TOO_LOOSE_BAD 65536 /* 2^16; the max badness of a too loose line */
#define TIGHT_BAD 4096 /* 2^12; the max badness of a tight line */
@@ -164,14 +165,16 @@ typedef struct {
/*****************************************************************************/
#define MoveRightToGap(I,x,rlink,right,max_width,etc_width,hyph_word) \
-{ OBJECT newg, foll = nilobj, tmp; int ch; \
+{ OBJECT newg, foll = nilobj /* , tmp */; int ch; \
BOOLEAN jn, unbreakable_at_right = FALSE; \
debug0(DOF, DDD, "MoveRightToGap(I, x, rlink, right, -, -, -)"); \
\
/* search onwards to find newg, the next true breakpoint */ \
+ /* *** \
Child(tmp, rlink); \
debug2(DOF, DDD, "NextDefiniteWithGap(%s, %s)", EchoObject(x), \
EchoObject(tmp)); \
+ *** */ \
NextDefiniteWithGap(x, rlink, foll, newg, jn); \
\
/* set right link and calculate badness of the new interval */ \
@@ -276,6 +279,7 @@ typedef struct {
#define IntervalInit(I, x, max_width, etc_width, hyph_word) \
{ OBJECT rlink, right = nilobj; BOOLEAN jn; \
debug0(DOF, DDD, "IntervalInit(I, x, -, -, hyph_word)"); \
+ I.badness = 0; /* added by JeffK 17/6/23 */ \
I.llink = x; \
\
FirstDefinite(x, rlink, right, jn); \
@@ -290,6 +294,8 @@ typedef struct {
I.nat_width = size(right, COLM); \
I.space_width = 0; \
I.tab_count = 0; \
+ I.width_to_tab = 0; /* in fact undefined, added by JeffK 17/6/23 */ \
+ I.tab_pos = 0; /* in fact undefined, added by JeffK 17/6/23 */ \
\
/* move to gap, check hyphenation there etc. */ \
MoveRightToGap(I,x,rlink,right,max_width,etc_width,hyph_word); \
@@ -572,7 +578,8 @@ static void KernWordLeftMargin(OBJECT first_on_line, OBJECT parent)
kerned_glyphs[kerned_glyph_count] = *wordp;
}
- kerned_glyphs[kerned_glyph_count] = '\0';
+ if( kerned_glyph_count < 20 ) /* added by JeffK 17/6/2023 */
+ kerned_glyphs[kerned_glyph_count] = '\0';
}
if(kerned_glyph_count > 0)
@@ -1057,25 +1064,27 @@ OBJECT FillObject(OBJECT x, CONSTRAINT *c, OBJECT multi, BOOLEAN can_hyphenate,
Child(lgap, llink);
if( mode(gap(lgap)) == ADD_HYPH )
{ OBJECT z, tmp;
- FONT_NUM font;
- FULL_CHAR *unacc = NULL, *word_content;
- unsigned word_len;
+ /* FONT_NUM font; */
+ /* FULL_CHAR *unacc = NULL, *word_content */;
+ /* unsigned word_len; */
/* find word hyphen attaches to, since need its underline and font */
Child(tmp, PrevDown(LastDown(x))); /* last is lgap, so one before */
debug2(DOF, D, "tmp = %s %s", Image(type(tmp)), EchoObject(tmp));
assert(is_word(type(tmp)), "FillObject: !is_word(type(tmp))!");
- word_content = string(tmp);
- word_len = StringLength(word_content);
+ /* word_content = string(tmp); */
+ /* word_len = StringLength(word_content); */
/* get font information */
+ /* ***
font = word_font(tmp);
if (finfo[font].font_table)
{
MAPPING m;
m = font_mapping(finfo[font].font_table);
- unacc = MapTable[m]->map[MAP_UNACCENTED];
+ ** unacc = MapTable[m]->map[MAP_UNACCENTED]; **
}
+ *** */
/* add zero-width gap object */
New(z, GAP_OBJ);