[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 16/25: Refactor X11 font description generation.
From: |
G. Branden Robinson |
Subject: |
[groff] 16/25: Refactor X11 font description generation. |
Date: |
Wed, 2 Mar 2022 05:12:07 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit 3c82cbbfe5c378f8fc274b93cce28624b19a1b8a
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Feb 27 21:18:19 2022 +1100
Refactor X11 font description generation.
Integrate it with our "new" (post-2014) Automake-based build system.
* src/utils/xtotroff/Makefile.in: Delete relic of old build system.
Also, it had a bug: it generated X11 output device 'DESC' files with a
"unitwidth 10" directive even for the "-12" devices, which is not
correct (the in-tree DESC files we've been shipping for years were
nevertheless correct, apparently fixed by hand by James Clark in groff
1.07 [March 1993]).
* src/utils/xtotroff/xtotroff.am: Define `xtotroff` variable for use by
X11 font description generation targets below.
* font/devX100-12/devX100-12.am [!WITHOUT_X11]:
* font/devX100/devX100.am [!WITHOUT_X11]:
* font/devX75-12/devX75-12.am [!WITHOUT_X11]:
* font/devX75/devX75.am [!WITHOUT_X11]: Define devX*_fontdir variables
here.
* font/devX100-12/devX100-12.am:
* font/devX100/devX100.am:
* font/devX75-12/devX75-12.am:
* font/devX75/devX75.am: Add new (phony) targets, variously named
"devX{100,100_12,75,75_12}-font-descriptions", to generate the
corresponding output device's DESC file and run xtotroff(1) to
generate its font description files. Be sure to set the correct
"unitwidth" for the "-12" devices. Add new dependency-only rule
"maintainer-font-descriptions" depending on these new targets for
convenience (and future expansion to devps and devlj4). Add new
devX*_fontsrcdir variable to distinguish the source directory for the
font description files, and use it in the devX*_font-descriptions
targets.
* FOR-RELEASE: Document existence of "maintainer-font-descriptions" Make
target and when to run it.
Running this target with the aforementioned bug fix, overwriting the
in-tree DESC and font description files using data gathered from a
running X server, results in no changes whatsoever. Say what you will
about X11 core font technology--it's stable.
squash Refactor X11 font description generation.
---
ChangeLog | 34 +++++++++++++++++++++
FOR-RELEASE | 12 +++++++-
font/devX100-12/devX100-12.am | 21 +++++++++++--
font/devX100/devX100.am | 21 +++++++++++--
font/devX75-12/devX75-12.am | 23 ++++++++++++--
font/devX75/devX75.am | 21 +++++++++++--
src/utils/xtotroff/Makefile.in | 68 ------------------------------------------
src/utils/xtotroff/xtotroff.am | 4 +++
8 files changed, 123 insertions(+), 81 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a3fb69ee..04f40ec2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,37 @@
+2022-02-27 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ Refactor X11 font description generation. Integrate it with our
+ "new" (post-2014) Automake-based build system.
+
+ * src/utils/xtotroff/Makefile.in: Delete relic of old build
+ system. Also, it had a bug: it generated X11 output device
+ 'DESC' files with a "unitwidth 10" directive even for the "-12"
+ devices, which is not correct (the in-tree DESC files we've been
+ shipping for years were nevertheless correct, apparently fixed
+ by hand by James Clark in groff 1.07 [March 1993]).
+
+ * src/utils/xtotroff/xtotroff.am: Define `xtotroff` variable for
+ use by X11 font description generation targets below.
+
+ * font/devX100-12/devX100-12.am:
+ * font/devX100/devX100.am:
+ * font/devX75-12/devX75-12.am:
+ * font/devX75/devX75.am: Add new (phony) targets, variously
+ named "devX{100,100_12,75,75_12}", to generate the corresponding
+ output device's DESC file and run xtotroff(1) to generate its
+ font description files. Be sure to set the correct "unitwidth"
+ for the "-12" devices. Add new dependency-only rule
+ "maintainer-font-descriptions" depending on these new targets
+ for convenience (and future expansion to devps and devlj4).
+
+ * FOR-RELEASE: Document existence of
+ "maintainer-font-descriptions" Make target and when to run it.
+
+ Running this target with the aforementioned bug fix, overwriting
+ the in-tree DESC and font description files using data gathered
+ from a running X server, results in no changes whatsoever. Say
+ what you will about X11 core font technology--it's stable.
+
2022-02-27 G. Branden Robinson <g.branden.robinson@gmail.com>
Rename and ship "FontMap-X11". xtotroff(1) is not very useful
diff --git a/FOR-RELEASE b/FOR-RELEASE
index 6ed26504..7d2530e8 100644
--- a/FOR-RELEASE
+++ b/FOR-RELEASE
@@ -1,4 +1,4 @@
- Copyright 2013-2021 Free Software Foundation, Inc.
+ Copyright 2013-2022 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
@@ -12,6 +12,16 @@ This file describes how to prepare `groff' for a new release.
* Increment the version number. groff requires an explicit three-part
version, major.minor.revision, due to the .Y register.
+* Update font description files that we generate from external data and
+ provide with our source distribution.
+
+ Directory Format Tool
+ --------- ------ ----
+ devX* X11 core/server font xtotroff
+
+ The make(1) target "maintainer-font-descriptions" produces these font
+ descriptions.
+
* Retrieve current versions of UnicodeData.txt[1] and the Adobe Glyph
List (AGL)[2], and use them with
src/utils/afmtodit/make-afmtodit-tables to update
diff --git a/font/devX100-12/devX100-12.am b/font/devX100-12/devX100-12.am
index 1340b2d0..042245b9 100644
--- a/font/devX100-12/devX100-12.am
+++ b/font/devX100-12/devX100-12.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2020 Free Software Foundation, Inc.
+# Copyright (C) 2014-2022 Free Software Foundation, Inc.
#
# This file is part of 'groff'.
#
@@ -36,12 +36,27 @@ DEVX10012FONTS = \
font/devX100-12/S
if !WITHOUT_X11
-devX10012fontdir = $(fontdir)/devX100-12
-devX10012font_DATA = $(DEVX10012FONTS)
+devX100_12_fontdir = $(top_builddir)/font/devX100-12
+devX100_12_font_DATA = $(DEVX10012FONTS)
endif
EXTRA_DIST += $(DEVX10012FONTS)
+# This target generates font descriptions from core X11 font data
+# returned by a running X server; these are _not_ normally generated
+# during a build, but provided with the groff source distribution.
+#
+# This maintainer-mode target alters files in the source tree.
+maintainer-font-descriptions: devX100-12_font-descriptions
+devX100_12_fontsrcdir = $(top_srcdir)/font/devX100-12
+devX100-12_font-descriptions: $(xtotroff) $(xditview_srcdir)/DESC.in \
+ $(xditview_srcdir)/FontMap-X11
+ $(AM_V_GEN)$(MKDIR_P) $(devX100_12_fontsrcdir) \
+ && sed -e 's/res .*/res 100/;s/unitwidth .*/unitwidth 12/' \
+ $(xditview_srcdir)/DESC.in >$(devX100_12_fontsrcdir)/DESC \
+ && $(xtotroff) -d $(devX100_12_fontsrcdir) -r 100 -s 12 \
+ $(xditview_srcdir)/FontMap-X11
+
# Local Variables:
# mode: makefile-automake
diff --git a/font/devX100/devX100.am b/font/devX100/devX100.am
index 2e655094..c83664a2 100644
--- a/font/devX100/devX100.am
+++ b/font/devX100/devX100.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2020 Free Software Foundation, Inc.
+# Copyright (C) 2014-2022 Free Software Foundation, Inc.
#
# This file is part of 'groff'.
#
@@ -36,12 +36,27 @@ DEVX100FONTS = \
font/devX100/S
if !WITHOUT_X11
-devX100fontdir = $(fontdir)/devX100
-devX100font_DATA = $(DEVX100FONTS)
+devX100_fontdir = $(top_builddir)/font/devX100
+devX100_font_DATA = $(DEVX100FONTS)
endif
EXTRA_DIST += $(DEVX100FONTS)
+# This target generates font descriptions from core X11 font data
+# returned by a running X server; these are _not_ normally generated
+# during a build, but provided with the groff source distribution.
+#
+# This maintainer-mode target alters files in the source tree.
+maintainer-font-descriptions: devX100_font-descriptions
+devX100_fontsrcdir=$(top_srcdir)/font/devX100
+devX100_font-descriptions: $(xtotroff) $(xditview_srcdir)/DESC.in \
+ $(xditview_srcdir)/FontMap-X11
+ $(AM_V_GEN)$(MKDIR_P) $(devX100_fontsrcdir) \
+ && sed -e 's/res .*/res 100/' $(xditview_srcdir)/DESC.in \
+ >$(devX100_fontsrcdir)/DESC \
+ && $(xtotroff) -d $(devX100_fontsrcdir) -r 100 -s 10 \
+ $(xditview_srcdir)/FontMap-X11
+
# Local Variables:
# mode: makefile-automake
diff --git a/font/devX75-12/devX75-12.am b/font/devX75-12/devX75-12.am
index adbea39f..057c862f 100644
--- a/font/devX75-12/devX75-12.am
+++ b/font/devX75-12/devX75-12.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2020 Free Software Foundation, Inc.
+# Copyright (C) 2014-2022 Free Software Foundation, Inc.
#
# This file is part of 'groff'.
#
@@ -34,12 +34,29 @@ DEVX7512FONTS = \
font/devX75-12/NB \
font/devX75-12/NBI \
font/devX75-12/S
+
if !WITHOUT_X11
-devX7512fontdir = $(fontdir)/devX75-12
-devX7512font_DATA = $(DEVX7512FONTS)
+devX75_12_fontdir = $(top_builddir)/font/devX75-12
+devX75_12_font_DATA = $(DEVX7512FONTS)
endif
+
EXTRA_DIST += $(DEVX7512FONTS)
+# This target generates font descriptions from core X11 font data
+# returned by a running X server; these are _not_ normally generated
+# during a build, but provided with the groff source distribution.
+#
+# This maintainer-mode target alters files in the source tree.
+maintainer-font-descriptions: devX75-12_font-descriptions
+devX75_12_fontsrcdir=$(top_srcdir)/font/devX75-12
+devX75-12_font-descriptions: $(xtotroff) $(xditview_srcdir)/DESC.in \
+ $(xditview_srcdir)/FontMap-X11
+ $(AM_V_GEN)$(MKDIR_P) $(devX75_12_fontsrcdir) \
+ && sed -e 's/res .*/res 75/;s/unitwidth .*/unitwidth 12/' \
+ $(xditview_srcdir)/DESC.in >$(devX75_12_fontsrcdir)/DESC \
+ && $(xtotroff) -d $(devX75_12_fontsrcdir) -r 75 -s 12 \
+ $(xditview_srcdir)/FontMap-X11
+
# Local Variables:
# mode: makefile-automake
diff --git a/font/devX75/devX75.am b/font/devX75/devX75.am
index 6bdfd070..68a759e7 100644
--- a/font/devX75/devX75.am
+++ b/font/devX75/devX75.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2020 Free Software Foundation, Inc.
+# Copyright (C) 2014-2022 Free Software Foundation, Inc.
#
# This file is part of 'groff'.
#
@@ -36,12 +36,27 @@ DEVX75FONTS = \
font/devX75/S
if !WITHOUT_X11
-devX75fontdir = $(fontdir)/devX75
-devX75font_DATA = $(DEVX75FONTS)
+devX75_fontdir = $(top_builddir)/font/devX75
+devX75_font_DATA = $(DEVX75FONTS)
endif
EXTRA_DIST += $(DEVX75FONTS)
+# This target generates font descriptions from core X11 font data
+# returned by a running X server; these are _not_ normally generated
+# during a build, but provided with the groff source distribution.
+#
+# This maintainer-mode target alters files in the source tree.
+maintainer-font-descriptions: devX75_font-descriptions
+devX75_fontsrcdir=$(top_srcdir)/font/devX75
+devX75_font-descriptions: $(xtotroff) $(xditview_srcdir)/DESC.in \
+ $(xditview_srcdir)/FontMap-X11
+ $(AM_V_GEN)$(MKDIR_P) $(devX75_fontsrcdir) \
+ && sed -e 's/res .*/res 75/' $(xditview_srcdir)/DESC.in \
+ >$(devX75_fontsrcdir)/DESC \
+ && $(xtotroff) -d $(devX75_fontsrcdir) -r 75 -s 10 \
+ $(xditview_srcdir)/FontMap-X11
+
# Local Variables:
# mode: makefile-automake
diff --git a/src/utils/xtotroff/Makefile.in b/src/utils/xtotroff/Makefile.in
deleted file mode 100644
index edf77382..00000000
--- a/src/utils/xtotroff/Makefile.in
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright (C) 2004-2020 Free Software Foundation, Inc.
-# Written by James Clark (jjc@jclark.com)
-#
-# This file is part of groff.
-#
-# groff is free software; you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free
-# Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# groff is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-builddir=@abs_builddir@
-top_srcdir=@abs_top_srcdir@
-top_builddir=@abs_top_builddir@
-SHELL=@SHELL@
-
-devdir=$(top_builddir)/font
-driverdir=$(top_srcdir)/src/devices/xditview
-mkinstalldirs=$(SHELL) $(top_srcdir)/mkinstalldirs
-
-xtotroff=$(builddir)/xtotroff
-DPIS=75 100
-
-RM=rm -f
-
-all:
- @echo "Say 'make fonts' to generate fonts for gxditview."
-
-fonts: $(xtotroff) $(driverdir)/DESC.in $(driverdir)/FontMap
- fonts=`sed -e 's/[ ].*//' $(driverdir)/FontMap`; \
- for dpi in $(DPIS); do \
- echo Making devX$$dpi; \
- test -d $(devdir)/devX$$dpi \
- || $(mkinstalldirs) $(devdir)/devX$$dpi; \
- $(RM) $(devdir)/devX$$dpi/DESC; \
- sed -e "s/res 75/res $$dpi/" $(driverdir)/DESC.in \
- >$(devdir)/devX$$dpi/DESC; \
- (cd $(devdir)/devX$$dpi; \
- $(RM) Makefile.sub; \
- echo DEV=X$$dpi >Makefile.sub; \
- echo DEVFILES=DESC $$fonts >>Makefile.sub; \
- $(xtotroff) -r $$dpi -s 10 $(driverdir)/FontMap); \
- echo Making devX$$dpi-12; \
- test -d $(devdir)/devX$$dpi-12 \
- || $(mkinstalldirs) $(devdir)/devX$$dpi-12; \
- $(RM) $(devdir)/devX$$dpi-12/DESC; \
- sed -e "s/res 75/res $$dpi/" \
- -e 's/unitwidth 10/unitwidth 12/' $(driverdir)/DESC.in \
- >$(devdir)/devX$$dpi-12/DESC; \
- (cd $(devdir)/devX$$dpi-12; \
- $(RM) Makefile.sub; \
- echo DEV=X$$dpi-12 >Makefile.sub; \
- echo DEVFILES=DESC $$fonts >>Makefile.sub; \
- $(xtotroff) -r $$dpi -s 12 $(driverdir)/FontMap); \
- done
-
-########################################################################
-#
-# Local Variables:
-# mode: makefile
-# End:
diff --git a/src/utils/xtotroff/xtotroff.am b/src/utils/xtotroff/xtotroff.am
index cd505fa2..7a1e22bb 100644
--- a/src/utils/xtotroff/xtotroff.am
+++ b/src/utils/xtotroff/xtotroff.am
@@ -26,6 +26,10 @@ xtotroff_CPPFLAGS = $(AM_CPPFLAGS) $(X_CFLAGS)
endif
EXTRA_DIST += src/utils/xtotroff/xtotroff.1.man
+# Define variable needed only for the targets that regenerate
+# descriptions of X11 core fonts (used in "maintainer mode").
+xtotroff=$(top_builddir)/xtotroff
+
# Local Variables:
# fill-column: 72
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 16/25: Refactor X11 font description generation.,
G. Branden Robinson <=