gbranden pushed a commit to branch master
in repository groff.
commit 8cbd3ffe72e2c5ca18617e30e8425d528bb6b970
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Jul 4 05:33:00 2025 -0500
[gropdf]: Refactor/rename `OpenFile` subroutine.
* src/devices/gropdf/gropdf.pl (OpenFile): Rename this...
(OpenFontFile): ...to this, reflecting the specificity of its
operation--it opens files corresponding to the output device in the
`$GROFF_FONT_PATH` (or given to the program as `-F` arguments).
---
ChangeLog | 8 ++++++++
src/devices/gropdf/gropdf.pl | 15 +++++++++------
2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9f381084b..f4633da5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-07-04 G. Branden Robinson <[email protected]>
+
+ * src/devices/gropdf/gropdf.pl (OpenFile): Rename this...
+ (OpenFontFile): ...to this, reflecting the specificity of its
+ operation--it opens files corresponding to the output device in
+ the `$GROFF_FONT_PATH` (or given to the program as `-F`
+ arguments).
+
2025-07-04 G. Branden Robinson <[email protected]>
* src/devices/gropdf/gropdf.pl: Trivially refactor. Rename
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index b8c9c13f4..eedd0afdb 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -1176,7 +1176,7 @@ sub LoadDownload
foreach my $dir (@dirs)
{
$f=undef;
- OpenFile(\$f,$dir,"download");
+ OpenFontFile(\$f,$dir,"download");
next if !defined($f);
$found++;
@@ -1211,7 +1211,10 @@ sub LoadDownload
Die("failed to open 'download' file") if !$found;
}
-sub OpenFile
+# Locate and open a file in the groff font directory search path.
+#
+# Return the opened file handle in the first scalar argument `f`.
+sub OpenFontFile
{
my $f=shift;
my $dirs=shift;
@@ -1234,7 +1237,7 @@ sub LoadDesc
{
my $f;
- OpenFile(\$f,$fontPath,"DESC");
+ OpenFontFile(\$f,$fontPath,"DESC");
Die("failed to open device description file 'DESC'")
if !defined($f);
@@ -3394,13 +3397,13 @@ sub LoadFont
return $fontlst{$fontno}->{OBJ} if (exists($fontlst{$fontno}) and $fontnm
eq $fontlst{$fontno}->{FNT}->{name}) ;
my $f;
- OpenFile(\$f,$fontPath,"$fontnm");
+ OpenFontFile(\$f,$fontPath,$fontnm);
if (!defined($f) and $Foundry)
{
# Try with no foundry
$fontnm=~s/.*?-//;
- OpenFile(\$f,$fontPath,$fontnm);
+ OpenFontFile(\$f,$fontPath,$fontnm);
}
Die("unable to open font '$ofontnm' for mounting") if !defined($f);
@@ -3575,7 +3578,7 @@ sub GetType1
my ($head,$body,$tail); # Font contents
my $f;
- OpenFile(\$f,$fontPath,"$file");
+ OpenFontFile(\$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