lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev patch to dev15 - JUSTIFY_MAX_VOID_PERCENT


From: Vlad Harchev
Subject: lynx-dev patch to dev15 - JUSTIFY_MAX_VOID_PERCENT
Date: Wed, 24 Nov 1999 17:00:09 +0400 (SAMT)

* small userdefs.h typo fixed
* Added lynx.cfg setting that controls justification - maximum value for
  ratio of 'spaces to spread'/'max width of a line' when justification can
  take place.

 Ilya proposed to spread spaces randomly across the gaps - I don't think it's
 good - generation of random values can take take some time (depends on
 the libc), and I don't think it will imporve text quality very much. troff
 spreads extra spaces with the same algorithm as lynx FYI.
 For those who enjoys justification - I will release the patch that adds
 hyphenation capability (with the use of TeX hyphenation rules) - I have it
 working since early september, but can't release it now for several reasons.
 Hyphenation improves justification-enabled rendering very much IMO - 
 text looks less sparse  - since it helps to break very long words like 
 'internationalization'.

 Best regards,
  -Vlad

diff -ru lynx2-8-3dev15-orig/lynx.cfg lynx2-8-3dev15/lynx.cfg
--- lynx2-8-3dev15-orig/lynx.cfg        Thu Nov  4 00:31:16 1999
+++ lynx2-8-3dev15/lynx.cfg     Wed Nov 24 08:53:09 1999
@@ -2364,6 +2364,16 @@
 #
 #JUSTIFY:TRUE
 
+# JUSTIFY_MAX_VOID_PERCENT - Appearance
+# This option controls the maximum allowed value for ratio (in percents) of 
+# 'the number of spaces to spread across the line to justify it' to 
+# 'max line size for current style and nesting' when justification is allowed.
+# When that ratio execeeds the value specified, that particular line won't be
+# justified. I.e. the value 28 for this setting will mean maximum value for 
+# that ratio is 0.28.
+# 
+#JUSTIFY_MAX_VOID_PERCENT:35
+
 # STICKY_INPUTS - Input
 # This option controls whether all text inputs are sticky.  If input is not
 # sticky, then it won't intercept any keyboard input until user activates it
diff -ru lynx2-8-3dev15-orig/src/GridText.c lynx2-8-3dev15/src/GridText.c
--- lynx2-8-3dev15-orig/src/GridText.c  Thu Nov  4 00:31:17 1999
+++ lynx2-8-3dev15/src/GridText.c       Wed Nov 24 08:34:57 1999
@@ -3022,7 +3022,10 @@
 #ifdef EXP_JUSTIFY_ELTS
     /* now perform justification - by VH */
 
-    if (this_line_was_splitted && spare ) {
+
+    if (this_line_was_splitted && spare && 
+       justify_max_void_percent > 0 && justify_max_void_percent <= 100 
+       && justify_max_void_percent>=((100*spare)/((LYcols-1) - 
(int)style->rightIndent - indent + ctrl_chars_on_previous_line))) {
        /* this is the only case when we need justification*/
        char* jp = previous->data + justify_start_position;
        ht_run_info* r = ht_runs;
diff -ru lynx2-8-3dev15-orig/src/LYGlobalDefs.h 
lynx2-8-3dev15/src/LYGlobalDefs.h
--- lynx2-8-3dev15-orig/src/LYGlobalDefs.h      Thu Nov  4 00:31:18 1999
+++ lynx2-8-3dev15/src/LYGlobalDefs.h   Wed Nov 24 08:39:38 1999
@@ -390,6 +390,7 @@
 
 #ifdef EXP_JUSTIFY_ELTS
 extern BOOL ok_justify;
+extern int justify_max_void_percent;
 #endif
 
 #ifndef NO_DUMP_WITH_BACKSPACES
diff -ru lynx2-8-3dev15-orig/src/LYJustify.h lynx2-8-3dev15/src/LYJustify.h
--- lynx2-8-3dev15-orig/src/LYJustify.h Sat Jul 31 04:38:15 1999
+++ lynx2-8-3dev15/src/LYJustify.h      Wed Nov 24 08:38:50 1999
@@ -10,6 +10,7 @@
 #ifdef EXP_JUSTIFY_ELTS
 
 extern BOOL ok_justify;
+extern int justify_max_void_percent;
 extern BOOL can_justify_here;
 extern BOOL can_justify_here_saved;
 
diff -ru lynx2-8-3dev15-orig/src/LYMain.c lynx2-8-3dev15/src/LYMain.c
--- lynx2-8-3dev15-orig/src/LYMain.c    Thu Nov  4 00:31:18 1999
+++ lynx2-8-3dev15/src/LYMain.c Wed Nov 24 08:38:33 1999
@@ -433,6 +433,7 @@
 
 #ifdef EXP_JUSTIFY_ELTS
 PUBLIC BOOL ok_justify = TRUE;
+PUBLIC int justify_max_void_percent = 35;
 #endif
 
 #ifndef NO_DUMP_WITH_BACKSPACES
diff -ru lynx2-8-3dev15-orig/src/LYReadCFG.c lynx2-8-3dev15/src/LYReadCFG.c
--- lynx2-8-3dev15-orig/src/LYReadCFG.c Thu Nov  4 00:31:19 1999
+++ lynx2-8-3dev15/src/LYReadCFG.c      Wed Nov 24 08:35:51 1999
@@ -1314,6 +1314,7 @@
      PARSE_FUN("jumpfile", CONF_FUN, jumpfile_fun),
 #ifdef EXP_JUSTIFY_ELTS
      PARSE_SET("justify", CONF_BOOL, &ok_justify),
+     PARSE_SET("justify_max_void_percent", CONF_INT, 
&justify_max_void_percent),
 #endif
 #ifdef EXP_KEYBOARD_LAYOUT
      PARSE_FUN("keyboard_layout", CONF_FUN, keyboard_layout_fun),
diff -ru lynx2-8-3dev15-orig/userdefs.h lynx2-8-3dev15/userdefs.h
--- lynx2-8-3dev15-orig/userdefs.h      Thu Nov  4 00:31:20 1999
+++ lynx2-8-3dev15/userdefs.h   Wed Nov 24 08:54:51 1999
@@ -963,7 +963,7 @@
  * Use lynxexec for commands or scripts that generate a screen output which
  * should be held via a prompt to press <return> before returning to Lynx
  * for display of the current document.
- * Use lynxprog for programs such as mail which do require a pause before
+ * Use lynxprog for programs such as mail which do not require a pause before
  * Lynx restores the display of the current document.
  *
  * Execution scripts take the form of a standard


reply via email to

[Prev in Thread] Current Thread [Next in Thread]