Update on-the-fly font-substitution patterns for .eps and .svg files
PATCH 1/2 Update on-the-fly font-substitution patterns for .eps and .svg files
Key changes:
o Merge patterns.
o Add patterns to catch default monospace font.
o Use "DejaVu Sans Mono" as a fallback for unmarked monospace (both .eps and .svg) and Courier (only .eps).
o Use FreeSans of gnu-freefont as Symbol font. (mdsymbol is not required any longer.)
o Update rules in Makefile to catch missing nice-to-have font packages and to emit informative messages.
o Update item #9 of FAQ-BUILD.txt to mention the nice-to-have font packages.
"DejaVu Sans Mono" is thicker than Courier or its clone "Nimbus Mono L/PS" and easier to read in diagrams.
---
Hi Paul,
So, this is a follow-up patch to the fix of RCUspacetime.svg. It has a default monospace font specification of:
-inkscape-font-specification:'monospace, Normal';
, which old patterns in fixsvgfonts scripts failed to catch.
My first update was to replace it with "Nimbus Mono L/PS", but it looked too light in the figure.
So I chose "DejaVu Sans Mono" font instead.
As a matter of fact, on some of minimal container images, inkscape picked it as a fall back to the generic 'monospace, Normal' font and it looked nicer to my eyes. "DejaVu Sans Mono" has the same width as "Courier" and "Nimbus Mono L/PS".
fixfonts.sh and fixfonts-urwps.sh are updated similarly. Now, monospace font in .fig files is replaced with "DejaVu Sans Mono".
Affected figures are Figures 4.1 and A.2.
You need to run "make neatfreak" to see the effect of this change.
Do they look reasonable to you?
Thanks, Akira
--
FAQ-BUILD.txt | 5 +++-- Makefile | 27 ++++++++++++++++++--------- utilities/fixfonts-urwps.sh | 5 +++-- utilities/fixfonts.sh | 5 +++-- utilities/fixsvgfonts-urwps.sh | 31 ++++++++++++++----------------- utilities/fixsvgfonts.sh | 19 ++++++++++--------- 6 files changed, 51 insertions(+), 41 deletions(-)
FAQ-BUILD.txt +3 -2
@@ -145,7 +145,7 @@ http://tex.stackexchange.com/questions/88423/ Following is a list of links to font packages perfbook - depends on as of January 2020 which are not included + depends on as of October 2021 which are not included in -fonts-recommended: https://www.ctan.org/pkg/newtx
@@ -154,7 +154,8 @@ https://www.ctan.org/pkg/courier-scaled https://www.ctan.org/pkg/inconsolata https://www.ctan.org/pkg/newtxsf - https://www.ctan.org/pkg/mdsymbol (for Fedora/CentOS) + https://www.ctan.org/pkg/gnu-freefont + https://www.ctan.org/pkg/dejavu Note 1: Manually installing a font package newer than the one already exists in your TeX installation is a tricky business
Makefile +18 -9
@@ -101,14 +101,15 @@ STEELFONT := $(shell fc-list | grep -c -i steel) URWPS := $(shell fc-list | grep "Nimbus Mono PS" | wc -l) # required font packages -FONTPACKAGES := $(shell kpsewhich newtxtext.sty nimbusmono.sty newtxtt.sty newtxsf.sty inconsolata.sty couriers.sty mdsymbol.sty) +FONTPACKAGES := $(shell kpsewhich newtxtext.sty nimbusmono.sty newtxtt.sty newtxsf.sty inconsolata.sty couriers.sty) NEWTXTEXT := $(findstring newtxtext,$(FONTPACKAGES)) NIMBUSMONO := $(findstring nimbusmono,$(FONTPACKAGES)) NEWTXTT := $(findstring newtxtt,$(FONTPACKAGES)) COURIERS := $(findstring couriers,$(FONTPACKAGES)) NEWTXSF := $(findstring newtxsf,$(FONTPACKAGES)) INCONSOLATA := $(findstring inconsolata,$(FONTPACKAGES)) -MDSYMBOL := $(findstring mdsymbol,$(FONTPACKAGES)) +FREESANS := $(shell fc-list | grep FreeSans | wc -l) +DEJAVUMONO := $(shell fc-list | grep "DejaVu Sans Mono" | wc -l) # for line break in error text define n
@@ -122,11 +123,16 @@ FIXANEPSFONTS = utilities/fixanepsfonts.sh else FIXSVGFONTS = utilities/fixsvgfonts-urwps.sh FIXANEPSFONTS = utilities/fixanepsfonts-urwps.sh - ifeq ($(MDSYMBOL),) - NEEDMDSYMBOL := 1 - else - NEEDMDSYMBOL := 0 - endif +endif +ifeq ($(FREESANS),0) + RECOMMEND_FREEFONT := 1 +else + RECOMMEND_FREEFONT := 0 +endif +ifeq ($(DEJAVUMONO),0) + RECOMMEND_DEJAVU := 1 +else + RECOMMEND_DEJAVU := 0 endif STEELFONTID := $(shell fc-list | grep -i steel | grep -c Steel)
@@ -476,8 +482,11 @@ ifeq ($(STEELFONTID),0) else @sh $(FIXSVGFONTS) < $< > $<i endif -ifeq ($(NEEDMDSYMBOL),1) - $(error Font package 'mdsymbol' not found. See #9 in FAQ-BUILD.txt) +ifeq ($(RECOMMEND_FREEFONT),1) + $(info Nice-to-have font package 'gnu-freefont' not found. See #9 in FAQ-BUILD.txt) +endif +ifeq ($(RECOMMEND_DEJAVU),1) + $(info Nice-to-have font package 'dejavu' not found. See #9 in FAQ-BUILD.txt) endif ifeq ($(INKSCAPE_ONE),0) @inkscape --export-pdf=$@ $<i > /dev/null 2>&1
utilities/fixfonts-urwps.sh +3 -2
@@ -19,7 +19,7 @@ # # Copyright (c) 2011-2019 Paul E. McKenney, IBM Corporation. # Copyright (c) 2019 Paul E. McKenney, Facebook. -# Copyright (c) 2018 Akira Yokosawa. +# Copyright (c) 2018, 2021 Akira Yokosawa. sed -e 's+Times-Roman-BoldItalic+NimbusSans-BoldItalic+g' \ -e 's+Times-Roman-Italic+NimbusSans-Italic+g' \
@@ -56,4 +56,5 @@ sed -e 's+Times-Roman-BoldItalic+NimbusSans-BoldItalic+g' \ -e 's+NimbusMono-Regular+NimbusMonoPS-Regular+g' \ -e 's+NimbusSans-Regular-Italic+NimbusSans-Italic+g' \ -e 's+NimbusSans-Regular-BoldItalic+NimbusSans-BoldItalic+g' \ - -e 's+NimbusSans-Regular-Bold+NimbusSans-Bold+g' + -e 's+NimbusSans-Regular-Bold+NimbusSans-Bold+g' \ + -e 's+NimbusMonoPS-Regular+DejaVuSansMono+g'
utilities/fixfonts.sh +3 -2
@@ -17,7 +17,7 @@ # # Copyright (c) 2011-2019 Paul E. McKenney, IBM Corporation. # Copyright (c) 2019 Paul E. McKenney, Facebook. -# Copyright (c) 2018 Akira Yokosawa +# Copyright (c) 2018, 2021 Akira Yokosawa sed -e 's+Times-Roman-BoldItalic+NimbusSanL-BoldItal+g' \ -e 's+Times-Roman-Italic+NimbusSanL-ReguItal+g' \
@@ -44,4 +44,5 @@ sed -e 's+Times-Roman-BoldItalic+NimbusSanL-BoldItal+g' \ -e 's+Courier+NimbusMonL-Regu+g' \ -e 's+NimbusSanL-Regu-Italic+NimbusSanL-ReguItal+g' \ -e 's+NimbusSanL-Regu-BoldItalic+NimbusSanL-BoldItal+g' \ - -e 's+NimbusSanL-Regu-Bold+NimbusSanL-Bold+g' + -e 's+NimbusSanL-Regu-Bold+NimbusSanL-Bold+g' \ + -e 's+NimbusMonL-Regu +DejaVuSansMono +g'
utilities/fixsvgfonts-urwps.sh +14 -17
@@ -3,21 +3,18 @@ # fixsvgfonts-urwps.sh: Convert an .svg file to use embeddable fonts, # taking from standard input and putting on standard output. # -# Copyright (c) 2018 Akira Yokosawa +# Copyright (c) 2018, 2021 Akira Yokosawa -sed -e 's+family:Helvetica+family:Nimbus Sans+g' \ - -e 's+family="Helvetica+family="Nimbus Sans+g' \ - -e 's+family:Sans+family:Nimbus Sans+g' \ - -e 's+cation:Sans+cation:Nimbus Sans+g' \ - -e 's+family:sans-serif+family:Nimbus Sans+g' \ - -e 's+cation:sans-serif+cation:Nimbus Sans+g' \ - -e 's+family:Courier+family:Nimbus Mono PS+g' \ - -e 's+family="Courier+family="Nimbus Mono PS+g' \ - -e 's+family:Symbol+family:MdSymbol+g' \ - -e 's+cation:Symbol+cation:MdSymbol+g' \ - -e 's+family:Nimbus Sans L+family:Nimbus Sans+g' \ - -e 's+family="Nimbus Sans L+family="Nimbus Sans+g' \ - -e 's+cation:Nimbus Sans L+cation:Nimbus Sans+g' \ - -e 's+family:Nimbus Mono L+family:Nimbus Mono PS+g' \ - -e 's+family="Nimbus Mono L+family="Nimbus Mono PS+g' \ - -e 's+cation:Nimbus Mono L+cation:Nimbus Mono PS+g' +sed -e 's+:Helvetica+:Nimbus Sans+g' \ + -e 's+="Helvetica+="Nimbus Sans+g' \ + -e 's+:Sans+:Nimbus Sans+g' \ + -e 's+:sans-serif+:Nimbus Sans+g' \ + -e 's+:Courier+:Nimbus Mono PS+g' \ + -e 's+="Courier+="Nimbus Mono PS+g' \ + -e 's+:monospace+:DejaVu Sans Mono+g' \ + -e 's+monospace,+DejaVu Sans Mono,+g' \ + -e 's+:Symbol+:FreeSans+g' \ + -e 's+:Nimbus Sans L+:Nimbus Sans+g' \ + -e 's+="Nimbus Sans L+="Nimbus Sans+g' \ + -e 's+:Nimbus Mono L+:Nimbus Mono PS+g' \ + -e 's+="Nimbus Mono L+="Nimbus Mono PS+g'
utilities/fixsvgfonts.sh +10 -9
@@ -3,13 +3,14 @@ # fixsvgfonts.sh: Convert an .svg file to use embeddable fonts, taking from # standard input and putting on standard output. # -# Copyright (c) 2018 Akira Yokosawa +# Copyright (c) 2018, 2021 Akira Yokosawa -sed -e 's+family:Helvetica+family:Nimbus Sans L+g' \ - -e 's+family="Helvetica+family="Nimbus Sans L+g' \ - -e 's+family:Sans+family:Nimbus Sans L+g' \ - -e 's+cation:Sans+cation:Nimbus Sans L+g' \ - -e 's+family:sans-serif+family:Nimbus Sans L+g' \ - -e 's+cation:sans-serif+cation:Nimbus Sans L+g' \ - -e 's+family:Courier+family:Nimbus Mono L+g' \ - -e 's+family="Courier+family="Nimbus Mono L+g' +sed -e 's+:Helvetica+:Nimbus Sans L+g' \ + -e 's+="Helvetica+="Nimbus Sans L+g' \ + -e 's+:Sans+:Nimbus Sans L+g' \ + -e 's+:sans-serif+:Nimbus Sans L+g' \ + -e 's+:Courier+:Nimbus Mono L+g' \ + -e 's+="Courier+="Nimbus Mono L+g' \ + -e 's+:monospace+:DejaVu Sans Mono+g' \ + -e 's+monospace,+DejaVu Sans Mono,+g' \ + -e 's+:Symbol+:FreeSans+g'
Signature · 1 line
2.17.1
PATCH 2/2 defer: Adjust height of RCUGuaranteeFwd.svg
Subject: [PATCH -perfbook 2/2] defer: Adjust height of RCUGuaranteeFwd.svg
"P1()" at the bottom is cropped a little.
Fix it by increasing the height parameter a bit.
--- defer/RCUGuaranteeFwd.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
defer/RCUGuaranteeFwd.svg +1 -1
@@ -10,7 +10,7 @@ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="235.50583" - height="270.15079" + height="272.00000" id="svg2" version="1.1" inkscape:version="0.92.3 (2405546, 2018-03-11)"
Signature · 1 line
2.17.1
Quoted 13 lines · Akira Yokosawa
Key changes:
o Merge patterns.
o Add patterns to catch default monospace font.
o Use "DejaVu Sans Mono" as a fallback for unmarked monospace (both .eps and .svg) and Courier (only .eps).
o Use FreeSans of gnu-freefont as Symbol font. (mdsymbol is not required any longer.)
o Update rules inMakefileto catch missing nice-to-have font packages and to emit informative messages.
o Update item #9 of FAQ-BUILD.txt to mention the nice-to-have font packages.
Quoted 4 lines
"DejaVu Sans Mono" is thicker than Courier or its clone "Nimbus Mono L/PS" and easier to read in diagrams.
Signed-off-by Akira Yokosawa <[email protected]>
These look good to me, thank you! Queued and pushed.
Thanx, Paul
Quoted 232 lines
---
Hi Paul,So, this is a follow-up patch to the fix of RCUspacetime.svg. It has a default monospace font specification of:
-inkscape-font-specification:'monospace, Normal';
, which old patterns in fixsvgfonts scripts failed to catch.
My first update was to replace it with "Nimbus Mono L/PS", but it looked too light in the figure.
So I chose "DejaVu Sans Mono" font instead.
As a matter of fact, on some of minimal container images, inkscape picked it as a fall back to the generic 'monospace, Normal' font and it looked nicer to my eyes. "DejaVu Sans Mono" has the same width as "Courier" and "Nimbus Mono L/PS".
fixfonts.shandfixfonts-urwps.share updated similarly. Now, monospace font in .fig files is replaced with "DejaVu Sans Mono".Affected figures are Figures 4.1 and A.2.
You need to run "make neatfreak" to see the effect of this change.
Do they look reasonable to you?
Thanks, Akira
--FAQ-BUILD.txt | 5 +++-- Makefile | 27 ++++++++++++++++++--------- utilities/fixfonts-urwps.sh | 5 +++-- utilities/fixfonts.sh | 5 +++-- utilities/fixsvgfonts-urwps.sh | 31 ++++++++++++++----------------- utilities/fixsvgfonts.sh | 19 ++++++++++--------- 6 files changed, 51 insertions(+), 41 deletions(-)FAQ-BUILD.txt +3
-2@@ -145,7 +145,7 @@ http://tex.stackexchange.com/questions/88423/ Following is a list of links to font packages perfbook - depends on as of January 2020 which are not included + depends on as of October 2021 which are not included in -fonts-recommended: https://www.ctan.org/pkg/newtx@@ -154,7 +154,8 @@ https://www.ctan.org/pkg/courier-scaled https://www.ctan.org/pkg/inconsolata https://www.ctan.org/pkg/newtxsf - https://www.ctan.org/pkg/mdsymbol (for Fedora/CentOS) + https://www.ctan.org/pkg/gnu-freefont + https://www.ctan.org/pkg/dejavu Note 1: Manually installing a font package newer than the one already exists in your TeX installation is a tricky businessMakefile +18
-9@@ -101,14 +101,15 @@ STEELFONT := $(shell fc-list | grep -c -i steel) URWPS := $(shell fc-list | grep "Nimbus Mono PS" | wc -l) # required font packages -FONTPACKAGES := $(shell kpsewhich newtxtext.sty nimbusmono.sty newtxtt.sty newtxsf.sty inconsolata.sty couriers.sty mdsymbol.sty) +FONTPACKAGES := $(shell kpsewhich newtxtext.sty nimbusmono.sty newtxtt.sty newtxsf.sty inconsolata.sty couriers.sty) NEWTXTEXT := $(findstring newtxtext,$(FONTPACKAGES)) NIMBUSMONO := $(findstring nimbusmono,$(FONTPACKAGES)) NEWTXTT := $(findstring newtxtt,$(FONTPACKAGES)) COURIERS := $(findstring couriers,$(FONTPACKAGES)) NEWTXSF := $(findstring newtxsf,$(FONTPACKAGES)) INCONSOLATA := $(findstring inconsolata,$(FONTPACKAGES)) -MDSYMBOL := $(findstring mdsymbol,$(FONTPACKAGES)) +FREESANS := $(shell fc-list | grep FreeSans | wc -l) +DEJAVUMONO := $(shell fc-list | grep "DejaVu Sans Mono" | wc -l) # for line break in error text define n@@ -122,11 +123,16 @@ FIXANEPSFONTS = utilities/fixanepsfonts.sh else FIXSVGFONTS = utilities/fixsvgfonts-urwps.sh FIXANEPSFONTS = utilities/fixanepsfonts-urwps.sh - ifeq ($(MDSYMBOL),) - NEEDMDSYMBOL := 1 - else - NEEDMDSYMBOL := 0 - endif +endif +ifeq ($(FREESANS),0) + RECOMMEND_FREEFONT := 1 +else + RECOMMEND_FREEFONT := 0 +endif +ifeq ($(DEJAVUMONO),0) + RECOMMEND_DEJAVU := 1 +else + RECOMMEND_DEJAVU := 0 endif STEELFONTID := $(shell fc-list | grep -i steel | grep -c Steel)@@ -476,8 +482,11 @@ ifeq ($(STEELFONTID),0) else @sh $(FIXSVGFONTS) < $< > $<i endif -ifeq ($(NEEDMDSYMBOL),1) - $(error Font package 'mdsymbol' not found. See #9 in FAQ-BUILD.txt) +ifeq ($(RECOMMEND_FREEFONT),1) + $(info Nice-to-have font package 'gnu-freefont' not found. See #9 in FAQ-BUILD.txt) +endif +ifeq ($(RECOMMEND_DEJAVU),1) + $(info Nice-to-have font package 'dejavu' not found. See #9 in FAQ-BUILD.txt) endif ifeq ($(INKSCAPE_ONE),0) @inkscape --export-pdf=$@ $<i > /dev/null 2>&1utilities/fixfonts-urwps.sh +3
-2@@ -19,7 +19,7 @@ # # Copyright (c) 2011-2019 Paul E. McKenney, IBM Corporation. # Copyright (c) 2019 Paul E. McKenney, Facebook. -# Copyright (c) 2018 Akira Yokosawa. +# Copyright (c) 2018, 2021 Akira Yokosawa. sed -e 's+Times-Roman-BoldItalic+NimbusSans-BoldItalic+g' \ -e 's+Times-Roman-Italic+NimbusSans-Italic+g' \@@ -56,4 +56,5 @@ sed -e 's+Times-Roman-BoldItalic+NimbusSans-BoldItalic+g' \ -e 's+NimbusMono-Regular+NimbusMonoPS-Regular+g' \ -e 's+NimbusSans-Regular-Italic+NimbusSans-Italic+g' \ -e 's+NimbusSans-Regular-BoldItalic+NimbusSans-BoldItalic+g' \ - -e 's+NimbusSans-Regular-Bold+NimbusSans-Bold+g' + -e 's+NimbusSans-Regular-Bold+NimbusSans-Bold+g' \ + -e 's+NimbusMonoPS-Regular+DejaVuSansMono+g'utilities/fixfonts.sh +3
-2@@ -17,7 +17,7 @@ # # Copyright (c) 2011-2019 Paul E. McKenney, IBM Corporation. # Copyright (c) 2019 Paul E. McKenney, Facebook. -# Copyright (c) 2018 Akira Yokosawa +# Copyright (c) 2018, 2021 Akira Yokosawa sed -e 's+Times-Roman-BoldItalic+NimbusSanL-BoldItal+g' \ -e 's+Times-Roman-Italic+NimbusSanL-ReguItal+g' \@@ -44,4 +44,5 @@ sed -e 's+Times-Roman-BoldItalic+NimbusSanL-BoldItal+g' \ -e 's+Courier+NimbusMonL-Regu+g' \ -e 's+NimbusSanL-Regu-Italic+NimbusSanL-ReguItal+g' \ -e 's+NimbusSanL-Regu-BoldItalic+NimbusSanL-BoldItal+g' \ - -e 's+NimbusSanL-Regu-Bold+NimbusSanL-Bold+g' + -e 's+NimbusSanL-Regu-Bold+NimbusSanL-Bold+g' \ + -e 's+NimbusMonL-Regu +DejaVuSansMono +g'utilities/fixsvgfonts-urwps.sh +14
-17@@ -3,21 +3,18 @@ # fixsvgfonts-urwps.sh: Convert an .svg file to use embeddable fonts, # taking from standard input and putting on standard output. # -# Copyright (c) 2018 Akira Yokosawa +# Copyright (c) 2018, 2021 Akira Yokosawa -sed -e 's+family:Helvetica+family:Nimbus Sans+g' \ - -e 's+family="Helvetica+family="Nimbus Sans+g' \ - -e 's+family:Sans+family:Nimbus Sans+g' \ - -e 's+cation:Sans+cation:Nimbus Sans+g' \ - -e 's+family:sans-serif+family:Nimbus Sans+g' \ - -e 's+cation:sans-serif+cation:Nimbus Sans+g' \ - -e 's+family:Courier+family:Nimbus Mono PS+g' \ - -e 's+family="Courier+family="Nimbus Mono PS+g' \ - -e 's+family:Symbol+family:MdSymbol+g' \ - -e 's+cation:Symbol+cation:MdSymbol+g' \ - -e 's+family:Nimbus Sans L+family:Nimbus Sans+g' \ - -e 's+family="Nimbus Sans L+family="Nimbus Sans+g' \ - -e 's+cation:Nimbus Sans L+cation:Nimbus Sans+g' \ - -e 's+family:Nimbus Mono L+family:Nimbus Mono PS+g' \ - -e 's+family="Nimbus Mono L+family="Nimbus Mono PS+g' \ - -e 's+cation:Nimbus Mono L+cation:Nimbus Mono PS+g' +sed -e 's+:Helvetica+:Nimbus Sans+g' \ + -e 's+="Helvetica+="Nimbus Sans+g' \ + -e 's+:Sans+:Nimbus Sans+g' \ + -e 's+:sans-serif+:Nimbus Sans+g' \ + -e 's+:Courier+:Nimbus Mono PS+g' \ + -e 's+="Courier+="Nimbus Mono PS+g' \ + -e 's+:monospace+:DejaVu Sans Mono+g' \ + -e 's+monospace,+DejaVu Sans Mono,+g' \ + -e 's+:Symbol+:FreeSans+g' \ + -e 's+:Nimbus Sans L+:Nimbus Sans+g' \ + -e 's+="Nimbus Sans L+="Nimbus Sans+g' \ + -e 's+:Nimbus Mono L+:Nimbus Mono PS+g' \ + -e 's+="Nimbus Mono L+="Nimbus Mono PS+g'utilities/fixsvgfonts.sh +10
-9@@ -3,13 +3,14 @@ # fixsvgfonts.sh: Convert an .svg file to use embeddable fonts, taking from # standard input and putting on standard output. # -# Copyright (c) 2018 Akira Yokosawa +# Copyright (c) 2018, 2021 Akira Yokosawa -sed -e 's+family:Helvetica+family:Nimbus Sans L+g' \ - -e 's+family="Helvetica+family="Nimbus Sans L+g' \ - -e 's+family:Sans+family:Nimbus Sans L+g' \ - -e 's+cation:Sans+cation:Nimbus Sans L+g' \ - -e 's+family:sans-serif+family:Nimbus Sans L+g' \ - -e 's+cation:sans-serif+cation:Nimbus Sans L+g' \ - -e 's+family:Courier+family:Nimbus Mono L+g' \ - -e 's+family="Courier+family="Nimbus Mono L+g' +sed -e 's+:Helvetica+:Nimbus Sans L+g' \ + -e 's+="Helvetica+="Nimbus Sans L+g' \ + -e 's+:Sans+:Nimbus Sans L+g' \ + -e 's+:sans-serif+:Nimbus Sans L+g' \ + -e 's+:Courier+:Nimbus Mono L+g' \ + -e 's+="Courier+="Nimbus Mono L+g' \ + -e 's+:monospace+:DejaVu Sans Mono+g' \ + -e 's+monospace,+DejaVu Sans Mono,+g' \ + -e 's+:Symbol+:FreeSans+g'Signature · 1 line
2.17.1