From 59bc2cdaed84e9e323358845e83aba1a3a006e38 Mon Sep 17 00:00:00 2001 From: mstsirkin Date: Sun, 12 Jan 2014 11:03:18 +0000 Subject: makehtml.sh: drop workaround, add warning Issues in html generation turn out to be due to tex4ht being unable to find fonts due to misconfigured font paths. As we are unable to work-around them properly anyway replace work-around with a warning and print suggestions for fixing the config. Signed-off-by: Michael S. Tsirkin git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@182 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652 --- makehtml.sh | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/makehtml.sh b/makehtml.sh index 2ca387b..cad297c 100755 --- a/makehtml.sh +++ b/makehtml.sh @@ -19,17 +19,29 @@ sed 's/>~/>"/g' $SPECDOC.tmp2 >$SPECDOC.tmp3 sed 's/>=~/>="/g' $SPECDOC.tmp3 >$SPECDOC.tmp4 sed 's/~$SPECDOC.tmp5 -#For some unclear reason we get 'fi' replaced by NULL character -# on Fedora. file recognizes result as a binary data. -# Detect and work around this. +# If font paths are misconfigured, we get ligatures +# (such as 'ff or 'fi') replaced by NULL character in output. +# This in not a valid HTML output, so detect this and warn user. +# For detection, we rely on the fact that file utility +# recognizes files with NULL characters as binary data. if test `file -b $SPECDOC.tmp5` = 'data'; then - perl -p -e 's/\0/fi/g' $SPECDOC.tmp5 >$SPECDOC.tmp6 -else - cp $SPECDOC.tmp5 $SPECDOC.tmp6 + echo + echo WARNING! + echo + echo NULL characters detected in file output. + echo This is likely due to tex4ht being unable to find font files. + echo If installed, you might need to fix font file paths + echo for tex4ht by locating tex4ht.env file in your setup + echo correcting font file paths there and copying it to + echo tex4ht.env or .tex4ht in your home directory. + echo + echo WARNING! + echo Proceeding but HTML output appears to be malformed. + echo fi -mv $SPECDOC.tmp6 $SPECDOC.html +mv $SPECDOC.tmp5 $SPECDOC.html rm $SPECDOC.tmp* #uncomment if you have a broken t4ht -- cgit v1.2.3