File: 0004-Drop-non-free-multiple-master-font-code.patch

package info (click to toggle)
fontforge 1%3A20230101~dfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 63,284 kB
  • sloc: ansic: 462,486; python: 6,916; cpp: 214; objc: 122; sh: 101; makefile: 55; xml: 11
file content (189 lines) | stat: -rw-r--r-- 7,536 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
From: Bastian Germann <bage@debian.org>
Date: Mon, 22 Sep 2025 17:00:07 +0200
Subject: Drop non-free multiple master font code

This should be replaced by properly repackaging when upstream has
organised the code to be separate:
https://github.com/fontforge/fontforge/pull/5622
---
--- a/fontforge/othersubrs.c
+++ b/fontforge/othersubrs.c
@@ -32,8 +32,6 @@
 #include "splinefont.h"
 #include "ustring.h"
 
-/* These subroutines are code by Adobe for this exact use (from T1_Spec.pdf) */
-
 	/* 3 0 callothersubr pop pop setcurrentpoint return */
 static const uint8_t subrs0[] = { 3+139, 0+139, 12, 16, 12, 17, 12, 17, 12, 33, 11 };
 	/* 0 1 callothersubr return */
@@ -291,24 +289,6 @@ static const char **default_othersubrs[] = { othersubrs0, othersubrs1, othersubr
 	NULL
 };
 
-/* Lives in private dictionary. Commonly used. I have no docs on it */
-/* (and Adobe's answer when asked about it was "try it and figure out what it does" */
-/*  The first numbers (9.5,72) change in different uses (4.5,34), (4.5,38), (5.5,41), (6.5,50) are other combo */
-/* James Cloos notes that the second number is /StdVW, and the first number is */
-/*  StdVW 8 idiv .5 add */
-/* 
-const char *erode[] = {
-	"/Erode",
-	"{ 9.5 dup 3 -1 roll 0.1 mul exch 0.5 sub mul cvi sub dup mul",
-	"  72 0 dtransform dup mul exch dup mul add le",
-	"    { pop pop 1.0 1.0 }",
-	"    { pop pop 0.0 1.5 }",
-	"  ifelse",
-	"} bind def",
-	NULL
-};
-*/
-
 /* from Adobe Technical Specification #5014, Adobe CMap and CIDFont Files */
 /* Specification, Version 1.0. */
 const char *cid_othersubrs[] = {
@@ -336,144 +336,10 @@ const char *cid_othersubrs[] = {
 
 
 const char *makeblendedfont[] = {
-	"% Copyright (c) 1990-1994 Adobe Systems Incorporated.",
-	"% All Rights Reserved.",
-/* Adobe has posted a copyright notice in 5015.Type1_Supp.pdf with the */
-/*  wrong comment here. I've changed it */
-	"% This code to be used for multiple master fonts.",
-	"% Version 11",
-	"/shareddict where",
-	"{ pop currentshared { setshared } true setshared shareddict }",
-	"{ {} userdict } ifelse dup",
-	"/makeblendedfont where {/makeblendedfont get dup type /operatortype eq {",
-	"pop false} { 0 get dup type /integertype ne",
-	"{pop false} {11 lt} ifelse} ifelse } {true}ifelse",
-	"{/makeblendedfont {",
-	"11 pop",
-	"2 copy length exch /WeightVector get length eq",
-	"{ dup 0 exch {add} forall 1 sub abs .001 gt }",
-	"{ true } ifelse",
-	"{ /makeblendedfont cvx errordict /rangecheck get exec } if",
-	"exch dup dup maxlength dict begin {",
-	"false {/FID /UniqueID /XUID } { 3 index eq or } forall",
-	" { pop pop } { def } ifelse",
-	"} forall",
-	"/XUID 2 copy known{",
-	"get dup length 2 index length sub dup 0 gt{",
-	"exch dup length array copy",
-	"exch 2 index{65536 mul cvi 3 copy put pop 1 add}forall pop/XUID exch def",
-	"}{pop pop}ifelse",
-	"}{pop pop}ifelse",
-	"{ /Private /FontInfo } {",
-	"dup load dup maxlength dict begin {",
-	"false { /UniqueID /XUID } { 3 index eq or } forall",
-	"{ pop pop }{ def } ifelse } forall currentdict end def",
-	"} forall",
-	"dup /WeightVector exch def",
-	"dup /$Blend exch [",
-	"exch false exch",
-	"dup length 1 sub -1 1 {",
-	"1 index dup length 3 -1 roll sub get",
-	"dup 0 eq {",
-	"pop 1 index {/exch load 3 1 roll} if",
-	"/pop load 3 1 roll",
-	"} {dup 1 eq {pop}",
-	"{2 index {/exch load 4 1 roll} if",
-	"3 1 roll /mul load 3 1 roll } ifelse",
-	"1 index {/add load 3 1 roll} if",
-	"exch pop true exch} ifelse",
-	"} for",
-	"pop { /add load } if",
-	"] cvx def",
-	"{2 copy length exch length ne {/makeblendedfont cvx errordict /typecheck get exec}if",
-	"0 0 1 3 index length 1 sub {",
-	"dup 4 index exch get exch 3 index exch get mul add",
-	"} for",
-	"exch pop exch pop}",
-	"{{dup type dup dup /arraytype eq exch /packedarraytype eq or {",
-	"  pop 1 index /ForceBold eq {",
-	"  5 index 0 0 1 3 index length 1 sub {",
-	"  dup 4 index exch get {2 index exch get add } {pop} ifelse",
-	"  } for exch pop exch pop",
-	"  2 index /ForceBoldThreshold get gt 3 copy} {",
-	"{length 1 index length ne { pop false } {",
-	"true exch { type dup /integertype eq exch /realtype eq exch or and } forall",
-	"} ifelse }",
-	"2 copy 8 index exch exec {pop 5 index 5 index exec}",
-	"{exch dup length array 1 index xcheck { cvx } if",
-	"dup length 1 sub 0 exch 1 exch {",
-	"dup 3 index exch get dup type dup /arraytype eq exch /packedarraytype eq or {",
-	"dup 10 index 6 index exec {",
-	"9 index exch 9 index exec} if } if 2 index 3 1 roll put",
-	"} for exch pop exch pop",
-	"} ifelse 3 copy",
-	"1 index dup /StemSnapH eq exch /StemSnapV eq or {",
-	"dup length 1 sub {dup 0 le { exit } if",
-	"dup dup 1 sub 3 index exch get exch 3 index exch get 2 copy eq {",
-	"pop 2 index 2 index 0 put 0 } if le {1 sub}",
-	"{dup dup 1 sub 3 index exch get exch 3 index exch get",
-	"3 index exch 3 index 1 sub exch put",
-	"3 copy put pop",
-	"2 copy exch length 1 sub lt {1 add} if} ifelse} loop pop",
-	"dup 0 get 0 le {",
-	"dup 0 exch {0 gt { exit } if 1 add} forall",
-	"dup 2 index length exch sub getinterval} if } if } ifelse put }",
-	"{/dicttype eq {6 copy 3 1 roll get exch 2 index exec}",
-	"{/makeblendedfont cvx errordict /typecheck get exec} ifelse",
-	"} ifelse pop pop } forall pop pop pop pop }",
-	"currentdict Blend 2 index exec",
-	"currentdict end",
-	"} bind put",
-	"/$fbf {FontDirectory counttomark 3 add -1 roll known {",
-	"cleartomark pop findfont}{",
-	"] exch findfont exch makeblendedfont",
-	"dup /Encoding currentfont /Encoding get put definefont",
-	"} ifelse currentfont /ScaleMatrix get makefont setfont",
-	"} bind put } { pop pop } ifelse exec",
 	NULL
 };
 
 const char *mmfindfont[] = {
-	"/$mmff_origfindfont where {",
-	"  pop save { restore } { pop pop }",
-	"} { {} { def } } ifelse",
-	"/setshared where { pop true } { false } ifelse",
-	"/findfont where pop dup systemdict eq {",
-	"pop { currentshared {{}} { true setshared { false setshared } } ifelse shareddict",
-	"} {{} userdict } ifelse begin",
-	"} { begin { currentdict scheck } { false } ifelse {",
-	"currentshared {{}} { true setshared { false setshared } } ifelse",
-	"} { {} } ifelse } ifelse",
-	"/$mmff_origfindfont /findfont load 3 index exec",
-	"/findfont {",
-	"dup FontDirectory exch known",
-	"{ dup FontDirectory exch get /FontType get 3 ne}",
-	"{ dup SharedFontDirectory exch known",
-	"{ dup SharedFontDirectory exch get /FontType get 3 ne}",
-	"{ false} ifelse} ifelse",
-	"{$mmff_origfindfont} { dup dup length string cvs (_) search {",
-	"cvn dup dup FontDirectory exch known exch SharedFontDirectory exch known or {",
-	"true} {dup length 7 add string dup 0 (%font%) putinterval",
-	"dup 2 index 6 exch dup length string cvs putinterval",
-	"{ status } stopped { pop false } if {",
-	"pop pop pop pop true} {false} ifelse} ifelse {",
-	"$mmff_origfindfont begin pop",
-	"[ exch { (_) search  { { cvr } stopped { pop pop } {",
-	"exch pop exch } ifelse",
-	"} { pop exit } ifelse } loop false /FontInfo where {",
-	"pop FontInfo /BlendAxisTypes 2 copy known {",
-	"get length counttomark 2 sub eq exch pop",
-	"} { pop pop } ifelse } if {",
-	"NormalizeDesignVector",
-	"ConvertDesignVector",
-	"] currentdict exch makeblendedfont",
-	"2 copy exch /FontName exch put",
-	"definefont} { cleartomark $mmff_origfindfont } ifelse end",
-	"} { pop pop pop $mmff_origfindfont } ifelse",
-	"} { pop $mmff_origfindfont } ifelse } ifelse",
-	"} bind 3 index exec",
-	"/SharedFontDirectory dup where { pop pop } { 0 dict 3 index exec } ifelse",
-	"end exec pop exec",
 NULL
 };