[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 05/18: [gropdf]: Add "notice" diagnostic level.
|
From: |
G. Branden Robinson |
|
Subject: |
[groff] 05/18: [gropdf]: Add "notice" diagnostic level. |
|
Date: |
Fri, 5 Jan 2024 22:25:18 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit 9b05a0db16bc0ddaf7f273de631743bc45aafb8b
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Jan 3 15:15:08 2024 -0600
[gropdf]: Add "notice" diagnostic level.
...for debugging.
* src/devices/gropdf/gropdf.pl (Notice): Add new subroutine. It emits a
diagnostic message only if debugging ("gropdf -d").
(Warn): Prefix diagnostic with severity level here...
(Msg): ...instead of here.
(LoadFont): Demote diagnostic about fonts lacking space glyphs from
warning to ntoice.
Fixes <https://savannah.gnu.org/bugs/?65111>.
---
ChangeLog | 13 +++++++++++++
src/devices/gropdf/gropdf.pl | 20 ++++++++++++++------
2 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index afdc5ed7e..f813fbd58 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,19 @@
* src/utils/grog/grog.pl: Trivially refactor; simplify code.
+2024-01-03 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [gropdf]: Add "notice" diagnostic level for debugging.
+
+ * src/devices/gropdf/gropdf.pl (Notice): Add new subroutine. It
+ emits a diagnostic message only if debugging ("gropdf -d").
+ (Warn): Prefix diagnostic with severity level here...
+ (Msg): ...instead of here.
+ (LoadFont): Demote diagnostic about fonts lacking space glyphs
+ from warning to ntoice.
+
+ Fixes <https://savannah.gnu.org/bugs/?65111>.
+
2024-01-03 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/devices/gropdf/gropdf.pl: Report only "basename" of
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index a78acc54c..4a9e0e3b0 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -2928,9 +2928,21 @@ sub ParsePDFArray
return($rtn);
}
+sub Notice
+{
+ if ($debug)
+ {
+ unshift(@_, "debug: ");
+ my $msg=join('',@_);
+ Msg(0,$msg);
+ }
+}
+
sub Warn
{
- Msg(0,(@_));
+ unshift(@_, "warning: ");
+ my $msg=join('',@_);
+ Msg(0,$msg);
}
sub Die
@@ -2950,10 +2962,6 @@ sub Msg
{
print STDERR "fatal error: ";
}
- else
- {
- print STDERR "warning: ";
- }
print STDERR "$msg\n";
exit 1 if $fatal;
@@ -3230,7 +3238,7 @@ sub LoadFont
$fnt{slant}=$slant;
$fnt{nospace}=(!defined($fnt{NAM}->{u0020}->[PSNAME]) or
$fnt{NAM}->{u0020}->[PSNAME] ne '/space' or !exists($fnt{'spacewidth'}))?1:0;
$fnt{'spacewidth'}=270 if !exists($fnt{'spacewidth'});
- Warn("Using nospace mode for font '$ofontnm'") if $fnt{nospace} == 1 and
$options & USESPACE;
+ Notice("Using nospace mode for font '$ofontnm'") if $fnt{nospace} == 1 and
$options & USESPACE;
$t1flags|=2**0 if $fixwid > -1;
$t1flags|=(exists($fnt{'special'}))?2**2:2**5;
| [Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 05/18: [gropdf]: Add "notice" diagnostic level.,
G. Branden Robinson <=