summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/fonts/source/public/fdsymbol/fdbase.mf
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/fonts/source/public/fdsymbol/fdbase.mf')
-rw-r--r--Master/texmf-dist/fonts/source/public/fdsymbol/fdbase.mf58
1 files changed, 40 insertions, 18 deletions
diff --git a/Master/texmf-dist/fonts/source/public/fdsymbol/fdbase.mf b/Master/texmf-dist/fonts/source/public/fdsymbol/fdbase.mf
index 7c5b193d3d0..31cc8f69870 100644
--- a/Master/texmf-dist/fonts/source/public/fdsymbol/fdbase.mf
+++ b/Master/texmf-dist/fonts/source/public/fdsymbol/fdbase.mf
@@ -10,7 +10,7 @@ design_size := 10;
font_size design_size * pt#;
if known ps_output:
- font_version := "1.003";
+ font_version := "1.004";
font_comment := "Copyright (c) 2011, Michael Ummels. This Font Software is licensed under the SIL Open Font License, Version 1.1.";
fi
@@ -44,11 +44,12 @@ med_op_size# := 12.5u#; % radius of medium operators
plus_size# := 9u#;
large_op_size# := 18u#; % radius of large operators
order_width# := 8u#; % width of equal sign
+turnstile_width# := 11u#; % width of turnstile symbols
equal_spread# := .7math_axis#; % distance between the lines of the equal sign
greater_spread# := 10/4equal_spread#; % distance between the ends of the greater sign
-arrow_horiz_len# := 12u#; % length of horizontal arrows
-arrow_vert_len# := 3math_axis#; % length of vertical arrows
-arrow_diag_len# := 0.5(arrow_horiz_len# + arrow_vert_len#);
+arrow_horiz_len# := 12.5u#; % length of horizontal arrows
+arrow_vert_len# := 12.5u#; % length of vertical arrows
+arrow_diag_len# := 1/2(arrow_horiz_len# + arrow_vert_len#);
arrow_spread# := 1.6equal_spread#;
delim_height# := 4.9pt#; % half the height of normal delimiters
bigop_height# := 10.7pt#; % height of big operators
@@ -57,7 +58,7 @@ mode_setup;
define_pixels(u, asc_height, cap_height, desc_depth, delim_height, bigop_height, x_height);
define_whole_pixels(dot_size, small_op_size, med_op_size, large_op_size, plus_size,
- order_width, equal_spread, greater_spread,
+ order_width, turnstile_width, equal_spread, greater_spread,
arrow_horiz_len, arrow_vert_len, arrow_diag_len, arrow_spread);
if known ps_output:
@@ -73,6 +74,18 @@ stroke_through_thickness := 9/10line_thickness;
% Macros
+% Redefine clockwise and counterclockwise (turningnumber seems more stable)
+if known ps_output:
+ vardef counterclockwise primary p =
+ (if turningnumber p>0: p else: (reverse p) fi)
+ enddef;
+
+ vardef clockwise primary p =
+ (if turningnumber p<0: p else: (reverse p) fi)
+ enddef;
+fi
+
+% Selects the n-th element of a list
def select(expr n)(text values) =
begingroup;
i := 0;
@@ -85,14 +98,11 @@ def select(expr n)(text values) =
endgroup
enddef;
+% Splits a length at the math axis
def vcentre(expr size) =
size/2 + math_axis#, size/2 - math_axis#
enddef;
-def ocentre(expr size) =
- size/2 + math_axis# + 1/2equal_spread#, size/2 - math_axis# - 1/2equal_spread#
-enddef;
-
current_char := -1;
def beginsymbol(expr width, height, depth) =
@@ -108,11 +118,11 @@ def beginoperator(expr size, ratio) =
beginsymbol(size + 2side_bearing#, vcentre(ratio * size));
pair centre;
centre := (w/2, (h-d)/2);
- radius := w/2 - side_bearing - 1/2line_thickness;
+ radius := w/2 - side_bearing - 1/2line_thickness;
enddef;
def beginbigop(expr xscale, yscale) =
- beginsymbol(xscale * 3/2order_width# + 2side_bearing#, ocentre(yscale * bigop_height#));
+ beginsymbol(xscale * 3/2order_width# + 2side_bearing#, vcentre(yscale * bigop_height#));
pair centre;
centre := (w/2, (h-d)/2);
op_width := xscale * 3/2order_width;
@@ -120,7 +130,7 @@ def beginbigop(expr xscale, yscale) =
enddef;
def beginsquarebigop(expr xscale, yscale) =
- beginsymbol(xscale * bigop_height# + 2side_bearing#, ocentre(yscale * bigop_height#));
+ beginsymbol(xscale * bigop_height# + 2side_bearing#, vcentre(yscale * bigop_height#));
pair centre;
centre := (w/2, (h-d)/2);
op_width := xscale * bigop_height;
@@ -139,8 +149,7 @@ def beginarrow(expr angle, scale, spread) =
else: arrow_diag_len
fi;
- beginsymbol(arrow_len# * abs (cosd (angle)) + (spread + line_thickness#) * abs (sind (angle)) + 2side_bearing#,
- vcentre(arrow_len# * abs (sind (angle)) + (spread + line_thickness#) * abs (cosd (angle))));
+ beginsymbol(arrow_len# * abs(cosd(angle)) + (spread + line_thickness#) * abs(sind(angle)) + 2side_bearing#, vcentre(arrow_len# * abs(sind(angle)) + (spread + line_thickness#) * abs(cosd(angle))));
pair centre, head, head_ex, foot, foot_ex;
centre := (w/2, (h-d)/2);
@@ -148,7 +157,6 @@ def beginarrow(expr angle, scale, spread) =
head_ex := centre + arrow_len/2 * dir angle;
foot := centre - (arrow_len - line_thickness)/2 * dir angle;
foot_ex := centre - arrow_len/2 * dir angle;
- arrow_dir := angle;
enddef;
def beginorder(expr sign, width, spread) =
@@ -161,7 +169,21 @@ def beginorder(expr sign, width, spread) =
right_point := centre + sign * (w/2 - side_bearing - line_thickness/2) * right;
enddef;
-% Make strokes run anti-clockwise
+def beginturnstile(expr angle, scale) =
+ beginsymbol(abs(sind(angle) + scale * cosd(angle)) * turnstile_width# + 2side_bearing#, abs(min(scale, 1 + (scale - 1)/2) * sind(angle) + cosd(angle)) * cap_height#, abs(max(0, (scale - 1)/2) * sind(angle)) * cap_height#);
+ pair foot;
+
+ if angle mod 180 = 0:
+ len := scale * turnstile_width;
+ spread := cap_height - line_thickness;
+ else:
+ len := scale * cap_height;
+ spread := turnstile_width - line_thickness;;
+ fi
+ foot = (w/2, (h - d)/2) - (len - line_thickness)/2 * dir angle;
+enddef;
+
+% Strokes a pen path
vardef stroke text t =
forsuffixes e = l, r:
path_.e := t;
@@ -438,8 +460,8 @@ enddef;
def stroke_through_arrow(expr pos, alpha, spread)(text angles) =
begingroup;
- stroke_dir := arrow_dir + select(alpha/45)(angles);
- stroke_len := 1/2spread / sind (stroke_dir - arrow_dir);
+ stroke_dir := alpha + select(alpha / 45)(angles);
+ stroke_len := 1/2spread / sind (stroke_dir - alpha);
draw_straight(pos + stroke_len * dir stroke_dir, pos - stroke_len * dir stroke_dir, stroke_through_thickness, true);
endgroup;