This patch will make the font of title bigger than the axes label
(X/Y/Z) and units in PS image output.
This will make the default output more suitable for the book.
Unfortunately the font size is not customizable at SPAD level.
BTW, I checked the original book, most images are without title.
- Qian
--
You received this message because you are subscribed to the Google Groups "FriCAS -
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/398f32cf-5b2d-4000-aed7-a23592c68df1%40gmail.com.
diff --git a/src/graph/Gdraws/Gfun.c b/src/graph/Gdraws/Gfun.c
index 292f8b3b..7e5087b6 100644
--- a/src/graph/Gdraws/Gfun.c
+++ b/src/graph/Gdraws/Gfun.c
@@ -209,7 +209,7 @@ Gdraws_drawFrame(
/* draw title text */
psData[drawIstrps].flag = yes;
- fprintf(fp, "\t%s\tloadFont\n\t%d\t(%s) stringwidth pop sub 2 div\n",
+ fprintf(fp, "\t%s\tloadTitleFont\n\t%d\t(%s) stringwidth pop sub 2 div\n",
"frameDict", twInfo.width, title);
fprintf(fp, "\t%d\t(%s)\t(%s)\tpsDrawIStr\n", 15, title, "title");
diff --git a/src/graph/Gdraws/ps_files/drawIstr.ps b/src/graph/Gdraws/ps_files/drawIstr.ps
index a33dda18..211a9bb4 100644
--- a/src/graph/Gdraws/ps_files/drawIstr.ps
+++ b/src/graph/Gdraws/ps_files/drawIstr.ps
@@ -1,20 +1,28 @@
/psDrawIStr
{ gsave
newpath %% for rectangle
- loadFont
-
/window exch def %% get window type
+ window (title) eq
+ {
+ loadTitleFont
+ /FontH TitleFontHeight def
+ }
+ {
+ loadFont
+ /FontH FontHeight def
+ } ifelse
+
%% draw bounding box with background color
/str exch def %% get text string
str stringwidth pop 1 sub %% width
- FontHeight 1 sub %% height
+ FontH 1 sub %% height
currentfont begin %% get font height
FontBBox
end
/ypos exch def pop %% define ypos
neg ypos add /offset exch def pop
- /offset ypos offset div FontHeight mul def %% define offset
+ /offset ypos offset div FontH mul def %% define offset
/h exch def /w exch def %% define h
/y0 exch def %% define y0
/x0 exch def %% define x0
diff --git a/src/graph/Gdraws/ps_files/header.ps b/src/graph/Gdraws/ps_files/header.ps
index 037914ac..2cd7bb05 100644
--- a/src/graph/Gdraws/ps_files/header.ps
+++ b/src/graph/Gdraws/ps_files/header.ps
@@ -14,6 +14,7 @@
100 dict begin %% using 100 entries in top level dictionary
/FontHeight 12 def
+/TitleFontHeight 20 def
/inch
{ 72 mul }
@@ -37,6 +38,10 @@
{ /Times-Roman findfont FontHeight scalefont setfont }
def
+/loadTitleFont
+ { /Times-Roman findfont TitleFontHeight scalefont setfont }
+ def
+
% draws a rectangle with input operand:
% height
% width