gbranden pushed a commit to branch master
in repository groff.
commit 0c88f65d28551224bb8b0b67f3ef1811b29ca26b
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Jul 4 12:41:07 2025 -0500
[gropdf]: Trivially refactor.
* src/devices/gropdf/gropdf.pl: Trivially refactor. Rename global
scalar `fontdir` to `fontPath` to better reflect its syntax.
(LoadDownload, LoadDesc, LoadFont, GetType1): Update dereference
sites.
---
ChangeLog | 8 ++++++++
src/devices/gropdf/gropdf.pl | 17 +++++++++--------
2 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 10ce705b7..9f381084b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-07-04 G. Branden Robinson <[email protected]>
+
+ * src/devices/gropdf/gropdf.pl: Trivially refactor. Rename
+ global scalar `fontdir` to `fontPath` to better reflect its
+ syntax.
+ (LoadDownload, LoadDesc, LoadFont, GetType1): Update dereference
+ sites.
+
2025-07-04 G. Branden Robinson <[email protected]>
* src/devices/gropdf/gropdf.pl: Recast diagnostic messages to
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index ee6f70ce6..b8c9c13f4 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -541,9 +541,10 @@ $PDFver=int($PDFver*10)-10;
# Search for 'font directory': paths in -f opt, shell var
# GROFF_FONT_PATH, default paths
-my $fontdir=$cfg{GROFF_FONT_PATH};
-$fontdir=$ENV{GROFF_FONT_PATH}.$cfg{RT_SEP}.$fontdir if
exists($ENV{GROFF_FONT_PATH});
-$fontdir=$fd.$cfg{RT_SEP}.$fontdir if defined($fd);
+my $fontPath=$cfg{GROFF_FONT_PATH};
+$fontPath=$ENV{GROFF_FONT_PATH}.$cfg{RT_SEP}.$fontPath
+ if exists($ENV{GROFF_FONT_PATH});
+$fontPath=$fd.$cfg{RT_SEP}.$fontPath if defined($fd);
$rot=90 if $frot;
$matrix="0 1 -1 0" if $frot;
@@ -1170,7 +1171,7 @@ sub LoadDownload
my $f;
my $found=0;
- my (@dirs)=split($cfg{RT_SEP},$fontdir);
+ my (@dirs)=split($cfg{RT_SEP},$fontPath);
foreach my $dir (@dirs)
{
@@ -1233,7 +1234,7 @@ sub LoadDesc
{
my $f;
- OpenFile(\$f,$fontdir,"DESC");
+ OpenFile(\$f,$fontPath,"DESC");
Die("failed to open device description file 'DESC'")
if !defined($f);
@@ -3393,13 +3394,13 @@ sub LoadFont
return $fontlst{$fontno}->{OBJ} if (exists($fontlst{$fontno}) and $fontnm
eq $fontlst{$fontno}->{FNT}->{name}) ;
my $f;
- OpenFile(\$f,$fontdir,"$fontnm");
+ OpenFile(\$f,$fontPath,"$fontnm");
if (!defined($f) and $Foundry)
{
# Try with no foundry
$fontnm=~s/.*?-//;
- OpenFile(\$f,$fontdir,$fontnm);
+ OpenFile(\$f,$fontPath,$fontnm);
}
Die("unable to open font '$ofontnm' for mounting") if !defined($f);
@@ -3574,7 +3575,7 @@ sub GetType1
my ($head,$body,$tail); # Font contents
my $f;
- OpenFile(\$f,$fontdir,"$file");
+ OpenFile(\$f,$fontPath,"$file");
Die("unable to open font '$file' for embedding") if !defined($f);
$head=GetChunk($f,1,"currentfile eexec");
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit